Skip to content

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

3.8 KB
Raw Blame
# Nightly XPU pipeline: runs the XPU unit tests plus the heavier XPU LLMC
# integration test that is excluded from the fast PR pipeline (unit-test-xpu.yml).
# Scheduled daily; can also be triggered manually from the Azure DevOps UI.

trigger: none
pr:
  autoCancel: true
  drafts: false
  branches:
    include:
      - main
      - "*rc"
  paths:
    include:
      - test/integration/test_xpu
      - .azure-pipelines/nightly-test-xpu.yml
      - .azure-pipelines/scripts/ut/detect_changed_tests.sh

parameters:
  - name: xpuTestParts
    type: object
    default:
      - base
      - common
      - ark
      - llmc

schedules:
  - cron: "0 19 * * *"   # 03:00 Asia/Shanghai every day
    displayName: Daily XPU nightly run
    branches:
      include:
        - main
    always: true

# use XPU BMG B60 agent pool to run tests
pool: B60

variables:
  IMAGE_NAME: "auto-round"
  IMAGE_TAG: "py314-xpu"
  DOCKERFILE_NAME: "xpu.dockerfile"
  UPLOAD_PATH: $(Build.SourcesDirectory)/log_dir
  DOWNLOAD_PATH: $(Build.SourcesDirectory)/log_dir
  ARTIFACT_NAME: "Nightly_XPU_coverage_report"
  REPO: $(Build.Repository.Uri)

stages:
  - template: template/lib-build-template.yml
    parameters:
      enableChangeDetection: true
      publishToTestPyPI: false

  - stage: Nightly_xpu_test
    displayName: Nightly XPU Test
    dependsOn: [BuildArkWheel]
    condition: in(dependencies.BuildArkWheel.result, 'Succeeded', 'Skipped')
    jobs:
      - job:
        displayName: Nightly XPU Test
        timeoutInMinutes: 180
        strategy:
          matrix:
            # PR-triggered runs only cover ark/llmc; the base part duplicates the fast PR unit-test pipeline.
            ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
              part_ark:
                PART: ark
              part_llmc:
                PART: llmc
            ${{ else }}:
              ${{ each part in parameters.xpuTestParts }}:
                part_${{ part }}:
                  PART: ${{ part }}
        steps:
          - template: template/ut-template.yml
            parameters:
              utScriptFileName: "run_ut_xpu"
              utTestMode: $(PART)
              uploadPath: $(UPLOAD_PATH)
              utArtifact: "$(PART)-xpu"
              imageTag: $(IMAGE_TAG)
              dockerFileName: $(DOCKERFILE_NAME)
              utContainerName: "AutoRoundNightly$(NODE_LABEL)"
              buildARKWheel: "false"
              filterChangedTests: true

  - stage: Coverage
    displayName: "Collect Coverage"
    pool:
      vmImage: "ubuntu-latest"
    dependsOn: [Nightly_xpu_test]
    condition: and(succeeded('Nightly_xpu_test'), ne(variables['Build.Reason'], 'PullRequest'))
    jobs:
      - job: CollectDatafiles
        steps:
          - task: DownloadPipelineArtifact@2
            inputs:
              artifact:
              patterns: '*_coverage/.coverage.*'
              path: $(DOWNLOAD_PATH)

          - task: UsePythonVersion@0
            inputs:
              versionSpec: '3.14'
              displayName: 'Use Python 3.14'

          - script: |
              pip install -U pip setuptools uv
              cd ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/scripts
              bash ut/collect_log.sh xpu
            env:
              PYTHONUNBUFFERED: '1'
              UV_NO_PROGRESS: '1'
              UV_SYSTEM_PYTHON: '1'
            displayName: "Collect UT Coverage"

          - task: PublishPipelineArtifact@1
            condition: succeededOrFailed()
            inputs:
              targetPath: $(UPLOAD_PATH)/coverage_PR
              artifact: $(ARTIFACT_NAME)
              publishLocation: "pipeline"

          - task: UseDotNet@2
            displayName: 'Use .NET Core sdk 7.0.x'
            inputs:
              version: 7.0.x

          - task: PublishCodeCoverageResults@2
            inputs:
              summaryFileLocation: $(UPLOAD_PATH)/coverage_PR/coverage.xml