core/ops/fft: Fft pulsification on non-FFT axes + guards#2261
Open
JulienBalianSonos wants to merge 1 commit into
Open
core/ops/fft: Fft pulsification on non-FFT axes + guards#2261JulienBalianSonos wants to merge 1 commit into
JulienBalianSonos wants to merge 1 commit into
Conversation
Collaborator
|
Did you try just implementing axes_mapping ? Not that the propose implementation is incorrect. It can't be ::natural() the time axis and (and the complex axis) do not map. I think with the map right, there should not be any need for dedicated pulsification. |
b0f810d to
431b5cf
Compare
Collaborator
Author
|
@kali I tried to fix according to your remark to make it more principled. let me know |
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
Two commits on this branch.
1.
Fft::axes_mapping = natural.Fftis rank-preserving and 1-to-1 on every axis (only the values along the FFT axis change), so the generic per-pulse wrapper can handle streaming on any non-FFT axis onceaxes_mappingreports the 1-to-1 relationship. Without this, pulse-pass bails onNo specific pulse transformation for Fft, and could not track pulsing axis, which blocks STFT-based streaming becauseSTFTpulse-lowers to a streaming-axis frame loop with a per-frameFftrunning on a different axis (the frequency axis).2.
fft_pulsify: reject streaming on the FFT axis itself or on the trailing(re, imag)axis. The natural mapping would otherwise letPulseWrappingOphappily runFftper-pulse on the FFT axis. That's a coherent operation: it's equivalent toStft { frame: pulse_size, stride: pulse_size, axis }where the runtime pickspulse_size. But that is not the typed-model semantics the user wrote (Fft { axis }means "FFT every sample on that axis", which requires the axis length to be known and is undefined when the axis is symbolic). Silently reinterpreting it would be a foot-gun, so the pulsifier bails with a message that points users atStft { frame: N, stride: N }and asks them to pickNexplicitly. The complex-axis case is already rejected upstream inFft::output_facts(trailing dim must be 2); the test locks in that earlier-layer rejection.Edge-case sweep in
harness/core-proptest-pulse/src/fft.rs:df_opshape) smoke cases.Status
Originally opened with just commit 1, self-closed pending the edge-case work the comment thread called out. Re-opened now with commit 2 covering the guards and the wider test sweep.