build(deps): enable rustfft wasm_simd feature#684
Open
czoli1976 wants to merge 1 commit intoRikorose:mainfrom
Open
build(deps): enable rustfft wasm_simd feature#684czoli1976 wants to merge 1 commit intoRikorose:mainfrom
wasm_simd feature#684czoli1976 wants to merge 1 commit intoRikorose:mainfrom
Conversation
`wasm_simd` is cfg-gated inside rustfft to wasm32 + the feature flag, so it's a no-op on non-wasm targets — safe to enable unconditionally for the cdylib/staticlib/native bin matrix. On `wasm32-unknown-unknown` with `+simd128`, this lets rustfft's auto-planner pick `FftPlannerWasmSimd` instead of falling back to the scalar planner. STFT/iSTFT in DFN3 then use v128 butterflies. Net effect on DFN3 streaming RTF: within noise (Chromium 0.066 -> 0.066, both same-machine back-to-back). The FFT sizes used by DFN3 (480 / 960 mixed-radix) don't materially benefit, but the feature is bit-exact, zero-risk, and helpful to other downstream rustfft consumers (apps with larger or power-of-2 FFT sizes). Wasm size cost: +400 KB compressed.
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
Adds the
wasm_simdfeature to therustfftdependency inlibDF/Cargo.toml.Why
wasm_simdiscfg-gated inside rustfft totarget_arch = "wasm32"+ the feature flag, so enabling it unconditionally is a no-op on every non-wasm target — safe for the cdylib / staticlib / native bin matrix. Native builds are byte-identical.On
wasm32-unknown-unknownwith+simd128, this lets rustfft's auto-planner pickFftPlannerWasmSimd(v128 butterflies) instead of falling back to the scalar planner.Caveats
Opening this anyway because it's bit-exact, zero-risk, and a sensible default for the wasm path. Happy to gate it behind a libDF feature flag (e.g.
wasm-simd-fft) instead if you prefer it opt-in.Test plan
cargo check --features tract,default-modelclean.wasm-pack build --target web --release --features wasmsucceeds.df_process_frameoutput bit-equal to baseline across Chromium / WebKit / Firefox.