PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
disable timeout in pytest until found a more stable method (#2222)
chen, suyue96ce448039b3
diff --git a/.azure-pipelines/scripts/cuda_unit_test/run_cuda_ut.sh b/.azure-pipelines/scripts/cuda_unit_test/run_cuda_ut.shindex 5c3579656..5bc5aa92b 100644--- a/.azure-pipelines/scripts/cuda_unit_test/run_cuda_ut.sh+++ b/.azure-pipelines/scripts/cuda_unit_test/run_cuda_ut.sh@@ -63,7 +63,7 @@ function run_unit_test() {uv pip install -r test/unit/test_cuda/requirements.txtuv pip install -r test/unit/test_cuda/requirements_diffusion.txtuv pip install -U transformers chardet- uv pip install -U pytest-cov pytest-timeout+ uv pip install -U pytest-covuv pip install kernels==0.15.2 # For sm120: https://github.com/huggingface/transformers/blob/v5.13.1/setup.py#L93uv pip uninstall torch torchvisionuv pip install torch==2.13.0 torchvision torchao --index-url https://download.pytorch.org/whl/cu130@@ -102,8 +102,7 @@ function run_unit_test() {local ut_log_name=${LOG_DIR}/unittest_cuda_${test_basename}.logpytest -m "not skip_ci" \- --cov=auto_round --cov-report= --cov-append --timeout=60 --session-timeout=720 \- -vs --junitxml="${ut_log_name%.log}.xml" \+ --cov=auto_round --cov-report= -vs --junitxml="${ut_log_name%.log}.xml" \${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"done@@ -117,7 +116,7 @@ function run_unit_test_llmc() {cd "${BUILD_SOURCESDIRECTORY}" || exit 1rm -rf /root/.venvuv venv --python=3.12 /root/.venv- uv pip install -U pytest-cov pytest-timeout+ uv pip install -U pytest-covBUILD_TYPE="nightly" uv pip install \-r test/integration/test_cuda/requirements_llmc.txt \--extra-index-url https://download.pytorch.org/whl/cu130 \@@ -151,7 +150,7 @@ function run_unit_test_sglang() {cd "${BUILD_SOURCESDIRECTORY}" || exit 1rm -rf /root/.venvuv venv --python=3.12 /root/.venv- uv pip install -U pytest-cov pytest-timeout+ uv pip install -U pytest-covuv pip install -r test/integration/test_cuda/requirements_sglang.txt \--prerelease=allow \--extra-index-url https://download.pytorch.org/whl/cu130 \@@ -185,7 +184,7 @@ function run_unit_test_vllm() {cd "${BUILD_SOURCESDIRECTORY}" || exit 1rm -rf /root/.venvuv venv --python=3.12 /root/.venv- uv pip install -U pytest-cov pytest-timeout+ uv pip install -U pytest-covuv pip install -r test/integration/test_cuda/requirements_vllm.txt \--extra-index-url https://download.pytorch.org/whl/cu130 \--index-strategy unsafe-best-matchdiff --git a/.azure-pipelines/scripts/ut/run_ut.sh b/.azure-pipelines/scripts/ut/run_ut.shindex b82151096..9cc11d872 100644--- a/.azure-pipelines/scripts/ut/run_ut.sh+++ b/.azure-pipelines/scripts/ut/run_ut.sh@@ -26,7 +26,7 @@ function setup_environment() {git clone -b master --quiet --single-branch https://github.com/ggml-org/llama.cpp.git && cd llama.cpp/gguf-py && uv pip install .# install unit report dependencies- uv pip install pytest-cov pytest-timeout+ uv pip install pytest-covuv pip install -U chardetuv pip list@@ -89,7 +89,7 @@ function run_unit_test() {local ut_log_name=${LOG_DIR}/unittest_${test_basename}.lognumactl --physcpubind="${NUMA_CPUSET:-0-15}" --membind="${NUMA_NODE:-0}" \- pytest -m "not skip_ci" --timeout=${TIMEOUT} --session-timeout=${SESSION_TIMEOUT} \+ pytest -m "not skip_ci" \--cov=auto_round --cov-report= --cov-append \-vs --junitxml="${ut_log_name%.log}.xml" ${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"diff --git a/.azure-pipelines/scripts/ut/run_ut_hpu.sh b/.azure-pipelines/scripts/ut/run_ut_hpu.shindex 7e821eb72..31b26dcf6 100644--- a/.azure-pipelines/scripts/ut/run_ut_hpu.sh+++ b/.azure-pipelines/scripts/ut/run_ut_hpu.sh@@ -9,7 +9,7 @@ function setup_environment() {export TZ='Asia/Shanghai'export TQDM_MININTERVAL=60export HF_HUB_DISABLE_PROGRESS_BARS=1- pip install pytest-cov pytest-timeout+ pip install pytest-covpip listecho "##[endgroup]"@@ -42,7 +42,6 @@ function run_unit_test() {echo "##[group]Running ${test_file} in HPU lazy mode..."local ut_log_name="${LOG_DIR}/unittest_lazy_${test_basename}.log"PT_HPU_LAZY_MODE=1 pytest --cov="${auto_round_path}" \- --timeout=30 --session-timeout=600 \--cov-report= --cov-append -vs \--junitxml="${ut_log_name%.log}.xml" ${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"@@ -50,7 +49,6 @@ function run_unit_test() {echo "##[group]Running ${test_file} in HPU compile mode..."local ut_log_name="${LOG_DIR}/unittest_compile_${test_basename}.log"PT_HPU_LAZY_MODE=0 pytest --mode compile --cov="${auto_round_path}" \- --timeout=30 --session-timeout=600 \--cov-report= --cov-append -vs \--junitxml="${ut_log_name%.log}.xml" ${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"diff --git a/.azure-pipelines/scripts/ut/run_ut_xpu.sh b/.azure-pipelines/scripts/ut/run_ut_xpu.shindex edc06dfc3..bf6cbc958 100644--- a/.azure-pipelines/scripts/ut/run_ut_xpu.sh+++ b/.azure-pipelines/scripts/ut/run_ut_xpu.sh@@ -9,7 +9,7 @@ SESSION_TIMEOUT=600function setup_environment() {echo "##[group]set up UT env..."- uv pip install pytest-cov pytest-timeout+ uv pip install pytest-covuv pip listecho "##[endgroup]"@@ -47,8 +47,7 @@ function run_unit_test() {echo "##[group]Running ark ${test_file}..."local ut_log_name="${LOG_DIR}/unittest_ark_${test_basename}.log"numactl --physcpubind="${NUMA_CPUSET:-0-27}" --membind="${NUMA_NODE:-0}" \- pytest --timeout=${TIMEOUT} --session-timeout=${SESSION_TIMEOUT} \- --cov="${auto_round_path}" --cov-report= --cov-append -vs \+ pytest --cov="${auto_round_path}" --cov-report= --cov-append -vs \--junitxml="${ut_log_name%.log}.xml" ${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"done@@ -59,8 +58,7 @@ function run_unit_test() {echo "##[group]Running xpu ${test_file}..."local ut_log_name="${LOG_DIR}/unittest_xpu_${test_basename}.log"numactl --physcpubind="${NUMA_CPUSET:-0-27}" --membind="${NUMA_NODE:-0}" \- pytest --timeout=${TIMEOUT} --session-timeout=${SESSION_TIMEOUT} \- --cov="${auto_round_path}" --cov-report= --cov-append -vs \+ pytest --cov="${auto_round_path}" --cov-report= --cov-append -vs \--junitxml="${ut_log_name%.log}.xml" ${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"done@@ -87,8 +85,7 @@ function run_unit_test_llmc() {echo "##[group]Running xpu llmc ${test_file}..."local ut_log_name="${LOG_DIR}/unittest_xpu_${test_basename}.log"numactl --physcpubind="${NUMA_CPUSET:-0-27}" --membind="${NUMA_NODE:-0}" \- pytest --timeout=${TIMEOUT} --session-timeout=${SESSION_TIMEOUT} \- --cov="${auto_round_path}" --cov-report= --cov-append -vs \+ pytest --cov="${auto_round_path}" --cov-report= --cov-append -vs \--junitxml="${ut_log_name%.log}.xml" ${test_file} 2>&1 | tee ${ut_log_name}echo "##[endgroup]"done