-
Notifications
You must be signed in to change notification settings - Fork 744
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
[SYCL][ESIMD] Rework -O0 behavior #12612
Conversation
cdf0cb2
to
6c6c20a
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
Signed-off-by: Sarnie, Nick <[email protected]>
Linux Gen12 failure is not related, failing everywhere:
|
@@ -955,6 +955,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline( | |||
PB.registerPipelineStartEPCallback([&](ModulePassManager &MPM, | |||
OptimizationLevel Level) { | |||
MPM.addPass(ESIMDVerifierPass(LangOpts.SYCLESIMDForceStatelessMem)); | |||
if (Level == OptimizationLevel::O0) | |||
MPM.addPass(ESIMDRemoveOptnoneNoinlinePass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am okay with this ESIMD change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FE changes are okay with me.
@intel/dpcpp-esimd-reviewers @intel/dpcpp-tools-reviewers Ping, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Signed-off-by: Sarnie, Nick <[email protected]>
@@ -1834,6 +1834,15 @@ bool SYCLLowerESIMDPass::prepareForAlwaysInliner(Module &M) { | |||
continue; | |||
} | |||
|
|||
// If we are splitting by ESIMD, we are guarenteed the entire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code still needed after adding the special pass that remove those 2 attributes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tested many combinations of with/without different changes in this PR and everything we currently have is required.
Windows fail is not related |
Let me first say I don't like this change and I wish we didn't have to do this, and it should only be temporary.
The root need is that the IGC VC backend does not support O0 code. It gets miscompiled and produces wrong answers and crashes. The team acknowledges this issue but does not have the resources to fix this at the moment.
From the ESIMD user POV, this is really frustrating. We decided it would be okay if they lost debuggability of device code (but retained it for host code) as long as their program runs and they get the right answer.
So the overall approach is to optimize ESIMD(Not SYCL!!) code even in O0 mode. We are actually already doing this, but this change extends it a bit.
So there are a few main changes in this PR:
-O0
tosycl-post-link
. Note this option has absolutely no effect on SYCL code today, it is only checked in the ESIMD lowering code insycl-post-link
.optnone
/noinline
early for ESIMD code inO0
.optnone
/noinline
from all functions if we split out ESIMD/SYCL code, and if we don't don't touch it.All three of these steps are required to fix the tests failing with
O0
, if we remove any one of them we see many failures.When running all ESIMD tests with
O0
, we see the following improvements:Once IGC VC can actually correctly compile non-optimized code, we should revert this change.