Improve CI time using uv for dependency setup
#4144
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Checks (Transformers) | |
| on: | |
| pull_request: | |
| branches: [ main, 'release/*' ] | |
| types: [ labeled, synchronize ] | |
| push: | |
| branches: [ main, 'release/*' ] | |
| workflow_dispatch: | |
| inputs: | |
| code_coverage: | |
| description: if enabled, code coverage metrics will be collected during the test run | |
| type: boolean | |
| default: false | |
| env: | |
| CADENCE: "commit" | |
| HF_TOKEN: ${{ secrets.HF_TOKEN_READ }} | |
| UV_SYSTEM_PYTHON: 1 | |
| UV_TORCH_BACKEND: "auto" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matched-changes: ${{ steps.changed-files.outputs.all_changed_files }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: neuralmagic/nm-actions/actions/changed-files@14cecb6bf54cc9919b1d3f64881a364401b2ae62 # v1.16.0 | |
| with: | |
| include-patterns: |- | |
| ^src/ | |
| ^tests/ | |
| ^\.github/workflows/test-check-transformers\.yaml$ | |
| ^MANIFEST\.in$ | |
| ^setup\.py$ | |
| exclude-patterns: |- | |
| ^tests/e2e/ | |
| ^tests/lmeval/ | |
| ^tests/examples/ | |
| \.md$ | |
| - name: Log relevant output | |
| run: | | |
| echo "all changed files: ${{ steps.changed-files.outputs.all_changed_files }}" | |
| shell: bash | |
| transformers-tests: | |
| needs: [detect-changes] | |
| runs-on: ibm-wdc-k8s-vllm-h100-solo | |
| if: (contains(github.event.pull_request.labels.*.name, 'ready') || github.event_name == 'push') && needs.detect-changes.outputs.matched-changes != '' | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: "⚙️ Install dependencies" | |
| run: uv pip install .[dev] | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: "neuralmagic/compressed-tensors" | |
| path: "compressed-tensors" | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: "⚙️ Install compressed-tensors dependencies" | |
| id: install | |
| run: | | |
| uv pip uninstall compressed-tensors | |
| export GIT_CEILING_DIRECTORIES="$(pwd)" | |
| cd compressed-tensors | |
| BUILD_TYPE=nightly uv pip install . | |
| - name: "Clean compressed-tensors directory" | |
| run: rm -r compressed-tensors/ | |
| - name: "⚙️ Prepare code coverage" | |
| if: inputs.code_coverage | |
| uses: ./.github/actions/prepare-code-coverage | |
| - name: "🔬 Running transformers tests" | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/compression | |
| - name: Run Finetune Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/finetune | |
| - name: Running GPTQ Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/gptq | |
| - name: Running AutoRound Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/autoround | |
| - name: Running ONESHOT Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/oneshot | |
| - name: Running SparseGPT Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/sparsegpt | |
| - name: Running Tracing Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/tracing | |
| - name: Running KV Cache Tests | |
| if: (success() || failure()) && steps.install.outcome == 'success' | |
| run: | | |
| pytest -v tests/llmcompressor/transformers/kv_cache | |
| - name: "Upload coverage report" | |
| if: (success() || failure()) && inputs.code_coverage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: transformers-tests-coverage-results | |
| path: | | |
| .coverage | |
| coverage-html | |
| coverage.json | |
| include-hidden-files: true | |
| retention-days: 5 | |
| - name: "Report coverage" | |
| if: (success() || failure()) && inputs.code_coverage | |
| run: | | |
| coverage report --data-file=".coverage" --skip-empty --format="markdown" > "$GITHUB_STEP_SUMMARY" |