Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/prime_rl/trainer/models/layers/ring_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def _fa3_varlen_forward(
"max_seqlen_q": max_seqlen_q,
"max_seqlen_k": max_seqlen_k,
"softmax_scale": softmax_scale,
"causal": causal,
"is_causal": causal,
"window_size_left": window_size[0],
"window_size_right": window_size[1],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale default-args keys break older FA3 versions

Medium Severity

The PR description claims support for both old (3.0.0b1) and new (3.0.0) FA3 kwarg naming, but the implementation unconditionally hardcodes the new-style keys (is_causal, window_size_left, window_size_right). When get_default_args populates params from an older kernel that uses causal and window_size, those stale keys remain after the update() call, producing a dict with both old and new keys. This causes the same "too many arguments" RuntimeError this PR aims to fix — just in the reverse direction. The code needs to detect which keys params already contains and use matching names, or remove stale keys after the update.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 66b277f. Configure here.

}
)
if "window_size" in params:
params["window_size"] = window_size
out, lse, _, _ = _flash_attn_forward(**params)
return out, lse

Expand Down Expand Up @@ -76,11 +76,11 @@ def _fa3_varlen_backward(
"dk": dk,
"dv": dv,
"softmax_scale": softmax_scale,
"causal": causal,
"is_causal": causal,
"window_size_left": window_size[0],
"window_size_right": window_size[1],
}
)
if "window_size" in params:
params["window_size"] = window_size
_flash_attn_backward(**params)


Expand Down
Loading