-
Notifications
You must be signed in to change notification settings - Fork 3k
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] Building with NDEBUG on Linux and Mac drastically reduces performance #18098
Comments
Why do you need to override the flags? My guess is doing this is preventing the other flags, like the optimization settings (-O3) causing your build to be unoptimized. Try this to see if it makes a difference. Note: There are other optimization flags this is leaving out.
|
@RyanUnderhill setting |
Did my suggestion not have any perf difference? Edit: To be clear, I agree with your reasoning on having NDEBUG, I just think it's removing the other optimization flags when you set it this way. |
@RyanUnderhill by forcing |
@matteosal Ah, then that's what's happening. Your cmake defines are replacing the regular define vs just appending to it. Is NDEBUG not defined in the C++ when you build with an optimized build like `-config RelWithDebInfo'? |
@RyanUnderhill But anyway, if passing |
Yeah, I didn't know that was possible to override the flags like that. Since the cmake script is where you want to be working with the flags. Seems like a feature that would mostly break things than help things. I'll close this issue. |
Describe the issue
I'm providing a standalone C program which imports a yolov4 model, runs it with the default execution provider and measures the evaluation timing. When ORT is built without the
NDEBUG
flag I get around 200ms, withNDEBUG
timings increase to around 850ms. The slowdown is not specific to this model, I see an increase from 4x to 10x across several models. This happens on Linux and Mac (both pre and post ARM switch), while on Windows timings are always on the fast side regardless of the flag (similar timings as Linux with noNDEBUG
flag on the same machine). I'm using ORT commit baeece4 (v1.15.1 release tag).To reproduce
Program:
Program build on Linux (need to set set
ort_dir
):ORT build with
NDEBUG
flags (need to setoutput_dir
andort_source_dir
):Urgency
No response
Platform
Other / Unknown
OS Version
Ubuntu 20.04, MacOSX 13.2.1 (x86), MacOSX 14.0 (ARM)
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
baeece4
ONNX Runtime API
C
Architecture
Other / Unknown
Execution Provider
Default CPU
Execution Provider Library Version
No response
Model File
https://drive.google.com/file/d/1BHGz-ugkMV0Yc0_TdCBsHFwIWqUdjBId/view?usp=sharing
Is this a quantized model?
No
The text was updated successfully, but these errors were encountered: