remove ipex_optimize_model usage (#38632)
* remove ipex_optimize_model usage Signed-off-by: YAO Matrix <matrix.yao@intel.com> * update Dockerfile Signed-off-by: root <root@a4bf01945cfe.jf.intel.com> --------- Signed-off-by: YAO Matrix <matrix.yao@intel.com> Signed-off-by: root <root@a4bf01945cfe.jf.intel.com> Co-authored-by: root <root@a4bf01945cfe.jf.intel.com>
This commit is contained in:
@@ -78,26 +78,3 @@ python examples/pytorch/question-answering/run_qa.py \
|
||||
--no_cuda \
|
||||
--jit_mode_eval
|
||||
```
|
||||
|
||||
## IPEX
|
||||
|
||||
[Intel Extension for PyTorch](https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/getting_started.html) (IPEX) offers additional optimizations for PyTorch on Intel CPUs. IPEX further optimizes TorchScript with [graph optimization](https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/features/graph_optimization.html) which fuses operations like Multi-head attention, Concat Linear, Linear + Add, Linear + Gelu, Add + LayerNorm, and more, into single kernels for faster execution.
|
||||
|
||||
Make sure IPEX is installed, and set the `--use_opex` and `--jit_mode_eval` flags in [`Trainer`] to enable IPEX graph optimization and TorchScript.
|
||||
|
||||
```bash
|
||||
!pip install intel_extension_for_pytorch
|
||||
```
|
||||
|
||||
```bash
|
||||
python examples/pytorch/question-answering/run_qa.py \
|
||||
--model_name_or_path csarron/bert-base-uncased-squad-v1 \
|
||||
--dataset_name squad \
|
||||
--do_eval \
|
||||
--max_seq_length 384 \
|
||||
--doc_stride 128 \
|
||||
--output_dir /tmp/ \
|
||||
--no_cuda \
|
||||
--use_ipex \
|
||||
--jit_mode_eval
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user