Closed HPUedCSLearner closed 5 months ago
You need to pass props.enable_profiling(True)
to compile_model
Profiling is not enabled by default, because on some devices it costs total inference time. Hence, should be explicitly enabled only during development phase.
Thank you very much for your answer, but I tried it in Python and it still doesn't work. Maybe I set it wrong. Can you give detailed instructions or codes on how to set this property in Python or how to set it in C++?
Hello @HPUedCSLearner,
Try to set properties in your Python code like this:
import openvino as ov
from openvino import properties as props
comp_model = ov.compile_model(model, config={props.enable_profiling : True, props.hint.performance_mode: props.hint.PerformanceMode.THROUGHPUT})
Also please check this document. There is described how to set properties in both C++ and Python applications.
Thanks a lot,I got it
CPU Time (ms): 0.00100000
Layer: Broadcast_73907
Status: Status.EXECUTED
Real Time (ms): 0.00200000
CPU Time (ms): 0.00200000
Layer: __module.model/prim::ListConstruct/Concat_2
Status: Status.NOT_RUN
Real Time (ms): 0.00000000
CPU Time (ms): 0.00000000
Layer: __module.model/aten::zeros/Broadcast
Status: Status.EXECUTED
Real Time (ms): 0.00100000
CPU Time (ms): 0.00100000
Layer: __module.model/aten::cat/Concat
Status: Status.EXECUTED
Real Time (ms): 0.00200000
CPU Time (ms): 0.00200000
Layer: ShapeOf_79614
Status: Status.NOT_RUN
Real Time (ms): 0.00000000
CPU Time (ms): 0.00000000
Layer: __module.model/aten::ones_like/Broadcast
Status: Status.EXECUTED
Real Time (ms): 0.00200000
CPU Time (ms): 0.00200000
Layer: __module.model/aten::add/Add_2
OpenVINO Version
openvino24.1
Operating System
Ubuntu 20.04 (LTS)
Device used for inference
CPU
Framework
None
Model used
LLM : qwen
Issue description
I want to get the execution time of operators when LLM uses OpenVINO for inference on the CPU, just like a Pytorch proifler, but the values I get are all zero. Am I doing something wrong?
Step-by-step reproduction
code code:
run.log
Relevant log output
Issue submission checklist