From 603a8e40731398d44b70526182b49a88ddd430c8 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 29 Aug 2024 11:26:07 +0800 Subject: [PATCH 1/2] update 3x pt binary name Signed-off-by: chensuyue --- .../torch/algorithms/fp8_quant/_core/utils.py | 6 +++--- setup.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/neural_compressor/torch/algorithms/fp8_quant/_core/utils.py b/neural_compressor/torch/algorithms/fp8_quant/_core/utils.py index 30635109c2e..70e1b577733 100644 --- a/neural_compressor/torch/algorithms/fp8_quant/_core/utils.py +++ b/neural_compressor/torch/algorithms/fp8_quant/_core/utils.py @@ -31,10 +31,10 @@ def update_mod_dict(config): def print_init_info(config): import importlib.metadata - versionStr = importlib.metadata.version("neural_compressor_3x_pt") + versionStr = importlib.metadata.version("neural_compressor_pt") locationStr = versionStr.find("git") + 3 - logger.info("neural_compressor_3x_pt Git revision = %s", versionStr[locationStr:]) - logger.info("neural_compressor_3x_pt Configuration = %s", config) + logger.info("neural_compressor_pt Git revision = %s", versionStr[locationStr:]) + logger.info("neural_compressor_pt Configuration = %s", config) def is_substr(substr_list, target): diff --git a/setup.py b/setup.py index 977aa19a1ae..2eddbbebd26 100644 --- a/setup.py +++ b/setup.py @@ -60,8 +60,8 @@ def get_build_version(): }, }, # 3.x pt binary build config, pip install neural-compressor-pt, install 3.x PyTorch API. - "neural_compressor_3x_pt": { - "project_name": "neural_compressor_3x_pt", + "neural_compressor_pt": { + "project_name": "neural_compressor_pt", "include_packages": find_packages( include=[ "neural_compressor.common", @@ -73,8 +73,8 @@ def get_build_version(): "install_requires": fetch_requirements("requirements_pt.txt"), }, # 3.x tf binary build config, pip install neural-compressor-tf, install 3.x TensorFlow API. - "neural_compressor_3x_tf": { - "project_name": "neural_compressor_3x_tf", + "neural_compressor_tf": { + "project_name": "neural_compressor_tf", "include_packages": find_packages( include=[ "neural_compressor.common", @@ -100,11 +100,11 @@ def get_build_version(): if "pt" in sys.argv: sys.argv.remove("pt") - cfg_key = "neural_compressor_3x_pt" + cfg_key = "neural_compressor_pt" if "tf" in sys.argv: sys.argv.remove("tf") - cfg_key = "neural_compressor_3x_tf" + cfg_key = "neural_compressor_tf" if bool(os.getenv("USE_FP8_CONVERT", False)): from torch.utils.cpp_extension import BuildExtension, CppExtension From b1761c60dee7e7206bc10d81bc0651e40e9d44d1 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 29 Aug 2024 11:40:16 +0800 Subject: [PATCH 2/2] update ci test for installation binary name change Signed-off-by: chensuyue Signed-off-by: chensuyue --- .azure-pipelines/scripts/install_nc.sh | 13 ++++++++----- .azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/scripts/install_nc.sh b/.azure-pipelines/scripts/install_nc.sh index 7a525236686..96dd9039ac7 100644 --- a/.azure-pipelines/scripts/install_nc.sh +++ b/.azure-pipelines/scripts/install_nc.sh @@ -3,17 +3,20 @@ echo -e "\n Install Neural Compressor ... " cd /neural-compressor if [[ $1 = *"3x_pt"* ]]; then - if [[ $1 != *"3x_pt_fp8"* ]]; then + python -m pip install --no-cache-dir -r requirements_pt.txt + if [[ $1 = *"3x_pt_fp8"* ]]; then + pip uninstall neural_compressor_3x_pt -y || true + python setup.py pt bdist_wheel + else echo -e "\n Install torch CPU ... " pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cpu + python -m pip install --no-cache-dir -r requirements.txt + python setup.py bdist_wheel fi - python -m pip install --no-cache-dir -r requirements_pt.txt - # python setup.py pt bdist_wheel - python setup.py bdist_wheel pip install --no-deps dist/neural_compressor*.whl --force-reinstall elif [[ $1 = *"3x_tf"* ]]; then + python -m pip install --no-cache-dir -r requirements.txt python -m pip install --no-cache-dir -r requirements_tf.txt - # python setup.py tf bdist_wheel python setup.py bdist_wheel pip install dist/neural_compressor*.whl --force-reinstall else diff --git a/.azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh b/.azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh index 753dd8ac440..d99c20314a5 100644 --- a/.azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh +++ b/.azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh @@ -7,6 +7,8 @@ echo "${test_case}" echo "set up UT env..." export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH sed -i '/^intel_extension_for_pytorch/d' /neural-compressor/test/3x/torch/requirements.txt +sed -i '/^auto_round/d' /neural-compressor/test/3x/torch/requirements.txt +cat /neural-compressor/test/3x/torch/requirements.txt pip install -r /neural-compressor/test/3x/torch/requirements.txt pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.16.0 pip install pytest-cov