Skip to content

Commit 18315e0

Browse files
author
tylertitsworth
committed
update inc test
Signed-off-by: tylertitsworth <tyler.titsworth@intel.com>
1 parent a885c23 commit 18315e0

File tree

2 files changed

+58
-51
lines changed

2 files changed

+58
-51
lines changed

tensorflow/tests/inc_test.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@
1515
# limitations under the License.
1616

1717
# Prepare dataset
18+
rm -rf neural-compressor || true
1819
git clone https://github.com/intel/neural-compressor.git
19-
cd neural-compressor/examples/tensorflow/nlp/bert_large_squad/quantization/ptq || exit
20+
cd neural-compressor/examples/tensorflow/nlp/bert_large_squad/quantization/ptq || exit 1
2021

21-
echo "Preparing the model"
22-
bash prepare_model.sh --output_dir=./model 2>&1
2322
echo "Preparing the dataset"
24-
bash prepare_dataset.sh --output_dir=./data 2>&1
23+
bash prepare_dataset.sh --output_dir="$PWD"/data
24+
2525
# Preprocess the dataset
2626
echo "Preprocessing the dataset"
2727
python create_tf_record.py --vocab_file=data/vocab.txt --predict_file=data/dev-v1.1.json --output_file=./eval.tf_record
2828

29+
echo "Preparing the model"
30+
bash prepare_model.sh --output_dir="$PWD"/model
31+
2932
# Run quantization using INC
3033
echo "Running quantization"
3134
bash run_quant.sh --input_model=./bert_fp32.pb --output_model=./bert_int8.pb --dataset_location=./eval.tf_record
35+
36+
cd - || exit 1
37+
rm -rf neural-compressor || true

tensorflow/tests/tests.yaml

+48-47
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,57 @@
1313
# limitations under the License.
1414

1515
---
16-
import-itex-cpu-${PACKAGE_OPTION:-pip}:
17-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-base
18-
cmd: python -c "from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())"
19-
import-itex-xpu-${PACKAGE_OPTION:-pip}:
20-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-base
21-
cmd: python /tests/xpu_import_test.py
22-
device: ["/dev/dri"]
23-
volumes:
24-
- src: ${PWD}/tensorflow/tests
25-
dst: /tests
26-
import-cpu-jupyter-${PACKAGE_OPTION:-pip}:
27-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-jupyter
28-
cmd: python -m jupyter --version
29-
import-xpu-jupyter-${PACKAGE_OPTION:-pip}:
30-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-jupyter
31-
cmd: python -m jupyter --version
32-
device: ["/dev/dri"]
33-
import-multinode-${PACKAGE_OPTION:-pip}:
34-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
35-
cmd: horovodrun --check-build && mpirun --version && python -c 'import horovod.tensorflow as hvd;hvd.init();import horovod.tensorflow'
36-
import-inc-${PACKAGE_OPTION:-pip}:
37-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
38-
cmd: python -c "import neural_compressor as inc;print(inc.__version__)"
39-
itex-cpu-${PACKAGE_OPTION:-pip}:
40-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-base
41-
cmd: python /tests/tf_base_test.py
42-
volumes:
43-
- src: ${PWD}/tensorflow/tests
44-
dst: /tests
45-
itex-xpu-${PACKAGE_OPTION:-pip}:
46-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-base
47-
cmd: python /tests/tf_base_test.py
48-
device: ["/dev/dri"]
49-
volumes:
50-
- dst: /tests
51-
src: $PWD/tensorflow/tests
52-
itex-xpu-jupyter-${PACKAGE_OPTION:-pip}:
53-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-jupyter
54-
cmd: papermill --log-output /jupyter/xpu.ipynb -k python3 -
55-
notebook: True
56-
device: ["/dev/dri"]
57-
multinode-${PACKAGE_OPTION:-pip}:
58-
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
59-
cmd: horovodrun -np 2 -H localhost:2 --binding-args="-bind-to socket -map-by socket" python /tests/tf_base_test.py
60-
volumes:
61-
- dst: /tests
62-
src: $PWD/tensorflow/tests
16+
# import-itex-cpu-${PACKAGE_OPTION:-pip}:
17+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-base
18+
# cmd: python -c "from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())"
19+
# import-itex-xpu-${PACKAGE_OPTION:-pip}:
20+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-base
21+
# cmd: python /tests/xpu_import_test.py
22+
# device: ["/dev/dri"]
23+
# volumes:
24+
# - src: ${PWD}/tensorflow/tests
25+
# dst: /tests
26+
# import-cpu-jupyter-${PACKAGE_OPTION:-pip}:
27+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-jupyter
28+
# cmd: python -m jupyter --version
29+
# import-xpu-jupyter-${PACKAGE_OPTION:-pip}:
30+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-jupyter
31+
# cmd: python -m jupyter --version
32+
# device: ["/dev/dri"]
33+
# import-multinode-${PACKAGE_OPTION:-pip}:
34+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
35+
# cmd: horovodrun --check-build && mpirun --version && python -c 'import horovod.tensorflow as hvd;hvd.init();import horovod.tensorflow'
36+
# import-inc-${PACKAGE_OPTION:-pip}:
37+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
38+
# cmd: python -c "import neural_compressor as inc;print(inc.__version__)"
39+
# itex-cpu-${PACKAGE_OPTION:-pip}:
40+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-base
41+
# cmd: python /tests/tf_base_test.py
42+
# volumes:
43+
# - src: ${PWD}/tensorflow/tests
44+
# dst: /tests
45+
# itex-xpu-${PACKAGE_OPTION:-pip}:
46+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-base
47+
# cmd: python /tests/tf_base_test.py
48+
# device: ["/dev/dri"]
49+
# volumes:
50+
# - dst: /tests
51+
# src: $PWD/tensorflow/tests
52+
# itex-xpu-jupyter-${PACKAGE_OPTION:-pip}:
53+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-itex-${TF_VERSION:-2.15.1}-itex-xpu-jupyter
54+
# cmd: papermill --log-output /jupyter/xpu.ipynb -k python3 -
55+
# notebook: True
56+
# device: ["/dev/dri"]
57+
# multinode-${PACKAGE_OPTION:-pip}:
58+
# img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
59+
# cmd: horovodrun -np 2 -H localhost:2 --binding-args="-bind-to socket -map-by socket" python /tests/tf_base_test.py
60+
# volumes:
61+
# - dst: /tests
62+
# src: $PWD/tensorflow/tests
6363
inc-${PACKAGE_OPTION:-pip}:
6464
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-${TF_VERSION:-2.15.1}-horovod-${HOROVOD_VERSION:-0.28.1}-inc-${INC_VERSION:-3.0.2}
6565
cmd: bash /tests/inc_test.sh
66+
workdir: /tests
6667
volumes:
6768
- dst: /tests
6869
src: $PWD/tensorflow/tests

0 commit comments

Comments
 (0)