feat(op): add hlo_fft for forward/inverse Fourier transforms#160
Open
sebffischer wants to merge 1 commit into
Open
feat(op): add hlo_fft for forward/inverse Fourier transforms#160sebffischer wants to merge 1 commit into
sebffischer wants to merge 1 commit into
Conversation
Implements stablehlo.fft per SPEC.md, supporting all four variants (FFT, IFFT, RFFT, IRFFT) with full constraint checking (C1-C5). Re-exports ComplexType from tengen so users can refer to complex<f32> (c64) and complex<f64> (c128) tensors. Depends on the matching ComplexType addition in tengen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
hlo_fft()implementing the StableHLOfftop per SPEC.md for all four variants:FFT,IFFT,RFFT,IRFFT.infer_types_fft()) covers all spec constraints C1–C5, with each check annotated.repr.OpFftemitsfft_type = #stablehlo<fft_type X>andfft_length = array<i64: …>.ComplexType()from tengen and addsrepr.ComplexType→complex<f32>/complex<f64>.Depends on r-xla/tengen#5 (adds
ComplexTypeto tengen).Test plan
testthat::test_file("tests/testthat/test-op-fft.R")— 21 passed, 0 failures.testthat::test_local(".")) — 931 passed, 0 failures, 0 warnings.Notes
Direct execution of variants returning a complex buffer works in PJRT but R-side has no complex dtype yet, so those tests are limited to IR snapshots.
🤖 Generated with Claude Code