-
Notifications
You must be signed in to change notification settings - Fork 758
[iree][codegen] Add #iree_codegen.denormal_fp_math
to set denormals behavior
#21840
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
Conversation
7b72b8f
to
3ba9548
Compare
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.
Having this attribute at the level of an executable target makes sense to me but I wonder if we may end up requiring a finer granularity in the future
(This is a non-blocking review, I need to think about this more...)
@benvanik do you want to give this a quick look? |
I talked with @Groverkss about this, as he expressed similar concerns. We definitely need a finer-grained mechanism that has the info per dispatch. However, having a global value is still useful, as any dispatches without a more specialized value can use the global. I'd also argue that the current mechanism around target attributes, flags, ..., is not very extensible. It likely should be revisited, and we should likely consider using the work Renato and Rolf are doing. |
9d86531
to
a30060e
Compare
I'd also like to flag that fp16 and fp64 denormal handling is a separate flag ... but also, in many cases, the same flag |
62ec342
to
b905bf4
Compare
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.td
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/test/ROCDL/annotate_kernel_for_translation.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/test/ROCDL/annotate_kernel_for_translation.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/test/ROCDL/annotate_kernel_for_translation.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/test/ROCDL/annotate_kernel_for_translation.mlir
Outdated
Show resolved
Hide resolved
f2c1a2b
to
b300b28
Compare
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 but please wait for a review from Ben before merging
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.
Just a couple comments about naming and code location, otherwise LGTM. Thanks for making it work in IR and not just behind a flag!
Signed-off-by: Fabian Mora <[email protected]>
Signed-off-by: Fabian Mora <[email protected]>
Signed-off-by: Fabian Mora <[email protected]>
Signed-off-by: Fabian Mora <[email protected]>
b300b28
to
7e9c900
Compare
Signed-off-by: Fabian Mora <[email protected]>
7e9c900
to
6b1629d
Compare
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 the flag added here for testing purpose? This is going to flush all the denormals right? I thought the point was that we only do this for dispatches that we know this is OK to do?
This is to have a fallback option to set a default value, similar to global behavior flags in |
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.
This looks fine to me. Thanks!
Adds support for configuring denormal floating point math mode for f32 operations
on AMD GPUs. This includes:
I based the options on https://llvm.org/doxygen/structllvm_1_1DenormalMode.html#a29b26e3ae30f3f6ec4106ff181282893