Skip to content

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

Add python 3.14t compatibility tests (#2110)

Sun, Xuehao98f2cdb9a345
diff --git a/.azure-pipelines/compatibility-test.yml b/.azure-pipelines/compatibility-test.yml
index 8809933da..86b384c4e 100644
--- a/.azure-pipelines/compatibility-test.yml
+++ b/.azure-pipelines/compatibility-test.yml
@@ -10,8 +10,10 @@ pr:
include:
- auto_round
- auto_round_extension
+ - pyproject.toml
- setup.py
- setup.cfg
+ - MANIFEST.in
- requirements.txt
- requirements-cpu.txt
- .azure-pipelines/compatibility-test.yml
@@ -43,6 +45,9 @@ stages:
Python314_Linux:
python_version: '3.14'
vmImage: 'ubuntu-latest'
+ Python314t_Linux:
+ python_version: '3.14t'
+ vmImage: 'ubuntu-latest'
Python310_Windows:
python_version: '3.10'
@@ -59,18 +64,29 @@ stages:
Python314_Windows:
python_version: '3.14'
vmImage: 'windows-latest'
+ Python314t_Windows:
+ python_version: '3.14t'
+ vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
- - task: UsePythonVersion@0
- inputs:
- versionSpec: '$(python_version)'
- displayName: 'Use Python $(python_version)'
+ - 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: |
- python -m pip install --upgrade pip uv
+ 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
@@ -79,9 +95,8 @@ stages:
env:
PYTHONUNBUFFERED: '1'
UV_NO_PROGRESS: '1'
- UV_SYSTEM_PYTHON: '1'
displayName: 'Install dependencies'
- bash: |
- python -c "import auto_round; print(auto_round.__version__)"
+ uv run python .azure-pipelines/scripts/compat_smoke_test.py
displayName: 'Run compatibility test'
diff --git a/.azure-pipelines/scripts/compat_smoke_test.py b/.azure-pipelines/scripts/compat_smoke_test.py
new file mode 100644
index 000000000..3c48e701a
--- /dev/null
+++ b/.azure-pipelines/scripts/compat_smoke_test.py
@@ -0,0 +1,30 @@
+"""Post-install smoke test for the compatibility pipeline.
+
+Run as a standalone script (``python .azure-pipelines/scripts/compat_smoke_test.py``)
+so that ``import auto_round`` resolves to the *installed* package instead of the
+source tree at the repository root (``sys.path[0]`` becomes this script's directory,
+and the current working directory is not added for script execution).
+
+It validates that:
+ * the package imports and exposes ``__version__``;
+ * the public ``AutoRound`` entry class is importable;
+ * a registered console script (``auto-round``) is installed and runnable.
+"""
+
+import subprocess
+import sys
+
+import auto_round
+from auto_round import AutoRound
+
+print(f"auto_round imported from: {auto_round.__file__}")
+print(f"auto_round {auto_round.__version__} imported successfully (AutoRound={AutoRound.__name__})")
+
+# Verify the console_scripts entry point was installed and is runnable.
+result = subprocess.run(["auto-round", "--help"], capture_output=True, text=True)
+if result.returncode != 0:
+ sys.stderr.write(result.stdout)
+ sys.stderr.write(result.stderr)
+ raise SystemExit(f"`auto-round --help` failed with exit code {result.returncode}")
+
+print("console script `auto-round` is installed and runnable")