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(autocast): add FIXME comments for autocast/cast order and contiguous guards
- Add FIXME in Linear::SetupContext and Matmul::SetupContext noting that an
extra cast is performed because autocast runs before autograd; compute_dtype
should come from autocast, not from output tensor dtype.
- Add IsContiguous() to Tensor class and guard both fast paths in
elementwise.cu (forward and backward) so non-contiguous tensors fall back to
the broadcast path until proper stride tracking is added.
- Replace silent dtype cast in AccumulateGrad with a WARNING log; grad is now
used as-is when dtype mismatch is detected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments