|
| 1 | +# NOTE: Make sure this file is consistent with .github/workflows/{unit,gpu}_tests.yml |
| 2 | +.tests-default: |
| 3 | + stage: tests |
| 4 | + variables: |
| 5 | + PYTHON: 12 |
| 6 | + TORCH: 28 |
| 7 | + rules: |
| 8 | + - if: $JET_ONLY != null |
| 9 | + when: never |
| 10 | + - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/ |
| 11 | + - if: $CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule" |
| 12 | + |
| 13 | +##### Unit Tests ##### |
| 14 | +unit: |
| 15 | + extends: .tests-default |
| 16 | + timeout: 30m |
| 17 | + image: python:3.$PYTHON |
| 18 | + before_script: |
| 19 | + # Install cmake to build onnxsim from sdists for Python 3.12 until http://github.com/daquexian/onnx-simplifier/pull/353 |
| 20 | + - if [ "$PYTHON" = "12" ]; then apt-get update && apt-get install -y cmake; fi |
| 21 | + - pip install tox |
| 22 | + script: |
| 23 | + - tox -e py3$PYTHON-torch$TORCH-unit |
| 24 | + |
| 25 | +multi-py-unit: |
| 26 | + extends: unit |
| 27 | + parallel: |
| 28 | + matrix: |
| 29 | + - PYTHON: [10, 11] |
| 30 | + |
| 31 | +multi-torch-unit: |
| 32 | + extends: unit |
| 33 | + parallel: |
| 34 | + matrix: |
| 35 | + - TORCH: [26, 27] |
| 36 | + |
| 37 | +##### GPU Tests ##### |
| 38 | +gpu: |
| 39 | + extends: .tests-default |
| 40 | + timeout: 60m |
| 41 | + image: nvcr.io/nvidia/pytorch:25.06-py3 |
| 42 | + variables: |
| 43 | + GIT_DEPTH: 1000 # For correct version for tests/gpu/torch/quantization/plugins/test_megatron.py |
| 44 | + LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}" # Add libcudnn*.so and libnv*.so to path. |
| 45 | + PIP_CONSTRAINT: "" # Disable pip constraint for upgrading packages |
| 46 | + tags: [docker, linux, 2-gpu] |
| 47 | + script: |
| 48 | + # Use pre-installed packages without a new venv with tox-current-env |
| 49 | + - pip install tox-current-env |
| 50 | + - tox -e py312-cuda12-gpu --current-env |
| 51 | + |
| 52 | +##### Example Tests ##### |
| 53 | +example: |
| 54 | + extends: .tests-default |
| 55 | + stage: tests |
| 56 | + timeout: 45m |
| 57 | + image: gitlab-master.nvidia.com:5005/omniml/modelopt/modelopt_examples:latest |
| 58 | + variables: |
| 59 | + TEST_TYPE: pytest |
| 60 | + tags: [docker, linux, 2-gpu, sm<89] |
| 61 | + parallel: |
| 62 | + matrix: |
| 63 | + - TEST: [diffusers, llm_distill, llm_qat, llm_sparsity, onnx_ptq, speculative_decoding] |
| 64 | + allow_failure: true # Allow to continue next stages even if job is canceled (e.g. during release) |
| 65 | + before_script: |
| 66 | + - pip install ".[all]" -U |
| 67 | + script: |
| 68 | + # Uninstall apex since T5 Int8 (PixArt) + Apex is not supported as per https://github.com/huggingface/transformers/issues/21391 |
| 69 | + - if [ "$TEST" = "diffusers" ]; then pip uninstall -y apex; fi |
| 70 | + - if [ "$TEST_TYPE" = "pytest" ]; then pytest -s tests/examples/$TEST; else bash tests/examples/test_$TEST.sh; fi |
| 71 | + |
| 72 | +example-ada: |
| 73 | + extends: example |
| 74 | + timeout: 60m |
| 75 | + tags: [docker, linux, 2-gpu, sm>=89] |
| 76 | + parallel: |
| 77 | + matrix: |
| 78 | + - TEST: [llm_eval, llm_ptq, vlm_ptq, llm_autodeploy] |
| 79 | + - TEST: [onnx_ptq] |
| 80 | + TEST_TYPE: bash |
| 81 | + |
| 82 | +##### Megatron / NeMo Integration Tests ##### |
| 83 | +megatron-nemo-integration: |
| 84 | + extends: .tests-default |
| 85 | + variables: |
| 86 | + UPSTREAM_REF: $CI_COMMIT_REF_NAME |
| 87 | + trigger: |
| 88 | + project: omniml/integration/nmm-sandbox |
| 89 | + branch: main |
| 90 | + strategy: depend # Make sure the upstream task is waiting for the downstream task |
0 commit comments