microsoft / microsoft/onnxruntime-inference-examples

Some questions about profile

Open
#501 1 comment 0 reactions 0 assignees View on GitHub

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:

Image

I have two questions here:

  1. why the first conv cost so much? Is the time of loading data from host to device included?
  2. 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?

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.