Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

2.7 KB
Raw Blame
trigger: none

pr:
  autoCancel: true
  drafts: false
  branches:
    include:
      - main
      - "*rc"
  paths:
    include:
      - auto_round
      - auto_round_extension
      - pyproject.toml
      - setup.py
      - setup.cfg
      - MANIFEST.in
      - requirements.txt
      - requirements-cpu.txt
      - .azure-pipelines/compatibility-test.yml
    exclude:
      - "*.md"
      - "**/*.md"

stages:
  - stage:
    displayName: Compatibility Test
    dependsOn: []
    jobs:
    - job:
      timeoutInMinutes: 20
      strategy:
        matrix:
          Python311_Linux:
            python_version: '3.11'
            vmImage: 'ubuntu-latest'
          Python312_Linux:
            python_version: '3.12'
            vmImage: 'ubuntu-latest'
          Python313_Linux:
            python_version: '3.13'
            vmImage: 'ubuntu-latest'
          Python314_Linux:
            python_version: '3.14'
            vmImage: 'ubuntu-latest'
          Python314t_Linux:
            python_version: '3.14t'
            vmImage: 'ubuntu-latest'

          Python311_Windows:
            python_version: '3.11'
            vmImage: 'windows-latest'
          Python312_Windows:
            python_version: '3.12'
            vmImage: 'windows-latest'
          Python313_Windows:
            python_version: '3.13'
            vmImage: 'windows-latest'
          Python314_Windows:
            python_version: '3.14'
            vmImage: 'windows-latest'
          Python314t_Windows:
            python_version: '3.14t'
            vmImage: 'windows-latest'
            
      pool:
        vmImage: $(vmImage)

      steps:
      - bash: |
          curl -LsSf https://astral.sh/uv/install.sh | sh
          echo "##vso[task.prependpath]$HOME/.local/bin"
        condition: ne(variables['Agent.OS'], 'Windows_NT')
        displayName: 'Install uv (Linux)'

      - powershell: |
          irm https://astral.sh/uv/install.ps1 | iex
          Write-Host "##vso[task.prependpath]$env:USERPROFILE\.local\bin"
        condition: eq(variables['Agent.OS'], 'Windows_NT')
        displayName: 'Install uv (Windows)'

      - bash: |
          uv python install $(python_version)
          uv venv --python $(python_version)
          uv pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
          uv build
          uv pip install dist/*.tar.gz && uv pip uninstall auto-round
          uv pip install dist/*.whl
          uv pip list
        env:
          PYTHONUNBUFFERED: '1'
          UV_NO_PROGRESS: '1'
        displayName: 'Install dependencies'

      - bash: |
          uv run python .azure-pipelines/scripts/compat_smoke_test.py
        displayName: 'Run compatibility test'