diff --git a/.github/workflows/mandatory_and_optional_test_reminder.yml b/.github/workflows/mandatory_and_optional_test_reminder.yml index fb32495c45..8aef074c8c 100644 --- a/.github/workflows/mandatory_and_optional_test_reminder.yml +++ b/.github/workflows/mandatory_and_optional_test_reminder.yml @@ -16,11 +16,15 @@ jobs: Please make sure you run these tests via comment before you merge! - * `cscs-ci run` + * `cscs-ci run default` * `launch jenkins spack` **Optional Tests** + To run benchmarks you can use: + + * `cscs-ci run benchmark` + In case your change might affect downstream [icon-exclaim](https://github.com/C2SM/icon-exclaim), please consider running * `launch jenkins icon` diff --git a/ci/base.yml b/ci/base.yml new file mode 100644 index 0000000000..2258c59141 --- /dev/null +++ b/ci/base.yml @@ -0,0 +1,45 @@ +include: + - remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml' + +stages: + - build + - test + - benchmark + +.py310: &py310 + PYVERSION_PREFIX: py310 + PYVERSION: 3.10.9 + +variables: + PYTHON_VERSION: "3.10" + PERSIST_IMAGE_NAME: $CSCS_REGISTRY_PATH/icon4py:$CI_COMMIT_SHORT_SHA + +.build_template: + stage: build + extends: .container-builder + variables: + DOCKERFILE: ci/docker/Dockerfile.build + DOCKER_BUILD_ARGS: '["PYVERSION=$PYVERSION"]' + <<: *py310 + +.test_template: + extends: .container-runner-daint-gpu + timeout: 8h + image: $PERSIST_IMAGE_NAME + before_script: + - apt-get update + - python3 -m pip install --upgrade pip setuptools wheel + - cd /icon4py + - pyversion_no_dot="${PYTHON_VERSION//./}" + - pip install tox clang-format + - python -c "import cupy" + - ls ${TEST_DATA_PATH} + variables: + SLURM_JOB_NUM_NODES: 1 + SLURM_NTASKS: 1 + SLURM_TIMELIMIT: '06:00:00' + CRAY_CUDA_MPS: 1 + NUM_PROCESSES: auto + VIRTUALENV_SYSTEM_SITE_PACKAGES: 1 + CSCS_NEEDED_DATA: icon4py + TEST_DATA_PATH: "/apps/daint/UES/jenkssl/ciext/icon4py" diff --git a/ci/benchmark.yml b/ci/benchmark.yml new file mode 100644 index 0000000000..32aecff49c --- /dev/null +++ b/ci/benchmark.yml @@ -0,0 +1,18 @@ +include: + - local: 'ci/base.yml' + +variables: + DACE_VERSION: "0.14.4" + +build: + extends: .build_template + +benchmark_model_icon_grid: + extends: .test_template + stage: benchmark + script: + - if [ "$BACKEND" = "dace_cpu" ] || [ "$BACKEND" = "dace_gpu" ]; then pip install dace==$DACE_VERSION; fi + - tox -r -e run_benchmarks -c model/ -- --backend=$BACKEND --grid=icon_grid --disable-warnings + parallel: + matrix: + - BACKEND: [dace_cpu, gtfn_cpu, gtfn_gpu] diff --git a/ci/default.yml b/ci/default.yml index 9a71720925..197d2913ac 100644 --- a/ci/default.yml +++ b/ci/default.yml @@ -1,125 +1,20 @@ include: - - remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml' + - local: 'ci/base.yml' -stages: - - build - - test - - benchmark - -.py310: &py310 - PYVERSION_PREFIX: py310 - PYVERSION: 3.10.9 - -variables: - DACE_VERSION: "0.15.1" - PERSIST_IMAGE_NAME: $CSCS_REGISTRY_PATH/icon4py:$CI_COMMIT_SHORT_SHA - PYTHON_VERSION: "3.10" - -.build_template: - stage: build - extends: .container-builder - variables: - DOCKERFILE: ci/docker/Dockerfile.build - DOCKER_BUILD_ARGS: '["PYVERSION=$PYVERSION"]' - <<: *py310 - -.test_template: - extends: .container-runner-daint-gpu - timeout: 8h - image: $PERSIST_IMAGE_NAME - before_script: - - apt-get update - - python3 -m pip install --upgrade pip setuptools wheel - - cd /icon4py - - pyversion_no_dot="${PYTHON_VERSION//./}" - - pip install tox clang-format - - python -c "import cupy" - - ls ${SERIALIZED_DATA_PATH} - variables: - SLURM_JOB_NUM_NODES: 1 - SLURM_NTASKS: 1 - SLURM_TIMELIMIT: '06:00:00' - CRAY_CUDA_MPS: 1 - NUM_PROCESSES: auto - VIRTUALENV_SYSTEM_SITE_PACKAGES: 1 - CSCS_NEEDED_DATA: icon4py - TEST_DATA_PATH: "/apps/daint/UES/jenkssl/ciext/icon4py" - -build_job: +build: extends: .build_template -test_model_job_roundtrip_simple_grid: - extends: .test_template - stage: test - script: - - tox -r -e run_stencil_tests -c model/ --verbose - -test_model_job_dace_cpu_simple_grid: - extends: .test_template - stage: test - script: - - pip install dace==$DACE_VERSION - - tox -r -e run_stencil_tests -c model/ --verbose -- --backend=dace_cpu - only: - - main - allow_failure: true - -test_model_job_dace_gpu_simple_grid: - extends: .test_template - stage: test - script: - - pip install dace==$DACE_VERSION - - tox -r -e run_stencil_tests -c model/ --verbose -- --backend=dace_gpu - only: - - main - allow_failure: true - -test_model_job_gtfn_cpu_simple_grid: - extends: .test_template - stage: test - script: - - tox -r -e run_stencil_tests -c model/ --verbose -- --backend=gtfn_cpu - -test_model_job_gtfn_gpu_simple_grid: - extends: .test_template - stage: test - script: - - tox -r -e run_stencil_tests -c model/ --verbose -- --backend=gtfn_gpu +test_model_simple_grid: + extends: .test_template + stage: test + script: + - tox -r -e run_stencil_tests -c model/ --verbose -- --backend=$BACKEND + parallel: + matrix: + - BACKEND: [gtfn_cpu, gtfn_gpu, roundtrip] -test_tools_job: +test_tools: extends: .test_template stage: test script: - tox -r -c tools/ --verbose - -benchmark_model_dace_cpu_icon_grid: - extends: .test_template - stage: benchmark - script: - - pip install dace==$DACE_VERSION - - tox -r -e run_benchmarks -c model/ -- --backend=dace_cpu --grid=icon_grid - only: - - main - when: manual - -benchmark_model_dace_gpu_icon_grid: - extends: .test_template - stage: benchmark - script: - - pip install dace==$DACE_VERSION - - tox -r -e run_benchmarks -c model/ -- --backend=dace_gpu --grid=icon_grid - only: - - main - when: manual - -benchmark_model_gtfn_cpu_icon_grid: - extends: .test_template - stage: benchmark - script: - - tox -r -e run_benchmarks -c model/ -- --backend=gtfn_cpu --grid=icon_grid - -benchmark_model_gtfn_gpu_icon_grid: - extends: .test_template - stage: benchmark - script: - - tox -r -e run_benchmarks -c model/ -- --backend=gtfn_gpu --grid=icon_grid