@@ -3,8 +3,14 @@ python -c "import neural_compressor as nc"
3
3
test_case=" run 3x Torch Habana FP8"
4
4
echo " ${test_case} "
5
5
6
+ echo " ##[section]Run import check"
7
+ set -e
8
+ python -c " import neural_compressor.torch"
9
+ python -c " import neural_compressor.common"
10
+ echo " ##[section]import check pass"
11
+
6
12
# install requirements
7
- echo " set up UT env..."
13
+ echo " ##[group] set up UT env..."
8
14
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
9
15
sed -i ' /^intel_extension_for_pytorch/d' /neural-compressor/test/3x/torch/requirements.txt
10
16
sed -i ' /^auto_round/d' /neural-compressor/test/3x/torch/requirements.txt
@@ -13,6 +19,7 @@ pip install -r /neural-compressor/test/3x/torch/requirements.txt
13
19
pip install pytest-cov
14
20
pip install pytest-html
15
21
pip install pytest-html-merger
22
+ echo " ##[endgroup]"
16
23
pip list
17
24
18
25
export COVERAGE_RCFILE=/neural-compressor/.azure-pipelines/scripts/ut/3x/coverage.3x_pt_fp8
@@ -28,6 +35,18 @@ pytest --cov="${inc_path}" -vs --disable-warnings --html=report_2.html --self-co
28
35
pytest --cov=" ${inc_path} " -vs --disable-warnings --html=report_4.html --self-contained-html torch/quantization/fp8_quant 2>&1 | tee -a ${ut_log_name}
29
36
pytest --cov=" ${inc_path} " -vs --disable-warnings --html=report_5.html --self-contained-html torch/algorithms/fp8_quant 2>&1 | tee -a ${ut_log_name}
30
37
38
+ # Below folder contains some special configuration for pytest so we need to enter the path and run it separately
39
+ cd /neural-compressor/test/3x/torch/algorithms/fp8_quant
40
+ pytest --cov=" ${inc_path} " -vs --disable-warnings --html=report_4.html --self-contained-html . 2>&1 | tee -a ${ut_log_name}
41
+ cp .coverage ${LOG_DIR} /.coverage.algo_fp8
42
+ cd - && mv /neural-compressor/test/3x/torch/algorithms/fp8_quant/* .html .
43
+
44
+ # Below folder contains some special configuration for pytest so we need to enter the path and run it separately
45
+ cd /neural-compressor/test/3x/torch/quantization/fp8_quant
46
+ pytest --cov=" ${inc_path} " -vs --disable-warnings --html=report_5.html --self-contained-html . 2>&1 | tee -a ${ut_log_name}
47
+ cp .coverage ${LOG_DIR} /.coverage.quant_fp8
48
+ cd - && mv /neural-compressor/test/3x/torch/quantization/fp8_quant/* .html .
49
+
31
50
mkdir -p report && mv * .html report
32
51
pytest_html_merger -i ./report -o ./report.html
33
52
cp report.html ${LOG_DIR} /
40
59
41
60
# if ut pass, collect the coverage file into artifacts
42
61
cp .coverage ${LOG_DIR} /.coverage
62
+ cd ${LOG_DIR}
63
+ coverage combine .coverage.*
43
64
44
65
echo " UT finished successfully! "
0 commit comments