[Benchmark]onnx-export
# 🖥 Benchmarking `transformers`

## Benchmark
I  follow 04-onnx-export.ipynb this guidance on CPU, and my CPU model is:
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
NUMA node0 CPU(s):     0-9,20-29
NUMA node1 CPU(s):     10-19,30-39
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities

## Set-up
I set the environment is:
export OMP_NUM_THREADS = 8
export OMP_WAIT_POLICY= 'ACTIVE'
then I run all the test program py taskset -c 0-7 python test_.py

## Results
when I finish the test program, I print all result,like this:
dict_keys(['PyTorch CPU', 'ONNX CPU', 'PyTorch CPU Quantized', 'ONNX CPU Quantized'])
dict_values([94.01082992553711, 96.25397443771362, 82.11332082748413, 71.06868505477905])
so, In my operation “PyTorch CPU”:“ONNX CPU Quantized" promote 1.32X
but in the guidance  “PyTorch CPU”:“ONNX CPU Quantized" promote 5.78X
Why didn't it increase so many times confused me?

Hi @jianqianzhou,

Thanks for raising this issue.

I would remove the `OMP_NUM_THREADS` environment variable to fully exploit all the cores/threads you have on your machine. Also, tests were run on a machine with 56 cores so it might impact final performances. 

Also, it might be possible to further optimize the model / quantized model through the ONNX Runtime optimizer tool.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.