|
| 1 | +# Wide & Deep |
| 2 | + |
| 3 | +This document has instructions for how to run Wide & Deep benchmark for the |
| 4 | +following modes/precisions: |
| 5 | + |
| 6 | +* [INT8 inference](#int8-inference-instructions) |
| 7 | +* [FP32 inference](#fp32-inference-instructions) |
| 8 | + |
| 9 | +Benchmarking instructions and scripts for model training coming later. |
| 10 | + |
| 11 | +## INT8 Inference Instructions |
| 12 | + |
| 13 | + |
| 14 | +1. Download large <> dataset income dataset from <>: |
| 15 | + |
| 16 | + To be updated post dataset approval |
| 17 | + |
| 18 | +2. Pre-process the downloaded dataset to tfrecords using [preprocess_csv_tfrecords.py](/models/recommendation/tensorflow/wide_deep_large_ds/dataset/preprocess_csv_tfrecords.py) |
| 19 | + |
| 20 | + ``` |
| 21 | + $ python3.6 preprocess_csv_tfrecords.py --csv-datafile eval.csv |
| 22 | + ``` |
| 23 | + |
| 24 | +3. Clone the [intelai/models](https://github.com/intelai/models) repo. |
| 25 | +
|
| 26 | + This repo has the launch script for running benchmarks, which we will |
| 27 | + use in the next step. |
| 28 | +
|
| 29 | + ``` |
| 30 | + $ git clone https://github.com/IntelAI/models.git |
| 31 | + ``` |
| 32 | +4. How to run benchmarks |
| 33 | +
|
| 34 | + * Running benchmarks in latency mode, set `--batch-size 1` |
| 35 | + ``` |
| 36 | + $ cd /home/myuser/models/benchmarks |
| 37 | +
|
| 38 | + $ python launch_benchmark.py |
| 39 | + --model-name wide_deep_large_ds \ |
| 40 | + --precision int8 \ |
| 41 | + --mode inference \ |
| 42 | + --framework tensorflow \ |
| 43 | + --benchmark-only \ |
| 44 | + --batch-size 1 \ |
| 45 | + --socket-id 0 \ |
| 46 | + --docker-image tensorflow/tensorflow:latest-mkl \ |
| 47 | + --in-graph /root/user/wide_deep_files/int8_wide_deep_final.pb \ |
| 48 | + --data-location /root/user/wide_deep_files/preprocessed_eval.tfrecords |
| 49 | + ``` |
| 50 | + * Running benchmarks in throughput mode, set `--batch-size 1024` |
| 51 | + ``` |
| 52 | + $ cd /home/myuser/models/benchmarks |
| 53 | + |
| 54 | + $ python launch_benchmark.py |
| 55 | + --model-name wide_deep_large_ds \ |
| 56 | + --precision int8 \ |
| 57 | + --mode inference \ |
| 58 | + --framework tensorflow \ |
| 59 | + --benchmark-only \ |
| 60 | + --batch-size 1024 \ |
| 61 | + --socket-id 0 \ |
| 62 | + --docker-image tensorflow/tensorflow:latest-mkl \ |
| 63 | + --in-graph /root/user/wide_deep_files/int8_wide_deep_final.pb \ |
| 64 | + --data-location /root/user/wide_deep_files/preprocessed_eval.tfrecords |
| 65 | + ``` |
| 66 | +6. The log file is saved to the value of `--output-dir`. |
| 67 | +
|
| 68 | + The tail of the log output when the benchmarking completes should look |
| 69 | + something like this: |
| 70 | +
|
| 71 | + ``` |
| 72 | + |
| 73 | + -------------------------------------------------- |
| 74 | + Total test records : 2000000 |
| 75 | + No of correct predicitons : 1549508 |
| 76 | + Batch size is : 1024 |
| 77 | + Number of batches : 1954 |
| 78 | + Classification accuracy (%) : 77.4754 |
| 79 | + Inference duration (seconds) : 1.9765 |
| 80 | + Latency (millisecond/batch) : 0.000988 |
| 81 | + Throughput is (records/sec) : 1151892.25 |
| 82 | + -------------------------------------------------- |
| 83 | + numactl --cpunodebind=0 --membind=0 python /workspace/intelai_models/int8/inference.py --input-graph=/in_graph/int8_wide_deep_final.pb --inter-op-parallelism-threads=28 --intra-op-parallelism-threads=1 --omp-num-threads=1 --batch-size=1024 --kmp-blocktime=0 --datafile-path=/dataset |
| 84 | + Ran inference with batch size 1024 |
| 85 | + Log location outside container: {--output-dir value}/benchmark_wide_deep_large_ds_inference_int8_20190225_061815.log |
| 86 | + ``` |
| 87 | +
|
| 88 | +## FP32 Inference Instructions |
| 89 | +
|
| 90 | +1. Download large <> dataset income dataset from <>: |
| 91 | + |
| 92 | + To be updated post dataset approval |
| 93 | + |
| 94 | +2. Pre-process the downloaded dataset to tfrecords using [preprocess_csv_tfrecords.py](../../../../models/recommendation/tensorflow/wide_deep_large_ds/dataset/preprocess_csv_tfrecords.py) |
| 95 | + |
| 96 | + ``` |
| 97 | + $ python3.6 preprocess_csv_tfrecords.py --csv-datafile eval.csv |
| 98 | + ``` |
| 99 | +3. Clone the [intelai/models](https://github.com/intelai/models) repo. |
| 100 | +
|
| 101 | + This repo has the launch script for running benchmarks, which we will |
| 102 | + use in the next step. |
| 103 | +
|
| 104 | + ``` |
| 105 | + $ git clone https://github.com/IntelAI/models.git |
| 106 | + ``` |
| 107 | +4. How to run benchmarks |
| 108 | +
|
| 109 | + * Running benchmarks in latency mode, set `--batch-size 1` |
| 110 | + ``` |
| 111 | + $ cd /home/myuser/models/benchmarks |
| 112 | +
|
| 113 | + $ python launch_benchmark.py |
| 114 | + --model-name wide_deep_large_ds \ |
| 115 | + --precision fp32 \ |
| 116 | + --mode inference \ |
| 117 | + --framework tensorflow \ |
| 118 | + --benchmark-only \ |
| 119 | + --batch-size 1 \ |
| 120 | + --socket-id 0 \ |
| 121 | + --docker-image tensorflow/tensorflow:latest-mkl \ |
| 122 | + --in-graph /root/user/wide_deep_files/fp32_wide_deep_final.pb \ |
| 123 | + --data-location /root/user/wide_deep_files/preprocessed_eval.tfrecords |
| 124 | + ``` |
| 125 | + * Running benchmarks in throughput mode, set `--batch-size 1024` |
| 126 | + ``` |
| 127 | + $ cd /home/myuser/models/benchmarks |
| 128 | + |
| 129 | + $ python launch_benchmark.py |
| 130 | + --model-name wide_deep_large_ds \ |
| 131 | + --precision fp32 \ |
| 132 | + --mode inference \ |
| 133 | + --framework tensorflow \ |
| 134 | + --benchmark-only \ |
| 135 | + --batch-size 1024 \ |
| 136 | + --socket-id 0 \ |
| 137 | + --docker-image tensorflow/tensorflow:latest-mkl \ |
| 138 | + --in-graph /root/user/wide_deep_files/fp32_wide_deep_final.pb \ |
| 139 | + --data-location /root/user/wide_deep_files/preprocessed_eval.tfrecords |
| 140 | + ``` |
| 141 | +6. The log file is saved to the value of `--output-dir`. |
| 142 | +
|
| 143 | + The tail of the log output when the benchmarking completes should look |
| 144 | + something like this: |
| 145 | +
|
| 146 | + ``` |
| 147 | +
|
| 148 | + -------------------------------------------------- |
| 149 | + Total test records : 2000000 |
| 150 | + No of correct predicitons : 1550447 |
| 151 | + Batch size is : 1024 |
| 152 | + Number of batches : 1954 |
| 153 | + Classification accuracy (%) : 77.5223 |
| 154 | + Inference duration (seconds) : 3.4977 |
| 155 | + Latency (millisecond/batch) : 0.001749 |
| 156 | + Throughput is (records/sec) : 571802.228 |
| 157 | + -------------------------------------------------- |
| 158 | + numactl --cpunodebind=0 --membind=0 python /workspace/intelai_models/int8/inference.py --input-graph=/in_graph/fp32_wide_deep_final.pb --inter-op-parallelism-threads=28 --intra-op-parallelism-threads=1 --omp-num-threads=1 --batch-size=1024 --kmp-blocktime=0 --datafile-path=/dataset |
| 159 | + Ran inference with batch size 1024 |
| 160 | + Log location outside container: {--output-dir value}/benchmark_wide_deep_large_ds_inference_fp32_20190225_062206.log |
| 161 | + |
| 162 | + ``` |
0 commit comments