Repository navigation
[spirv] Add fast math support for WebGPU - #10352
Merged
Merged
Conversation
This exposes a control when building the SPIR-V CodeGen pipeline to allow enabling fast math mode, which will let patterns to assume no NaN/infinity floating point values. This matches the behavoir of WebGPU.
antiagainst
requested review from
MaheshRavishankar and
benvanik
as code owners
September 9, 2022 19:04
antiagainst
marked this pull request as draft
September 9, 2022 19:05
| /// GPU processor ID ops into SPIR-V global variables, loop/standard ops into | ||
| /// corresponding SPIR-V ops. | ||
| std::unique_ptr<OperationPass<ModuleOp>> createConvertToSPIRVPass(); | ||
| std::unique_ptr<OperationPass<ModuleOp>> createConvertToSPIRVPass( |
Collaborator
There was a problem hiding this comment.
Wondering if we want to wait for this to be in IREE llvm/llvm-project@67d0d7a .
I dont know the details, but is related to this issue llvm/llvm-project#53145 . That might allow using the MLIR pass options and auto-generated create methods....
Member
Author
There was a problem hiding this comment.
That seems to be orthogonal infra changes to this. We can convert everything after that landed.
ScottTodd
reviewed
Sep 12, 2022
|
|
||
| void buildTranslationPassPipeline(OpPassManager &passManager) override { | ||
| buildSPIRVCodegenPassPipeline(passManager); | ||
| buildSPIRVCodegenPassPipeline(passManager, /*enableFastMath=*/true); |
Member
There was a problem hiding this comment.
Can you add a comment here with some context for why WebGPU wants fast math? You could link to #10142, some gpuweb issues, and/or the webgpu spec.
Member
Author
There was a problem hiding this comment.
Yup, added comments there.
antiagainst
marked this pull request as ready for review
September 12, 2022 22:21
antiagainst
enabled auto-merge (squash)
September 12, 2022 22:22
ScottTodd
approved these changes
Sep 13, 2022
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This exposes a control when building the SPIR-V CodeGen pipeline to allow enabling fast math mode, which will let patterns to assume no NaN/infinity floating point values. This matches the behavoir of WebGPU.