candle-flash-attn: remove duplicate softcap: f32 in run_mha FFI decl#12
Merged
Conversation
The Rust extern declaration of `run_mha` in `candle-flash-attn/src/ffi.rs`
listed `softcap: f32` twice — once between `softmax_scale` and `seqlen_q`,
and again at the end of the parameter list (after `window_size_right`). The
C definition in `candle-flash-attn/kernels/flash_api.cu` only has a single
`softcap` (at the end), so the Rust-side signature declared 38 parameters
while the call sites in `src/lib.rs` pass 37:
error[E0061]: this function takes 38 arguments but 37 arguments were supplied
--> candle-flash-attn/src/lib.rs:169:13
Drop the spurious copy between `softmax_scale` and `seqlen_q` so the Rust
FFI matches the C ABI and compilation succeeds.
Reproduced while building spiced (spiceai/spiceai #10278) with `--features
cuda` on CUDA 12.6; the build now completes once this fix is applied.
sgrebnov
approved these changes
Apr 17, 2026
…d Stella v5 models; add clippy allow for explicit counter loops in PaddleOCR-VL and quantized LFM2 examples.
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.
The Rust extern declaration of
run_mhaincandle-flash-attn/src/ffi.rslistedsoftcap: f32twice — once betweensoftmax_scaleandseqlen_q, and again at the end of the parameter list (afterwindow_size_right).The C definition in
candle-flash-attn/kernels/flash_api.cuonly has a singlesoftcap(at the end):so the Rust-side signature declared 38 parameters while the call sites in
src/lib.rspass 37:Drop the spurious copy between
softmax_scaleandseqlen_qso the Rust FFI matches the C ABI.Validation
Reproduced while building
spiced(spiceai/spiceai#10278) with--features cudaon CUDA 12.6 — the build now completes once this fix is applied.