Skip to content

chore(core): correct the sink attention Used by comment - #2472

Merged
inureyes merged 2 commits into
lablup:mainfrom
songys:fix/issue-1786-sink-used-by
Oct 20, 2026
Merged

inureyes merged 2 commits into
lablup:mainfrom
songys:fix/issue-1786-sink-used-by

Conversation

@songys

@songys songys commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

fast_scaled_dot_product_attention_with_sinks carried Used by: GptOss at all three of its declaration sites, but five families call it: GPT-OSS, Laguna, DeepSeek-V4, Falcon-OCR and, since #2460 landed, OpenAI Privacy Filter. The same comment called a sink a "per-head attention bias for first position"; a sink is an extra per-head logit that joins the softmax denominator and has no value row. All three comments now describe the sink that way and list the five families. Comment-only; no code changes.

  • src/lib/mlxcel-core/src/lib.rs (/// in the cxx bridge block), src/lib/mlxcel-core/cpp/mlx_cxx_bridge.h and src/lib/mlxcel-core/cpp/mlx_cxx_bridge.cpp (//): the two comment lines replaced with the text from the issue, plus OpenAIPrivacyFilter, which was not a caller when the issue was filed. The spelling follows the existing Used by: lines in src/models/gpt_oss_common.rs.
  • The three Used by: GptOss lines on the GPT-OSS SwiGLU activation are correct and are left as they are, as the issue asks.

Related issues

Closes #1786

Type of change

  • chore — build, CI, dependencies, release infrastructure

Test plan

  • cargo fmt --all -- --check passes.
  • grep -rn 'fast_scaled_dot_product_attention_with_sinks(' src/models lists gpt_oss.rs, laguna_layers.rs, deepseek_v4_attention.rs, falcon_ocr.rs, openai_privacy_filter_layers.rs and the privacy filter's test file, and nothing else in src/, examples/, tests/ or benches/.
  • git diff -U0 shows only the six comment lines changed.
  • cargo build --release --features metal,accelerate was not run for this comment-only change; the C++ edits are inside // comments, so the bridge compiles as before.

`fast_scaled_dot_product_attention_with_sinks` carried `Used by: GptOss` at its three declaration sites (the cxx bridge block in `src/lib/mlxcel-core/src/lib.rs`, `mlx_cxx_bridge.h` and `mlx_cxx_bridge.cpp`), but five families call it: GPT-OSS, Laguna, DeepSeek-V4, Falcon-OCR and, since lablup#2460, OpenAI Privacy Filter. `docs/code-guidelines.md` ("Shared Function Comments") makes the `// Used by:` line the record of what a change to a shared function can break, so the stale list hid four callers.

The same comment described a sink as a "per-head attention bias for first position". A sink is an extra per-head logit that joins the softmax denominator and has no value row: MLX's fallback concatenates it in front of the scores, applies the softmax and slices it off. All three comments now say that and name the five families, with `OpenAIPrivacyFilter` spelled as the existing `Used by:` lines in `src/models/gpt_oss_common.rs` spell it.

Comment-only change. `cargo fmt --all -- --check` passes, and `grep -rn 'fast_scaled_dot_product_attention_with_sinks(' src/models` lists exactly the five families' call sites plus the privacy filter's test. The three `Used by: GptOss` lines on the GPT-OSS SwiGLU activation are correct and are left as they are.

Closes lablup#1786
@inureyes inureyes added status:review Under review type:chore Maintenance tasks (build, CI, etc.) priority:low Low priority area:core mlxcel-core: MLX FFI, primitives, KV cache, layers labels Oct 20, 2026
@inureyes

Copy link
Copy Markdown
Member

Implementation hardening reviewed PR #2472 against issue #1786 and the current source. No correctness gap requiring a follow-up commit was found.

Verified all three sink descriptions and five model-family callers, including OpenAI Privacy Filter. A source comparison excluding comment-only lines confirms executable Rust/C++ is unchanged; unrelated SwiGLU comments remain intact. cargo fmt --all -- --check, caller assertions, and git diff --check origin/main...HEAD passed.

Security and performance review: documentation/comment-only changes introduce no executable behavior, dependency, authorization, or resource-lifecycle changes. All applicable PR checks passed; path-filtered jobs were skipped by CI. Full GPU runtime tests were not run locally because no runtime logic changed.

@inureyes
inureyes merged commit d961b73 into lablup:main Oct 20, 2026
27 checks passed
@songys
songys deleted the fix/issue-1786-sink-used-by branch October 20, 2026 06:39
@inureyes inureyes added this to the 0.8 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core mlxcel-core: MLX FFI, primitives, KV cache, layers priority:low Low priority status:review Under review type:chore Maintenance tasks (build, CI, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(core): correct the sink attention Used by comment

2 participants