Skip to content

Commit bef8eca

Browse files
committed
conda
1 parent 93b5040 commit bef8eca

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

.github/workflows/pt-testing.yml

+6-14
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,15 @@ jobs:
2929
timeout-minutes: 20
3030
steps:
3131
- uses: actions/checkout@v2
32-
#- name: Set up Python ${{ matrix.python-version }}
33-
# uses: actions/setup-python@v2
34-
# with:
35-
# python-version: ${{ matrix.python-version }}
3632

37-
# TODO: use conda instead
3833
# https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
3934
- name: Setup conda
4035
uses: s-weigand/setup-conda@v1
4136
with:
4237
update-conda: true
4338
python-version: ${{ matrix.python-version }}
4439
conda-channels: anaconda, conda-forge
40+
activate-conda: true
4541

4642
# TODO: add conda/pip caching
4743
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
@@ -55,27 +51,21 @@ jobs:
5551
# ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-pip-
5652

5753
- name: Install stable PyTorch version
58-
if: matrix.pytorch-version <= 1.5
54+
if: matrix.pytorch-version <= 1.6
5955
run: |
6056
conda install pytorch=${{ matrix.pytorch-version }} --channel pytorch
61-
conda list
6257
shell: bash
6358

6459
- name: Install nightly PyTorch version
65-
if: matrix.pytorch-version > 1.5
60+
if: matrix.pytorch-version > 1.6
6661
run: |
6762
conda install pytorch=${{ matrix.pytorch-version }} --channel pytorch-nightly
68-
conda list
6963
shell: bash
7064

7165
- name: Install dependencies
7266
run: |
73-
python -c "fname = 'requirements/base.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('torch')] ; open(fname, 'w').writelines(lines)"
7467
# python -m pip install --upgrade --user pip
75-
conda install --file ./requirements/base.txt --quiet --channel conda-forge
76-
HOROVOD_BUILD_ARCH_FLAGS="-mfma" conda install --file ./requirements/extra.txt --quiet --channel conda-forge
77-
conda install --file ./requirements/test.txt --quiet --channel conda-forge
78-
conda install --file ./requirements/examples.txt --quiet --channel conda-forge
68+
HOROVOD_BUILD_ARCH_FLAGS="-mfma" conda env update --file environment.yml --name base
7969
python --version
8070
conda info
8171
conda list
@@ -84,6 +74,7 @@ jobs:
8474
- name: Reinstall Horovod if necessary
8575
if: runner.os != 'windows' && matrix.python-version != '3.8'
8676
run: |
77+
# conda activate base
8778
HOROVOD_BUILT=$(python -c "import horovod.torch; horovod.torch.nccl_built(); print('SUCCESS')")
8879
if [[ $HOROVOD_BUILT != "SUCCESS" ]]; then
8980
pip uninstall -y horovod
@@ -101,6 +92,7 @@ jobs:
10192

10293
- name: Tests
10394
run: |
95+
# conda activate base
10496
# NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003
10597
python -m pytest pytorch_lightning tests pl_examples -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
10698
# coverage report

0 commit comments

Comments
 (0)