Skip to content

Commit f2c454f

Browse files
authored
update installation and ci test for 3x api (#1991)
Signed-off-by: chensuyue <suyue.chen@intel.com>
1 parent 7ba9fdc commit f2c454f

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

.azure-pipelines/scripts/install_nc.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
echo -e "\n Install Neural Compressor ... "
44
cd /neural-compressor
55
if [[ $1 = *"3x_pt"* ]]; then
6-
if [[ $1 != *"3x_pt_fp8"* ]]; then
6+
python -m pip install --no-cache-dir -r requirements_pt.txt
7+
if [[ $1 = *"3x_pt_fp8"* ]]; then
8+
pip uninstall neural_compressor_3x_pt -y || true
9+
python setup.py pt bdist_wheel
10+
else
711
echo -e "\n Install torch CPU ... "
812
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cpu
13+
python -m pip install --no-cache-dir -r requirements.txt
14+
python setup.py bdist_wheel
915
fi
10-
python -m pip install --no-cache-dir -r requirements_pt.txt
11-
# python setup.py pt bdist_wheel
12-
python setup.py bdist_wheel
1316
pip install --no-deps dist/neural_compressor*.whl --force-reinstall
1417
elif [[ $1 = *"3x_tf"* ]]; then
18+
python -m pip install --no-cache-dir -r requirements.txt
1519
python -m pip install --no-cache-dir -r requirements_tf.txt
16-
# python setup.py tf bdist_wheel
1720
python setup.py bdist_wheel
1821
pip install dist/neural_compressor*.whl --force-reinstall
1922
else

.azure-pipelines/scripts/ut/3x/run_3x_pt_fp8.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ echo "${test_case}"
77
echo "set up UT env..."
88
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
99
sed -i '/^intel_extension_for_pytorch/d' /neural-compressor/test/3x/torch/requirements.txt
10+
sed -i '/^auto_round/d' /neural-compressor/test/3x/torch/requirements.txt
11+
cat /neural-compressor/test/3x/torch/requirements.txt
1012
pip install -r /neural-compressor/test/3x/torch/requirements.txt
1113
pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.16.0
1214
pip install pytest-cov

neural_compressor/torch/algorithms/fp8_quant/_core/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def update_mod_dict(config):
3131
def print_init_info(config):
3232
import importlib.metadata
3333

34-
versionStr = importlib.metadata.version("neural_compressor_3x_pt")
34+
versionStr = importlib.metadata.version("neural_compressor_pt")
3535
locationStr = versionStr.find("git") + 3
36-
logger.info("neural_compressor_3x_pt Git revision = %s", versionStr[locationStr:])
37-
logger.info("neural_compressor_3x_pt Configuration = %s", config)
36+
logger.info("neural_compressor_pt Git revision = %s", versionStr[locationStr:])
37+
logger.info("neural_compressor_pt Configuration = %s", config)
3838

3939

4040
def is_substr(substr_list, target):

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def get_build_version():
6060
},
6161
},
6262
# 3.x pt binary build config, pip install neural-compressor-pt, install 3.x PyTorch API.
63-
"neural_compressor_3x_pt": {
64-
"project_name": "neural_compressor_3x_pt",
63+
"neural_compressor_pt": {
64+
"project_name": "neural_compressor_pt",
6565
"include_packages": find_packages(
6666
include=[
6767
"neural_compressor.common",
@@ -73,8 +73,8 @@ def get_build_version():
7373
"install_requires": fetch_requirements("requirements_pt.txt"),
7474
},
7575
# 3.x tf binary build config, pip install neural-compressor-tf, install 3.x TensorFlow API.
76-
"neural_compressor_3x_tf": {
77-
"project_name": "neural_compressor_3x_tf",
76+
"neural_compressor_tf": {
77+
"project_name": "neural_compressor_tf",
7878
"include_packages": find_packages(
7979
include=[
8080
"neural_compressor.common",
@@ -100,11 +100,11 @@ def get_build_version():
100100

101101
if "pt" in sys.argv:
102102
sys.argv.remove("pt")
103-
cfg_key = "neural_compressor_3x_pt"
103+
cfg_key = "neural_compressor_pt"
104104

105105
if "tf" in sys.argv:
106106
sys.argv.remove("tf")
107-
cfg_key = "neural_compressor_3x_tf"
107+
cfg_key = "neural_compressor_tf"
108108

109109
if bool(os.getenv("USE_FP8_CONVERT", False)):
110110
from torch.utils.cpp_extension import BuildExtension, CppExtension

0 commit comments

Comments
 (0)