Repository navigation
Add support for lowering mhlo.fft to Linalg. - #5450
Merged
Merged
Conversation
Contributor
Author
|
I'd like to add end-to-end testing later. It only works on Linalg on tensors, but current iree/test/e2e/*/BUILD is a bit messy. |
Contributor
Author
I think I was wrong, I probably can add the e2e test. |
Contributor
Author
|
This is really weird, I can't fix the tests. I hacked into printf representation, and got something weird. They look identical to me. I even just copy-paste the result, and can still get some similar failures. |
Contributor
Author
|
oh, I'm so stupid >~< |
asaadaldien
reviewed
Apr 16, 2021
asaadaldien
reviewed
Apr 16, 2021
Only RFFT type is supported, which means the inputs are all real numbers. Since we do not handle complex numbers in IREE and mhlo.fft returns a complex number, we have to use mhlo.complex op to pack real part and imaginary part together. And rely on canonicalization patterns to fold it away. They will be folded away because we ran `PopulateComplexLoweringPatterns` in HLOToHLOPreprocessing pass, if there are complex number computation, mhlo.real/imag will be created. The implementation is not FFT algorithm. It follows DFT definition to support naive solution. See definition https://en.wikipedia.org/wiki/Discrete_Fourier_transform
asaadaldien
approved these changes
Apr 19, 2021
Merged
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.
Only RFFT type is supported, which means the inputs are all real
numbers. Since we do not handle complex numbers in IREE and mhlo.fft
returns a complex number, we have to use mhlo.complex op to pack real
part and imaginary part together. And rely on canonicalization patterns
to fold it away. They will be folded away because we ran
PopulateComplexLoweringPatternsin HLOToHLOPreprocessing pass, ifthere are complex number computation, mhlo.real/imag will be created.
The implementation is not FFT algorithm. It follows DFT definition to
support naive solution. See definition
https://en.wikipedia.org/wiki/Discrete_Fourier_transform
Fixes #5299