From f2ba0a4aa9949f6b30d60f4f7fef232021fabe4c Mon Sep 17 00:00:00 2001 From: Jeff Yang Date: Sat, 24 Oct 2020 19:10:47 +0630 Subject: [PATCH 01/23] Update setup.cfg --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 00608f0487c0..cae9c5153343 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,3 +28,5 @@ markers = distributed: mark a test with distributed option multinode_distributed: mark a test with multi-node distributed option tpu: mark a test as requiring XLA +addopts = + --color=yes From 39a746d0b5fa97a8796479a45bc595e9685746d8 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Wed, 11 Nov 2020 18:16:38 +0630 Subject: [PATCH 02/23] [ci] use actions/cache@v2 for caching --- .github/workflows/hvd-tests.yml | 84 ++++++++++++--------- .github/workflows/pytorch-version-tests.yml | 49 +++++++----- 2 files changed, 81 insertions(+), 52 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 9917729bd898..264fde225bb9 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -2,16 +2,16 @@ name: Run Horovod tests on: push: paths: - - 'ignite/**' - - 'tests/ignite/**' - - 'tests/run_cpu_tests.sh' - - '.github/workflows/hvd-tests.yml' + - "ignite/**" + - "tests/ignite/**" + - "tests/run_cpu_tests.sh" + - ".github/workflows/hvd-tests.yml" pull_request: paths: - - 'ignite/**' - - 'tests/ignite/**' - - 'tests/run_cpu_tests.sh' - - '.github/workflows/hvd-tests.yml' + - "ignite/**" + - "tests/ignite/**" + - "tests/run_cpu_tests.sh" + - ".github/workflows/hvd-tests.yml" jobs: horovod-tests: @@ -20,33 +20,47 @@ jobs: matrix: python-version: [3.7] pytorch-channel: [pytorch] - steps: - - uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v2 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - - name: Install dependencies - shell: bash -l {0} - run: | - #install other dependencies - conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} - pip install -r requirements-dev.txt - pip install horovod - python setup.py install - - - name: Run Tests - shell: bash -l {0} - run: | - SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} CI_PYTHON_VERSION="${{ matrix.python-version }}" bash tests/run_cpu_tests.sh - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml - flags: hvd-cpu - fail_ci_if_error: true + - uses: actions/cache@v2 + with: + path: ~/conda_pkgs_dir + key: py${{ matrix.python-version }}-conda-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + py${{ matrix.python-version }}-conda- + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: py${{ matrix.python-version }}-pip-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + py${{ matrix.python-version }}-pip- + + - name: Install dependencies + shell: bash -l {0} + run: | + #install other dependencies + conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} + pip install -r requirements-dev.txt + pip install horovod + python setup.py install + + - name: Run Tests + shell: bash -l {0} + run: | + SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} CI_PYTHON_VERSION="${{ matrix.python-version }}" bash tests/run_cpu_tests.sh + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + flags: hvd-cpu + fail_ci_if_error: true diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 5f77f012f60e..72e1051bb233 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -2,7 +2,7 @@ on: # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule schedule: # Run at 00:00 UTC Every Day - - cron: '0 0 * * *' + - cron: "0 0 * * *" jobs: build: @@ -20,22 +20,37 @@ jobs: python-version: 3.5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - - name: Install dependencies - shell: bash -l {0} - run: | - conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch - pip install -r requirements-dev.txt - python setup.py install + - uses: actions/cache@v2 + with: + path: ~/conda_pkgs_dir + key: py${{ matrix.python-version }}-conda-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + py${{ matrix.python-version }}-conda- - - name: Run Tests - shell: bash -l {0} - run: | - py.test tests -vvv + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: py${{ matrix.python-version }}-pip-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + py${{ matrix.python-version }}-pip- + + - name: Install dependencies + shell: bash -l {0} + run: | + conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch + pip install -r requirements-dev.txt + python setup.py install + + - name: Run Tests + shell: bash -l {0} + run: | + pytest tests -vvv From 3f84742c879c8733803602aae50cd18ff11ca92d Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Wed, 11 Nov 2020 20:04:59 +0630 Subject: [PATCH 03/23] cache with date in one step --- .github/workflows/hvd-tests.yml | 99 +++++++++++---------- .github/workflows/pytorch-version-tests.yml | 75 ++++++++-------- .github/workflows/tpu-tests.yml | 20 +++++ .github/workflows/unit-tests.yml | 20 +++++ 4 files changed, 133 insertions(+), 81 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 264fde225bb9..5d1b8b335000 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -2,16 +2,16 @@ name: Run Horovod tests on: push: paths: - - "ignite/**" - - "tests/ignite/**" - - "tests/run_cpu_tests.sh" - - ".github/workflows/hvd-tests.yml" + - 'ignite/**' + - 'tests/ignite/**' + - 'tests/run_cpu_tests.sh' + - '.github/workflows/hvd-tests.yml' pull_request: paths: - - "ignite/**" - - "tests/ignite/**" - - "tests/run_cpu_tests.sh" - - ".github/workflows/hvd-tests.yml" + - 'ignite/**' + - 'tests/ignite/**' + - 'tests/run_cpu_tests.sh' + - '.github/workflows/hvd-tests.yml' jobs: horovod-tests: @@ -20,47 +20,54 @@ jobs: matrix: python-version: [3.7] pytorch-channel: [pytorch] + steps: - - uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + - uses: actions/checkout@v2 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - - uses: actions/cache@v2 - with: - path: ~/conda_pkgs_dir - key: py${{ matrix.python-version }}-conda-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - py${{ matrix.python-version }}-conda- + - name: Get year & week number + id: get-date + run: | + echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: py${{ matrix.python-version }}-pip-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - py${{ matrix.python-version }}-pip- + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" - - name: Install dependencies - shell: bash -l {0} - run: | - #install other dependencies - conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} - pip install -r requirements-dev.txt - pip install horovod - python setup.py install + - uses: actions/cache@v2 + with: + path: | + ~/conda_pkgs_dir + ${{ steps.pip-cache.outputs.dir }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + restore-keys: | + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} - - name: Run Tests - shell: bash -l {0} - run: | - SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} CI_PYTHON_VERSION="${{ matrix.python-version }}" bash tests/run_cpu_tests.sh - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml - flags: hvd-cpu - fail_ci_if_error: true + - name: Install dependencies + shell: bash -l {0} + run: | + #install other dependencies + conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} + pip install -r requirements-dev.txt + pip install horovod + python setup.py install + + - name: Run Tests + shell: bash -l {0} + run: | + SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} CI_PYTHON_VERSION="${{ matrix.python-version }}" bash tests/run_cpu_tests.sh + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + flags: hvd-cpu + fail_ci_if_error: true diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 72e1051bb233..9b8cbe43a0d0 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -2,7 +2,7 @@ on: # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule schedule: # Run at 00:00 UTC Every Day - - cron: "0 0 * * *" + - cron: '0 0 * * *' jobs: build: @@ -20,37 +20,42 @@ jobs: python-version: 3.5 steps: - - uses: actions/checkout@v2 - - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - - - uses: actions/cache@v2 - with: - path: ~/conda_pkgs_dir - key: py${{ matrix.python-version }}-conda-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - py${{ matrix.python-version }}-conda- - - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: py${{ matrix.python-version }}-pip-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - py${{ matrix.python-version }}-pip- - - - name: Install dependencies - shell: bash -l {0} - run: | - conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch - pip install -r requirements-dev.txt - python setup.py install - - - name: Run Tests - shell: bash -l {0} - run: | - pytest tests -vvv + - uses: actions/checkout@v2 + + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + + - name: Get year & week number + id: get-date + run: | + echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - uses: actions/cache@v2 + with: + path: | + ~/conda_pkgs_dir + ${{ steps.pip-cache.outputs.dir }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }} + restore-keys: | + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }} + + - name: Install dependencies + shell: bash -l {0} + run: | + conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch + pip install -r requirements-dev.txt + python setup.py install + + - name: Run Tests + shell: bash -l {0} + run: | + pytest tests -vvv diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 2188eddcb64e..9d8c100cb29e 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -29,6 +29,26 @@ jobs: python-version: '3.6.10' architecture: 'x64' + - name: Get year & week number + id: get-date + run: | + echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - uses: actions/cache@v2 + with: + path: | + ~/conda_pkgs_dir + ${{ steps.pip-cache.outputs.dir }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }} + restore-keys: | + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }} + - name: Install Torch XLA and others run: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ed8812a0d83b..d5290de49616 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -49,6 +49,26 @@ jobs: miniconda-version: "latest" python-version: ${{ matrix.python-version }} + - name: Get year & week number + id: get-date + run: | + echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - uses: actions/cache@v2 + with: + path: | + ~/conda_pkgs_dir + ${{ steps.pip-cache.outputs.dir }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + restore-keys: | + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + - name: Install dependencies shell: bash -l {0} run: | From 74c7eb29e758e67ad9bc8078f1714c2edfcdc7f8 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Wed, 11 Nov 2020 20:12:40 +0630 Subject: [PATCH 04/23] install pip --- .github/workflows/hvd-tests.yml | 1 + .github/workflows/pytorch-version-tests.yml | 2 ++ .github/workflows/unit-tests.yml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 5d1b8b335000..8d01d8cfdc16 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -40,6 +40,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | + conda install pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 9b8cbe43a0d0..64b003c5c460 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -27,6 +27,7 @@ jobs: with: miniconda-version: "latest" python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Get year & week number id: get-date @@ -37,6 +38,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | + conda install pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d5290de49616..36a0f50cd1b4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -48,6 +48,7 @@ jobs: with: miniconda-version: "latest" python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Get year & week number id: get-date @@ -58,6 +59,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | + conda install pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 From 5d90a8927d71d39ae3feb5a750d6f9a6e4851a71 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Wed, 11 Nov 2020 20:39:12 +0630 Subject: [PATCH 05/23] upgrade pip --- .github/workflows/hvd-tests.yml | 2 +- .github/workflows/pytorch-version-tests.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 8d01d8cfdc16..344669659fe8 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -40,7 +40,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - conda install pip + pip install -U pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 64b003c5c460..4ad8fba53e06 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -38,7 +38,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - conda install pip + pip install -U pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 36a0f50cd1b4..94bc2b3b17c1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -59,7 +59,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - conda install pip + pip install -U pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 From 6c087619653c91a633c90ed413e2ba3ebf70469a Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Wed, 11 Nov 2020 21:20:58 +0630 Subject: [PATCH 06/23] pip3 and bash --- .github/workflows/hvd-tests.yml | 5 +++-- .github/workflows/pytorch-version-tests.yml | 5 +++-- .github/workflows/tpu-tests.yml | 3 ++- .github/workflows/unit-tests.yml | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 344669659fe8..bd755490d08a 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -35,12 +35,13 @@ jobs: id: get-date run: | echo "::set-output name=date::$(/bin/date "+%Y-%U")" - shell: bash + shell: bash -l {0} - name: Get pip cache dir + shell: bash -l {0} id: pip-cache run: | - pip install -U pip + pip3 install -U pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 4ad8fba53e06..2c5a50126d86 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -33,12 +33,13 @@ jobs: id: get-date run: | echo "::set-output name=date::$(/bin/date "+%Y-%U")" - shell: bash + shell: bash -l {0} - name: Get pip cache dir + shell: bash -l {0} id: pip-cache run: | - pip install -U pip + pip3 install -U pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 9d8c100cb29e..0f2f5af7f0bc 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -33,9 +33,10 @@ jobs: id: get-date run: | echo "::set-output name=date::$(/bin/date "+%Y-%U")" - shell: bash + shell: bash -l {0} - name: Get pip cache dir + shell: bash -l {0} id: pip-cache run: | echo "::set-output name=dir::$(pip cache dir)" diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 94bc2b3b17c1..2f26df435f4a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -54,12 +54,13 @@ jobs: id: get-date run: | echo "::set-output name=date::$(/bin/date "+%Y-%U")" - shell: bash + shell: bash -l {0} - name: Get pip cache dir + shell: bash -l {0} id: pip-cache run: | - pip install -U pip + pip3 install -U pip echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 From 70121a1e5828effe77d5d232f10ec4cbc72cfedd Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Wed, 11 Nov 2020 21:34:17 +0630 Subject: [PATCH 07/23] add name --- .github/workflows/pytorch-version-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 2c5a50126d86..402c9099407f 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -1,3 +1,5 @@ +name: PyTorch version tests + on: # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule schedule: From 056e1124d201f06afdcd40c40e0514bbae982c7f Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 16:34:16 +0630 Subject: [PATCH 08/23] skip if cache hit --- .github/workflows/hvd-tests.yml | 6 ++++-- .github/workflows/pytorch-version-tests.yml | 6 ++++-- .github/workflows/tpu-tests.yml | 15 +++++++++++---- .github/workflows/unit-tests.yml | 6 ++++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index bd755490d08a..6675f35aa480 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -45,15 +45,17 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 + id: cache with: path: | ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('**/requirements.txt') }} - name: Install dependencies + if: steps.cache.outputs.cache-hit == 'false' shell: bash -l {0} run: | #install other dependencies diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 402c9099407f..2dc74629b67c 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -45,15 +45,17 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 + id: cache with: path: | ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }} + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies + if: steps.cache.outputs.cache-hit == 'false' shell: bash -l {0} run: | conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 0f2f5af7f0bc..ad1734ad70f6 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -42,15 +42,16 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 + id: cache with: path: | ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }} + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} - - name: Install Torch XLA and others + - name: Install others deps run: | ## Install gsutil @@ -59,8 +60,14 @@ jobs: curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - sudo apt-get update && sudo apt-get install -y google-cloud-sdk - ## Install openblas and mkl + ## Install openblas sudo apt-get install -y libopenblas-dev libomp5 + + - name: Install Torch XLA + if: steps.cache.outputs.cache-hit == 'false' + run: | + + # install mkl pip install mkl ## Download torch & xla diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2f26df435f4a..7cbc9db5e535 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -64,15 +64,17 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - uses: actions/cache@v2 + id: cache with: path: | ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }} + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies + if: steps.cache.outputs.cache-hit == 'false' shell: bash -l {0} run: | conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} From 44af75ac9bab13ebaede5d4701ee1e3e7585f7cd Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 16:37:36 +0630 Subject: [PATCH 09/23] skip if cache hit --- .github/workflows/hvd-tests.yml | 2 +- .github/workflows/pytorch-version-tests.yml | 2 +- .github/workflows/tpu-tests.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 6675f35aa480..19493df710cb 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -55,7 +55,7 @@ jobs: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('**/requirements.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit == 'false' + if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | #install other dependencies diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 2dc74629b67c..28e9e9e142b1 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -55,7 +55,7 @@ jobs: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit == 'false' + if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index ad1734ad70f6..5c5e7e5b9892 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -64,7 +64,7 @@ jobs: sudo apt-get install -y libopenblas-dev libomp5 - name: Install Torch XLA - if: steps.cache.outputs.cache-hit == 'false' + if: steps.cache.outputs.cache-hit != 'true' run: | # install mkl diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7cbc9db5e535..6decd94ce0fa 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -74,7 +74,7 @@ jobs: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit == 'false' + if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} From a5c6538a256b8eedc0d1e4b68c940b036ae65021 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 18:02:25 +0630 Subject: [PATCH 10/23] proper cache path --- .github/workflows/hvd-tests.yml | 3 +-- .github/workflows/pytorch-version-tests.yml | 3 +-- .github/workflows/tpu-tests.yml | 10 +--------- .github/workflows/unit-tests.yml | 11 +++++++++-- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 19493df710cb..938777926685 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -41,8 +41,7 @@ jobs: shell: bash -l {0} id: pip-cache run: | - pip3 install -U pip - echo "::set-output name=dir::$(pip cache dir)" + echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" - uses: actions/cache@v2 id: cache diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 28e9e9e142b1..7d8ab673bec5 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -41,8 +41,7 @@ jobs: shell: bash -l {0} id: pip-cache run: | - pip3 install -U pip - echo "::set-output name=dir::$(pip cache dir)" + echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" - uses: actions/cache@v2 id: cache diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 5c5e7e5b9892..b9fc2645d7ed 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -35,18 +35,10 @@ jobs: echo "::set-output name=date::$(/bin/date "+%Y-%U")" shell: bash -l {0} - - name: Get pip cache dir - shell: bash -l {0} - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - uses: actions/cache@v2 id: cache with: - path: | - ~/conda_pkgs_dir - ${{ steps.pip-cache.outputs.dir }} + path: ${{ env.pythonLocation }}/lib/python3.6/site-packages/* key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 6decd94ce0fa..b3747e05561e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -57,11 +57,18 @@ jobs: shell: bash -l {0} - name: Get pip cache dir + if: matrix.os != 'windows-latest' shell: bash -l {0} id: pip-cache run: | - pip3 install -U pip - echo "::set-output name=dir::$(pip cache dir)" + echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" + + - name: Get pip cache dir (windows) + if: matrix.os == 'windows-latest' + shell: bash -l {0} + id: pip-cache + run: | + echo "::set-output name=dir::$CONDA\envs\test\lib\site-packages\*" - uses: actions/cache@v2 id: cache From ea310de670cd2e6759fa34d457923bddddeb3e76 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 18:06:07 +0630 Subject: [PATCH 11/23] proper cache path --- .github/workflows/unit-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b3747e05561e..82de1d7c3962 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -59,14 +59,14 @@ jobs: - name: Get pip cache dir if: matrix.os != 'windows-latest' shell: bash -l {0} - id: pip-cache + id: pip-cache-${{ runner.os }} run: | echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" - name: Get pip cache dir (windows) if: matrix.os == 'windows-latest' shell: bash -l {0} - id: pip-cache + id: pip-cache-${{ runner.os }} run: | echo "::set-output name=dir::$CONDA\envs\test\lib\site-packages\*" @@ -75,7 +75,7 @@ jobs: with: path: | ~/conda_pkgs_dir - ${{ steps.pip-cache.outputs.dir }} + ${{ steps.pip-cache-${{ runner.os }}.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} From bb37442d4345f8f5d5e6d485d9dc354d32069334 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 18:58:16 +0630 Subject: [PATCH 12/23] proper cache path --- .github/workflows/hvd-tests.yml | 8 +----- .github/workflows/pytorch-version-tests.yml | 8 +----- .github/workflows/unit-tests.yml | 29 ++++++++++----------- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 938777926685..f6667ffe0673 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -37,18 +37,12 @@ jobs: echo "::set-output name=date::$(/bin/date "+%Y-%U")" shell: bash -l {0} - - name: Get pip cache dir - shell: bash -l {0} - id: pip-cache - run: | - echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" - - uses: actions/cache@v2 id: cache with: path: | ~/conda_pkgs_dir - ${{ steps.pip-cache.outputs.dir }} + $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('**/requirements.txt') }} diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 7d8ab673bec5..8b03b5f7523e 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -37,18 +37,12 @@ jobs: echo "::set-output name=date::$(/bin/date "+%Y-%U")" shell: bash -l {0} - - name: Get pip cache dir - shell: bash -l {0} - id: pip-cache - run: | - echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" - - uses: actions/cache@v2 id: cache with: path: | ~/conda_pkgs_dir - ${{ steps.pip-cache.outputs.dir }} + $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 82de1d7c3962..7eebf8ee4087 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -56,32 +56,31 @@ jobs: echo "::set-output name=date::$(/bin/date "+%Y-%U")" shell: bash -l {0} - - name: Get pip cache dir + - uses: actions/cache@v2 if: matrix.os != 'windows-latest' - shell: bash -l {0} - id: pip-cache-${{ runner.os }} - run: | - echo "::set-output name=dir::$CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/*" + id: cache + with: + path: | + ~/conda_pkgs_dir + $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - - name: Get pip cache dir (windows) + - name: windows cache + uses: actions/cache@v2 if: matrix.os == 'windows-latest' - shell: bash -l {0} - id: pip-cache-${{ runner.os }} - run: | - echo "::set-output name=dir::$CONDA\envs\test\lib\site-packages\*" - - - uses: actions/cache@v2 - id: cache + id: cache-windows with: path: | ~/conda_pkgs_dir - ${{ steps.pip-cache-${{ runner.os }}.outputs.dir }} + $CONDA\envs\test\lib\site-packages\* key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' + if: steps.cache.outputs.cache-hit != 'true' || steps.cache-windows.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} From c80402d51d3de43ec3d87e2b64fa97d1e60c02ca Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 19:29:42 +0630 Subject: [PATCH 13/23] pip cache, sys cache --- .github/workflows/hvd-tests.yml | 10 ++++++++-- .github/workflows/pytorch-version-tests.yml | 9 +++++++-- .github/workflows/tpu-tests.yml | 12 +++++++++--- .github/workflows/unit-tests.yml | 9 +++++++++ 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index f6667ffe0673..91dc6c453f84 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -33,16 +33,22 @@ jobs: - name: Get year & week number id: get-date - run: | - echo "::set-output name=date::$(/bin/date "+%Y-%U")" + run: echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash -l {0} + + - name: Get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 + shell: bash -l {0} id: cache with: path: | ~/conda_pkgs_dir $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('**/requirements.txt') }} diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 8b03b5f7523e..28b25791efd9 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -33,11 +33,16 @@ jobs: - name: Get year & week number id: get-date - run: | - echo "::set-output name=date::$(/bin/date "+%Y-%U")" + run: echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash -l {0} + + - name: Get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 + shell: bash -l {0} id: cache with: path: | diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index b9fc2645d7ed..490f8750b5f1 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -31,14 +31,20 @@ jobs: - name: Get year & week number id: get-date - run: | - echo "::set-output name=date::$(/bin/date "+%Y-%U")" + run: echo "::set-output name=date::$(/bin/date "+%Y-%U")" + shell: bash -l {0} + + - name: Get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 id: cache with: - path: ${{ env.pythonLocation }}/lib/python3.6/site-packages/* + path: | + ${{ env.pythonLocation }}/lib/python3.6/site-packages/* + ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7eebf8ee4087..1e74e0ddf6a9 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -56,25 +56,34 @@ jobs: echo "::set-output name=date::$(/bin/date "+%Y-%U")" shell: bash -l {0} + - name: Get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" + shell: bash -l {0} + - uses: actions/cache@v2 + shell: bash -l {0} if: matrix.os != 'windows-latest' id: cache with: path: | ~/conda_pkgs_dir $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - name: windows cache uses: actions/cache@v2 + shell: bash -l {0} if: matrix.os == 'windows-latest' id: cache-windows with: path: | ~/conda_pkgs_dir $CONDA\envs\test\lib\site-packages\* + ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} From 828e85b8f9ca6093db0d82f7e911935989c96314 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 19:32:42 +0630 Subject: [PATCH 14/23] env.CONDA --- .github/workflows/hvd-tests.yml | 3 +-- .github/workflows/unit-tests.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 91dc6c453f84..8ae3bf0f57f2 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -42,12 +42,11 @@ jobs: shell: bash -l {0} - uses: actions/cache@v2 - shell: bash -l {0} id: cache with: path: | ~/conda_pkgs_dir - $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1e74e0ddf6a9..b9da5e4d5e7d 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -62,13 +62,12 @@ jobs: shell: bash -l {0} - uses: actions/cache@v2 - shell: bash -l {0} if: matrix.os != 'windows-latest' id: cache with: path: | ~/conda_pkgs_dir - $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | From 71e091a387b7bf4fd01cabb7ad8bb1eb67e8b378 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 19:33:53 +0630 Subject: [PATCH 15/23] env.CONDA --- .github/workflows/unit-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b9da5e4d5e7d..acb5f96aa1ad 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -75,13 +75,12 @@ jobs: - name: windows cache uses: actions/cache@v2 - shell: bash -l {0} if: matrix.os == 'windows-latest' id: cache-windows with: path: | ~/conda_pkgs_dir - $CONDA\envs\test\lib\site-packages\* + ${{ env.CONDA }}\envs\test\lib\site-packages\* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | From 1410b5c04269ea225c93a12b282b49e2354929ff Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 20:18:41 +0630 Subject: [PATCH 16/23] rm whitespace --- .github/workflows/hvd-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 8ae3bf0f57f2..205aef8981be 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -55,7 +55,8 @@ jobs: - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} - run: | + run: | + #install other dependencies conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} pip install -r requirements-dev.txt From 56b8b492bdb30ff60115b90d9a7868168a37fa14 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 20:26:28 +0630 Subject: [PATCH 17/23] env.CONDA_PKGS_DIR, no if --- .github/workflows/hvd-tests.yml | 4 ++-- .github/workflows/pytorch-version-tests.yml | 4 ++-- .github/workflows/tpu-tests.yml | 2 +- .github/workflows/unit-tests.yml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 205aef8981be..9c5bf6088b85 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -45,7 +45,7 @@ jobs: id: cache with: path: | - ~/conda_pkgs_dir + ${{ env.CONDA_PKGS_DIR }} ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} @@ -53,7 +53,7 @@ jobs: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('**/requirements.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' + # if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 28b25791efd9..e39c37936dfd 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -46,14 +46,14 @@ jobs: id: cache with: path: | - ~/conda_pkgs_dir + ${{ env.CONDA_PKGS_DIR }} $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' + # if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 490f8750b5f1..6375d370b91a 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -62,7 +62,7 @@ jobs: sudo apt-get install -y libopenblas-dev libomp5 - name: Install Torch XLA - if: steps.cache.outputs.cache-hit != 'true' + # if: steps.cache.outputs.cache-hit != 'true' run: | # install mkl diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index acb5f96aa1ad..2f642a0da3c2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -66,7 +66,7 @@ jobs: id: cache with: path: | - ~/conda_pkgs_dir + ${{ env.CONDA_PKGS_DIR }} ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} @@ -79,7 +79,7 @@ jobs: id: cache-windows with: path: | - ~/conda_pkgs_dir + ${{ env.CONDA_PKGS_DIR }} ${{ env.CONDA }}\envs\test\lib\site-packages\* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} @@ -87,7 +87,7 @@ jobs: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' || steps.cache-windows.outputs.cache-hit != 'true' + # if: steps.cache.outputs.cache-hit != 'true' || steps.cache-windows.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} From 4705a1ba62f9dd25d5ba39393dcd38928c74e96a Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 12 Nov 2020 21:27:23 +0630 Subject: [PATCH 18/23] diff cache key --- .github/workflows/hvd-tests.yml | 4 ++-- .github/workflows/pytorch-version-tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 9c5bf6088b85..44235ea2fce8 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -48,9 +48,9 @@ jobs: ${{ env.CONDA_PKGS_DIR }} ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} + key: ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('**/requirements.txt') }} + ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('**/requirements.txt') }} - name: Install dependencies # if: steps.cache.outputs.cache-hit != 'true' diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index e39c37936dfd..0ce5f7b1db2d 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -48,9 +48,9 @@ jobs: path: | ${{ env.CONDA_PKGS_DIR }} $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} + key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} + ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} - name: Install dependencies # if: steps.cache.outputs.cache-hit != 'true' From 847659ff1be590b98f815f59fd04143ad745d994 Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Tue, 24 Nov 2020 22:53:21 +0630 Subject: [PATCH 19/23] miniconda after cache --- .github/workflows/hvd-tests.yml | 22 +++++++------- .github/workflows/pytorch-version-tests.yml | 24 ++++++++-------- .github/workflows/tpu-tests.yml | 16 ++++------- .github/workflows/unit-tests.yml | 32 ++++++--------------- 4 files changed, 37 insertions(+), 57 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 44235ea2fce8..c443e15edc0f 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -24,12 +24,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Get year & week number id: get-date @@ -38,22 +32,28 @@ jobs: - name: Get pip cache dir id: pip-cache - run: echo "::set-output name=dir::$(pip cache dir)" + run: | + pip3 install -U pip + echo "::set-output name=dir::$(python3 -m pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 - id: cache with: path: | - ${{ env.CONDA_PKGS_DIR }} - ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('**/requirements.txt') }} + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + - name: Install dependencies - # if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index 0ce5f7b1db2d..e0579f3981b0 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -24,13 +24,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - - name: Get year & week number id: get-date run: echo "::set-output name=date::$(/bin/date "+%Y-%U")" @@ -38,22 +31,29 @@ jobs: - name: Get pip cache dir id: pip-cache - run: echo "::set-output name=dir::$(pip cache dir)" + run: | + pip3 install -U pip + echo "::set-output name=dir::$(python3 -m pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 shell: bash -l {0} - id: cache with: path: | - ${{ env.CONDA_PKGS_DIR }} - $CONDA/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ~/conda_pkgs_dir + ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + - name: Install dependencies - # if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 6375d370b91a..5515b6eb3680 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -36,20 +36,20 @@ jobs: - name: Get pip cache dir id: pip-cache - run: echo "::set-output name=dir::$(pip cache dir)" + run: | + pip3 install -U pip + echo "::set-output name=dir::$(pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 - id: cache with: path: | - ${{ env.pythonLocation }}/lib/python3.6/site-packages/* ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} - - name: Install others deps + - name: Install Torch XLA and others run: | ## Install gsutil @@ -58,14 +58,8 @@ jobs: curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - sudo apt-get update && sudo apt-get install -y google-cloud-sdk - ## Install openblas + ## Install openblas and mkl sudo apt-get install -y libopenblas-dev libomp5 - - - name: Install Torch XLA - # if: steps.cache.outputs.cache-hit != 'true' - run: | - - # install mkl pip install mkl ## Download torch & xla diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2f642a0da3c2..ba59f19a229c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -43,12 +43,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Get year & week number id: get-date @@ -58,36 +52,28 @@ jobs: - name: Get pip cache dir id: pip-cache - run: echo "::set-output name=dir::$(pip cache dir)" + run: | + pip3 install -U pip + echo "::set-output name=dir::$(python3 -m pip cache dir)" shell: bash -l {0} - uses: actions/cache@v2 - if: matrix.os != 'windows-latest' - id: cache with: path: | - ${{ env.CONDA_PKGS_DIR }} - ${{ env.CONDA }}/envs/test/lib/python${{ matrix.python-version }}/site-packages/* + ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - - name: windows cache - uses: actions/cache@v2 - if: matrix.os == 'windows-latest' - id: cache-windows + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 with: - path: | - ${{ env.CONDA_PKGS_DIR }} - ${{ env.CONDA }}\envs\test\lib\site-packages\* - ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Install dependencies - # if: steps.cache.outputs.cache-hit != 'true' || steps.cache-windows.outputs.cache-hit != 'true' shell: bash -l {0} run: | conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} From 28300671d4d7cf8be97a8948f6fa9869b7ab61bc Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Tue, 24 Nov 2020 23:20:48 +0630 Subject: [PATCH 20/23] fix keys and whitespace --- .github/workflows/hvd-tests.yml | 2 +- .github/workflows/tpu-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index c443e15edc0f..d9b6b0a12d14 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -44,7 +44,7 @@ jobs: ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('**/requirements.txt') }} + ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }} - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 5515b6eb3680..280c5b63130f 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -58,7 +58,7 @@ jobs: curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - sudo apt-get update && sudo apt-get install -y google-cloud-sdk - ## Install openblas and mkl + ## Install openblas and mkl sudo apt-get install -y libopenblas-dev libomp5 pip install mkl From 65549dcc7ebcdc43fdcdc664047c112c0a0d509e Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 3 Dec 2020 16:44:24 +0630 Subject: [PATCH 21/23] apply suggestions --- .github/workflows/hvd-tests.yml | 2 -- .github/workflows/pytorch-version-tests.yml | 2 +- .github/workflows/tpu-tests.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index d9b6b0a12d14..20b5850bb85b 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -43,8 +43,6 @@ jobs: ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }} - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index e0579f3981b0..c04661964297 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -44,7 +44,7 @@ jobs: ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} + ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}- - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 280c5b63130f..65a8436777cd 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -47,7 +47,7 @@ jobs: ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} + ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.xla-version }}- - name: Install Torch XLA and others run: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ba59f19a229c..da9df5e2dc59 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -64,7 +64,7 @@ jobs: ${{ steps.pip-cache.outputs.dir }} key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | - ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} + ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}- - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 From 30dfbb749e820a658777afb26f721169d7ce5a5e Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 3 Dec 2020 21:29:37 +0630 Subject: [PATCH 22/23] use pip3 --- .github/workflows/hvd-tests.yml | 4 ++-- .github/workflows/pytorch-version-tests.yml | 4 ++-- .github/workflows/unit-tests.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hvd-tests.yml b/.github/workflows/hvd-tests.yml index 58124ea45e80..7aab5ae959ea 100644 --- a/.github/workflows/hvd-tests.yml +++ b/.github/workflows/hvd-tests.yml @@ -32,8 +32,8 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - pip3 install -U pip - echo "::set-output name=dir::$(python3 -m pip cache dir)" + pip3 install -U --user pip + echo "::set-output name=dir::$(pip3 cache dir)" shell: bash -l {0} - uses: actions/cache@v2 diff --git a/.github/workflows/pytorch-version-tests.yml b/.github/workflows/pytorch-version-tests.yml index e6b61c8f99c0..9d0abff331fa 100644 --- a/.github/workflows/pytorch-version-tests.yml +++ b/.github/workflows/pytorch-version-tests.yml @@ -32,8 +32,8 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - pip3 install -U pip - echo "::set-output name=dir::$(python3 -m pip cache dir)" + pip3 install -U --user pip + echo "::set-output name=dir::$(pip3 cache dir)" shell: bash -l {0} - uses: actions/cache@v2 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a5463db5266b..8f0149d14a02 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -53,8 +53,8 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - pip3 install -U pip - echo "::set-output name=dir::$(python3 -m pip cache dir)" + pip3 install -U --user pip + echo "::set-output name=dir::$(pip3 cache dir)" shell: bash -l {0} - uses: actions/cache@v2 From 41fb9ec2381c5fa7b628677ac27b3f16c902e46d Mon Sep 17 00:00:00 2001 From: ydcjeff Date: Thu, 3 Dec 2020 21:37:28 +0630 Subject: [PATCH 23/23] cache key --- .github/workflows/tpu-tests.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index d05e2997b91a..9bd9df3bf71f 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -45,7 +45,7 @@ jobs: with: path: | ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} + key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.xla-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.xla-version }}- diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 8f0149d14a02..ffa915a2621a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -62,7 +62,7 @@ jobs: path: | ~/conda_pkgs_dir ${{ steps.pip-cache.outputs.dir }} - key: ${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} + key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }} restore-keys: | ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-