PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
Use modelscope cache in CPU UT (#1124)
Sun, Xuehaofb43723cca88
diff --git a/.azure-pipelines/scripts/ut/run_ut.sh b/.azure-pipelines/scripts/ut/run_ut.shindex da3caecca..ea402cb77 100644--- a/.azure-pipelines/scripts/ut/run_ut.sh+++ b/.azure-pipelines/scripts/ut/run_ut.sh@@ -15,7 +15,6 @@ cd ~ || exit 1git clone -b master --quiet --single-branch https://github.com/ggml-org/llama.cpp.git && cd llama.cpp/gguf-py && uv pip install .cd /auto-round && uv pip install .-uv pip install lm_eval==0.4.9.1echo "##[endgroup]"uv pip listdiff --git a/.azure-pipelines/scripts/ut/run_ut_cuda.sh b/.azure-pipelines/scripts/ut/run_ut_cuda.shindex 28f71782e..e675e12d5 100644--- a/.azure-pipelines/scripts/ut/run_ut_cuda.sh+++ b/.azure-pipelines/scripts/ut/run_ut_cuda.sh@@ -106,7 +106,7 @@ function run_unit_test() {pip list > ${LOG_DIR}/ut_pip_list.txtexport COVERAGE_RCFILE=${REPO_PATH}/.azure-pipelines/scripts/ut/.coveragelocal auto_round_path=$(python -c 'import auto_round; print(auto_round.__path__[0])')-+# run unit tests individually with separate logsfor test_file in $(find . -name "test_*.py" ! -name "test_*vlms.py" | sort); dolocal test_basename=$(basename ${test_file} .py)diff --git a/test/test_cpu/test_model_scope.py b/test/test_cpu/test_model_scope.pyindex 0663bcf12..6da33cdc3 100644--- a/test/test_cpu/test_model_scope.py+++ b/test/test_cpu/test_model_scope.py@@ -1,4 +1,5 @@import copy+import osimport shutilimport sysimport unittest@@ -25,10 +26,18 @@ class TestModelScope(unittest.TestCase):self.saved_path = "./saved"self.dataset = LLMDataLoader()+ self.source_path, self.cache_path = "/tf_dataset/auto_round/modelscope", "/home/hostuser/.cache/modelscope"+ if os.path.exists(self.source_path):+ if not os.path.exists("/home/hostuser/.cache"):+ os.makedirs("/home/hostuser/.cache")+ shutil.copytree(self.source_path, self.cache_path, dirs_exist_ok=True)+@classmethoddef tearDownClass(self):shutil.rmtree("./saved", ignore_errors=True)shutil.rmtree("runs", ignore_errors=True)+ if os.path.exists(self.cache_path):+ shutil.rmtree(self.cache_path, ignore_errors=True)return super().tearDownClass()