PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
Fix cuda test and llmc test (#1152)
Sun, Xuehao07c9f634c38d
diff --git a/.azure-pipelines/scripts/ut/run_ut_cuda.sh b/.azure-pipelines/scripts/ut/run_ut_cuda.shindex e675e12d5..18a9bb00d 100644--- a/.azure-pipelines/scripts/ut/run_ut_cuda.sh+++ b/.azure-pipelines/scripts/ut/run_ut_cuda.sh@@ -34,7 +34,7 @@ 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_PATHfi- uv pip install -v --no-build-isolation .+ uv pip install --no-build-isolation .uv pip install pytest-cov pytest-html cmake==4.0.2uv pip install torch==2.8.0 torchvision}@@ -108,7 +108,7 @@ function run_unit_test() {local auto_round_path=$(python -c 'import auto_round; print(auto_round.__path__[0])')# run unit tests individually with separate logs- for test_file in $(find . -name "test_*.py" ! -name "test_*vlms.py" | sort); do+ for test_file in $(find . -name "test_*.py" ! -name "test_*vlms.py" ! -name "test_llmc*.py" | sort); dolocal test_basename=$(basename ${test_file} .py)local ut_log_name=${LOG_DIR}/unittest_cuda_${test_basename}.logecho "Running ${test_file}..."@@ -162,8 +162,39 @@ function run_unit_test_vlm() {fi}+function run_unit_test_llmc() {+ # install unit test dependencies+ create_conda_env++ cd ${REPO_PATH}/test/test_cuda+ rm -rf .coverage* *.xml *.html++ uv pip install -r requirements_llmc.txt++ pip list > ${LOG_DIR}/llmc_ut_pip_list.txt+ export COVERAGE_RCFILE=${REPO_PATH}/.azure-pipelines/scripts/ut/.coverage+ local auto_round_path=$(python -c 'import auto_round; print(auto_round.__path__[0])')++ # run unit tests individually with separate logs+ for test_file in $(find . -name "test_llmc*.py" | sort); do+ local test_basename=$(basename ${test_file} .py)+ local ut_log_name=${LOG_DIR}/unittest_cuda_llmc_${test_basename}.log+ echo "Running ${test_file}..."++ python -m pytest --cov="${auto_round_path}" --cov-report term --html=report_llmc.html --self-contained-html --cov-report xml:coverage_llmc.xml --cov-append -vs --disable-warnings ${test_file} 2>&1 | tee ${ut_log_name}+ done++ mv report_llmc.html ${LOG_DIR}/+ mv coverage_llmc.xml ${LOG_DIR}/+ # Print test results table and check for failures+ if ! print_test_results_table "unittest_cuda_llmc_test_*.log" "CUDA LLMC Tests"; then+ echo "Some CUDA LLMC tests failed. Please check the individual log files for details."+ fi+}+function main() {run_unit_test_vlm+ run_unit_test_llmcrun_unit_testcat ${SUMMARY_LOG}}diff --git a/.azure-pipelines/unit-test-hpu.yml b/.azure-pipelines/unit-test-hpu.ymlindex 490173d50..68fad3fa2 100644--- a/.azure-pipelines/unit-test-hpu.yml+++ b/.azure-pipelines/unit-test-hpu.yml@@ -21,6 +21,8 @@ pr:- auto_round/export/export_to_awq- "*.md"- "**/*.md"+ - .azure-pipelines/scripts/ut/run_ut_cuda.sh+ - .azure-pipelines/scripts/ut/run_ut.shpool: GAUDIdiff --git a/.azure-pipelines/unit-test.yml b/.azure-pipelines/unit-test.ymlindex b958a45e7..d10e47ca7 100644--- a/.azure-pipelines/unit-test.yml+++ b/.azure-pipelines/unit-test.yml@@ -22,6 +22,8 @@ pr:- test/test*hpu*- "*.md"- "**/*.md"+ - .azure-pipelines/scripts/ut/run_ut_hpu.sh+ - .azure-pipelines/scripts/ut/run_ut_cuda.shpool: ICX-16Cdiff --git a/test/test_cuda/requirements.txt b/test/test_cuda/requirements.txtindex 86c0435c7..e7dd4e0d8 100644--- a/test/test_cuda/requirements.txt+++ b/test/test_cuda/requirements.txt@@ -1,8 +1,6 @@-# autoawq# pip install -v git+https://github.com/casper-hansen/AutoAWQ.git --no-build-isolationauto-gptqeinops-# gptqmodel>=2.0# pip install -v git+https://github.com/ModelCloud/[email protected] --no-build-isolationintel-extension-for-pytorchlm-eval>=0.4.9.1@@ -12,5 +10,4 @@ parameterizedpillowtorchvisionnumba-vllm>=0.8.5.post1-llmcompressor @ git+https://github.com/vllm-project/llm-compressor.git@main\ No newline at end of file+vllm>=0.8.5.post1,<=0.11.0diff --git a/test/test_cuda/requirements_llmc.txt b/test/test_cuda/requirements_llmc.txtnew file mode 100644index 000000000..b11e53b7a--- /dev/null+++ b/test/test_cuda/requirements_llmc.txt@@ -0,0 +1,2 @@+llmcompressor @ git+https://github.com/vllm-project/llm-compressor.git@main+parameterized