microsoft / microsoft/onnxruntime-inference-examples
Some questions about profile
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 414
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 14
Description
when I run the code like this:
options = onnxruntime.SessionOptions()
options.enable_profiling=True
session = onnxruntime.InferenceSession(model_path, providers=providers, sess_options=options)
session.run_with_iobinding(io_binding)
profile_file = session.end_profiling()
I got a json profile file, and visualize it with edge://tracing/, got the result as follows:
I have two questions here:
- why the first conv cost so much? Is the time of loading data from host to device included?
- except the first conv, add the latency of other ops, the result is significantly greater than the time I got in my time test code below. So how can I get the exact run time of every single op?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Python profiling sequence using SessionOptions, InferenceSession, run_with_iobinding, and end_profiling, then compare the generated profile in edge://tracing/ with the separate timing code. Review ONNX Runtime profiling documentation or examples to determine what each event includes and what measurement represents per-operator runtime. Done means documenting answers to both timing questions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, performance
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100