Skip to content

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

Update CUDA UT to cu130 (#1992)

Sun, Xuehao525648235484
diff --git a/.azure-pipelines/scripts/ut/run_ut_cuda.sh b/.azure-pipelines/scripts/ut/run_ut_cuda.sh
index 92f715c7d..087d18047 100644
--- a/.azure-pipelines/scripts/ut/run_ut_cuda.sh
+++ b/.azure-pipelines/scripts/ut/run_ut_cuda.sh
@@ -31,7 +31,8 @@ function create_conda_env() {
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=$(python -c "import site; print(site.getsitepackages()[0])")/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH
fi
- uv pip install pytest-cov cmake requests
+ uv pip install pytest-cov cmake requests ninja psutil
+ uv cache prune
}
function print_test_results_table() {
@@ -91,14 +92,14 @@ function run_unit_test() {
cd ${REPO_PATH}/test
rm -rf .coverage* *.xml *.html
- uv pip install torch==2.12.0 torchvision torchao --index-url https://download.pytorch.org/whl/cu126
- CMAKE_ARGS="-DGGML_CUDA=on -DLLAVA_BUILD=off" uv pip install llama-cpp-python
+ uv pip install torch==2.12.1 torchvision torchao --index-url https://download.pytorch.org/whl/cu130
+ uv pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu130
uv pip install 'git+https://github.com/ggml-org/llama.cpp.git#subdirectory=gguf-py'
uv pip install -r test_cuda/requirements.txt
uv pip install -r test_cuda/requirements_diffusion.txt
uv pip install -U transformers chardet
uv pip uninstall torch torchvision
- uv pip install torch==2.12.0 torchvision torchao --index-url https://download.pytorch.org/whl/cu126
+ uv pip install torch==2.12.1 torchvision torchao --index-url https://download.pytorch.org/whl/cu130
cd ${REPO_PATH} && uv pip install . && cd ${REPO_PATH}/test
pip list > ${LOG_DIR}/ut_pip_list.txt
@@ -126,12 +127,11 @@ function run_unit_test_vlm() {
cd ${REPO_PATH}/test
rm -rf .coverage* *.xml *.html
- uv pip install torch==2.12.0 torchvision --index-url https://download.pytorch.org/whl/cu126
+ uv pip install torch==2.12.1 torchvision --index-url https://download.pytorch.org/whl/cu130
uv pip install git+https://github.com/haotian-liu/[email protected] --no-deps
- uv pip install -v git+https://github.com/casper-hansen/[email protected] --no-build-isolation
uv pip install flash-attn==2.8.3 --no-build-isolation
uv pip install -r test_cuda/requirements_vlm.txt \
- --extra-index-url https://download.pytorch.org/whl/cu126 \
+ --extra-index-url https://download.pytorch.org/whl/cu130 \
--index-strategy unsafe-best-match
uv pip install -U chardet
cd ${REPO_PATH} && uv pip install . && cd ${REPO_PATH}/test
@@ -161,7 +161,7 @@ function run_unit_test_llmc() {
cd ${REPO_PATH}/test
rm -rf .coverage* *.xml *.html
- BUILD_TYPE="nightly" uv pip install -r test_cuda/requirements_llmc.txt --extra-index-url https://download.pytorch.org/whl/cu126 --index-strategy unsafe-best-match
+ BUILD_TYPE="nightly" uv pip install -r test_cuda/requirements_llmc.txt --extra-index-url https://download.pytorch.org/whl/cu130 --index-strategy unsafe-best-match
uv pip install -U chardet
cd ${REPO_PATH} && uv pip install . && cd ${REPO_PATH}/test
@@ -190,7 +190,12 @@ function run_unit_test_sglang() {
cd ${REPO_PATH}/test
rm -rf .coverage* *.xml *.html
- uv pip install "sglang<0.5.11" --prerelease=allow
+ uv pip install -r test_cuda/requirements_sglang.txt \
+ --prerelease=allow \
+ --extra-index-url https://download.pytorch.org/whl/cu130 \
+ --index-strategy unsafe-best-match
+ local flashinfer_version=$(uv pip show flashinfer-python 2>/dev/null | grep -i "^Version" | awk '{print $2}')
+ uv pip install flashinfer-jit-cache==${flashinfer_version} --index-url https://flashinfer.ai/whl/cu130
cd ${REPO_PATH} && uv pip install . && cd ${REPO_PATH}/test
pip list > ${LOG_DIR}/sglang_ut_pip_list.txt
@@ -219,11 +224,11 @@ function run_unit_test_vllm() {
cd ${REPO_PATH}/test
rm -rf .coverage* *.xml *.html
- vllm_version=$(curl -s https://api.github.com/repos/vllm-project/vllm/releases/latest | jq -r .tag_name | sed 's/^v//')
uv pip install -r test_cuda/requirements_vllm.txt \
- --extra-index-url https://wheels.vllm.ai/${vllm_version}/cu129 \
- --extra-index-url https://download.pytorch.org/whl/cu126 \
+ --extra-index-url https://download.pytorch.org/whl/cu130 \
--index-strategy unsafe-best-match
+ local flashinfer_version=$(uv pip show flashinfer-python 2>/dev/null | grep -i "^Version" | awk '{print $2}')
+ uv pip install flashinfer-jit-cache==${flashinfer_version} --index-url https://flashinfer.ai/whl/cu130
uv pip install -U chardet
cd ${REPO_PATH} && uv pip install . && cd ${REPO_PATH}/test
diff --git a/.azure-pipelines/unit-test-cuda.yml b/.azure-pipelines/unit-test-cuda.yml
index ba6baca35..bf66fdac9 100644
--- a/.azure-pipelines/unit-test-cuda.yml
+++ b/.azure-pipelines/unit-test-cuda.yml
@@ -72,11 +72,8 @@ stages:
script: |
export PYTHONUNBUFFERED=1
cd ${BUILD_SOURCESDIRECTORY}
- if [ ${{ pair.value.PART }} -eq 0 ]; then
- CUDA_VERSION="13.0"
- else
- CUDA_VERSION="any"
- fi
+ CUDA_VERSION="13.0"
+
python .azure-pipelines/scripts/cuda_unit_test/runpod_manager.py \
--action create \
--api_key $(RUNPOD_API_KEY) \
diff --git a/test/test_cuda/models/test_fp8_model.py b/test/test_cuda/models/test_fp8_model.py
index ce1ae47c9..1b98ab7d0 100644
--- a/test/test_cuda/models/test_fp8_model.py
+++ b/test/test_cuda/models/test_fp8_model.py
@@ -90,7 +90,7 @@ class TestAutoRound:
# inputs = tokenizer(text, return_tensors="pt").to(model.device)
# print(tokenizer.decode(model.generate(**inputs, max_new_tokens=50)[0]))
- @pytest.mark.skip_ci(reason="Triton issue; time-consuming")
+ @pytest.mark.skip_ci(reason="time-consuming")
def test_small_model_rtn(self, mock_fp8_capable_device):
model_name = get_model_path("Qwen/Qwen3-0.6B-FP8")
ar = AutoRound(model=model_name, iters=0, disable_opt_rtn=True)
@@ -98,7 +98,7 @@ class TestAutoRound:
with patch("torch.cuda.get_device_capability", return_value=DEVICE_CAPABILITY): # revert DEVICE_CAPABILITY
evaluate_accuracy(folder, threshold=0.25)
- @pytest.mark.skip_ci(reason="Triton issue; time-consuming")
+ @pytest.mark.skip_ci(reason="time-consuming")
def test_small_model_iters1(self, mock_fp8_capable_device):
model_name = get_model_path("Qwen/Qwen3-0.6B-FP8")
ar = AutoRound(model=model_name, iters=1)
@@ -113,7 +113,7 @@ class TestAutoRound:
with patch("torch.cuda.get_device_capability", return_value=DEVICE_CAPABILITY): # revert DEVICE_CAPABILITY
evaluate_accuracy(folder, threshold=0.33)
- @pytest.mark.skip_ci(reason="Triton issue; time-consuming")
+ @pytest.mark.skip_ci(reason="time-consuming")
def test_small_model_rtn_with_lm_head(self, mock_fp8_capable_device):
model_name = get_model_path("Qwen/Qwen3-0.6B-FP8")
layer_config = {"lm_head": {"bits": 4}}