Skip to content

Weight compression #222

Weight compression

Weight compression #222

name: Weight compression
permissions: read-all
on:
workflow_call:
workflow_dispatch:
inputs:
pull_request_number:
description: 'The pull request number'
default: ''
pytest_args:
description: 'Pytest arguments'
default: ''
jobs:
examples-cpu:
name: Weight compression [${{ matrix.group }}/6]
runs-on: ubuntu-latest-16-cores
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
fetch-depth: 0 # Fetch full history to allow checking out any branch or PR
- name: Fetch and Checkout the Pull Request Branch
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }}
run: |
git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }}
git checkout pr-${{ github.event.inputs.pull_request_number }}
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.10.14
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
- name: cpuinfo
run: cat /proc/cpuinfo
- name: Install NNCF and test requirements
run: uv pip install --system . -r tests/post_training/requirements.txt
- name: Print installed modules
run: pip list
- name: Run examples test scope
run: |
set +e
python -m pytest -s -ra tests/post_training/test_quantize_conformance.py::test_weight_compression \
--junit-xml=pytest-results.xml \
--durations-path=tests/post_training/data/wc_test_durations.json \
--splitting-algorithm=least_duration \
--splits 6 \
--group ${{ matrix.group }} \
${{ github.event.inputs.pytest_args || '' }}
ret=$?
[ $ret -eq 5 ] && [ -n "${{ github.event.inputs.pytest_args || '' }}" ] && exit 0 || exit $ret
env:
TQDM_DISABLE: 1
HOME_HF: "/home/runner/hf_home"
- name: Print results.csv
if: ${{ !cancelled() }}
run: column -s, -t < tmp/results.csv || echo "no file"
- name: Upload artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f #v6.0.0
with:
name: wc_results_${{ matrix.group }}
path: tmp/results.csv
if-no-files-found: ignore
- name: Test Summary
if: ${{ !cancelled() }}
run: |
pip install defusedxml==0.7.1
python .github/scripts/pytest_md_summary.py pytest-results.xml >> "$GITHUB_STEP_SUMMARY"