Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

[CI] Enable Conda cache #453

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[CI] Enable Conda cache #453

wants to merge 1 commit into from

Conversation

Devjiu
Copy link
Contributor

@Devjiu Devjiu commented May 3, 2023

This commit enables caching check and unifies cache keys.

Signed-off-by: Dmitrii Makarenko dmitrii.makarenko@intel.com

@Devjiu
Copy link
Contributor Author

Devjiu commented May 3, 2023

Reduces time for conda builds for 5 mins.

@Devjiu
Copy link
Contributor Author

Devjiu commented May 3, 2023

Created several caches.
Based on:

  1. hash + job date
  2. runner os: Linux/Windows
  3. input.param - cpu/cuda/l0/all-gpus

So currently it will use 5 caches:

  1. Windows-cpu
  2. Linux cpu
  3. Linux cuda
  4. Linux l0
  5. Linux all-gpus

Amount if needed can be reduced with sharing base env and installation on steps. Size of each ~920 Mb (Windows 1.6Gb)

@alexbaden
Copy link
Contributor

Do we need that many caches? Is it advantageous to cache the L0 deps in their own conda cache vs the speedup we would get by using the general conda cache then install L0 deps? Also, what is the GitHub policy on storage for these caches?

@Devjiu
Copy link
Contributor Author

Devjiu commented May 4, 2023

Do we need that many caches? Is it advantageous to cache the L0 deps in their own conda cache vs the speedup we would get by using the general conda cache then install L0 deps? Also, what is the GitHub policy on storage for these caches?

Before this pr we used even more conda caches. (about 6 - number of caches = number of keys. I mean we created them but not used)

Github cache is limited with 10Gb, So we simply need to fit in it. In common current caches can be found at https://github.com/intel-ai/hdk/actions/caches .
Currently we are caching m2 (~ 900 Mb not works for docker build, will fix later), docker image (~ 5.3Gb) and conda envs.

Main profit of using so many caches is speed up all jobs.

@Devjiu
Copy link
Contributor Author

Devjiu commented May 4, 2023

AFAIU 920 Mb * 4 + 1.6 Gb + 5.6 Gb + 1 Gb ~ 11.8 Gb > 10 Gb

So yes, maybe we should have 2 base conda caches: windows and linux.

@leshikus WDYT?

@Devjiu
Copy link
Contributor Author

Devjiu commented May 4, 2023

During current run - Approaching total cache storage limit (11.62 GB of 10 GB Used)
image

Copy link
Contributor

@leshikus leshikus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No critical problems, see two minor comments

@@ -80,6 +80,15 @@ jobs:
sudo dpkg -i intel-igc-core_1.0.12812.24_amd64.deb intel-level-zero-gpu_1.3.25018.24_amd64.deb libigdgmm12_22.3.0_amd64.deb intel-igc-opencl_1.0.12812.24_amd64.deb
conda install -n omnisci-dev -c conda-forge level-zero-devel pkg-config

- name: Save Conda env cache
if: steps.conda-cache.outputs.cache-hit != 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to name ids for the same steps the same way imho; use either conda-cache or restore-conda-cache, not both in different places

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -16,7 +16,7 @@ jobs:
- name: Set env context
run: |
echo CONDA_PATH=$CONDA >>$GITHUB_ENV
echo RUN_STAMP=${{ runner.os }}-${{ (env.cuda_compiler_version != 'None') && format('cuda{0}', env.cuda_compiler_version) || 'cpu' }} >>$GITHUB_ENV
echo RUN_STAMP=${{ runner.os }}-cpu >>$GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both pytest.yml and modin.yml should be made a part of test.yml, thus the whole "Set env context" section will be reusable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change it later in further prs

@@ -44,7 +44,7 @@ jobs:

- name: Restore Conda env cache
id: conda-cache
uses: actions/cache@v3
uses: actions/cache/restore@v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, better to have the same action name in all places; if you add "restore" here, add everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This commit enables caching check and unifies cache keys.

Signed-off-by: Dmitrii Makarenko <dmitrii.makarenko@intel.com>
Copy link
Contributor

@kurapov-peter kurapov-peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants