You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(grad-checkpoint): close over mask so CUDA SDPA VJP error is avoided
nn.utils.checkpoint(layer)(hidden_states, mask) still passes the additive
attention mask as a checkpointed positional input, so MLX takes a VJP w.r.t.
the mask and CUDA's scaled_dot_product_attention raises 'does not support VJP
with respect to mask' (Metal tolerates it, CUDA does not — this is why the
gb10 grad-checkpoint probe still crashed). Pass mask/doc_ids via a closure fn
to nn.utils.checkpoint(layer, fn) so they stay out of the differentiated input
set while params + hidden_states are still recomputed. Grad correctness is
unchanged (params threaded via the module arg); tests still green.
0 commit comments