Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Performance] createSession() slow on release 1.15 and 1.17.1 as compare to 1.14 #19902

Open
sarojlo opened this issue Mar 13, 2024 · 7 comments
Labels
performance issues related to performance regressions platform:windows issues related to the Windows platform quantization issues related to quantization stale issues that have not been addressed in a while; categorized by a bot

Comments

@sarojlo
Copy link

sarojlo commented Mar 13, 2024

Describe the issue

Loading model using createSession is slower than v 1.14,, It took 779 ms to createSession in 1.14 while 1.15 need 1319ms

To reproduce

    m_ort = OrtGetApiBase()->GetApi(ORT_API_VERSION);
    m_ort->CreateEnv(ORT_LOGGING_LEVEL_WARNING, "XXXXX", &m_env);
    m_ort->CreateSessionOptions(&m_sessionOptions);
    m_ort->SetIntraOpNumThreads(m_sessionOptions, 1);
    m_ort->SetSessionGraphOptimizationLevel(m_sessionOptions, ORT_ENABLE_ALL);
    m_ort->SetSessionLogSeverityLevel(m_sessionOptions, 3);
   m_ort->CreateSession(m_env, model_file, m_sessionOptions, &m_session);

Urgency

No response

Platform

Windows

OS Version

WIndows 11

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.15.1

ONNX Runtime API

C

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Model File

No response

Is this a quantized model?

Yes

@github-actions github-actions bot added platform:windows issues related to the Windows platform quantization issues related to quantization labels Mar 13, 2024
@hariharans29
Copy link
Member

Can you please define "slow" with numbers before and after ?

@pranavsharma
Copy link
Contributor

pranavsharma commented Mar 14, 2024

The easiest thing to do would be to disable all optimizers and compare. This would rule out the optimizers at least.

[For ORT team] As an aside I think it'll be really great if ORT printed which optimizers ran during session initialization. Then one can easily compare between different vers if more optimizers ran for the same model as a data point or which didn't.

@hariharans29
Copy link
Member

The easiest thing to do would be to disable all optimizers and compare. This would rule out the optimizers at least.

[For ORT team] As an aside I think it'll be really great if ORT printed which optimizers ran during session initialization. Then one can easily compare between different vers if more optimizers ran for the same model as a data point or which didn't.

Isn't that info already available:

LOGS(logger, INFO) << "GraphTransformer " << Name() << " modified: " << modified << " with status: " << status;
?

@sarojlo
Copy link
Author

sarojlo commented Mar 14, 2024

Do you want me to run experiment with m_ort->SetSessionGraphOptimizationLevel(m_sessionOptions, ORT_DISABLE_ALL)? and share the performance profile json?

@hariharans29
Copy link
Member

hariharans29 commented Mar 14, 2024

Do you want me to run experiment with m_ort->SetSessionGraphOptimizationLevel(m_sessionOptions, ORT_DISABLE_ALL)? and share the performance profile json?

You can try doing that. You can also try enabling INFO level logs to enable the logs I pasted above to see the diff.

Btw - what is the impact of this ? I know session creation time has nearly doubled, but unless you have a scenario where you need to create many sessions, the impact can't be significant ?

@sophies927 sophies927 added the performance issues related to performance regressions label Mar 14, 2024
@cbourjau
Copy link
Contributor

I didn't create this issue, but session creation time is important to us, too. We use onnxruntime for on-the-fly constant folding in Spox and higher-level in-house solutions. We want to push our tooling to a point were we can deliver a similar interactive UX as NumPy and Pandas.

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance issues related to performance regressions platform:windows issues related to the Windows platform quantization issues related to quantization stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

5 participants