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
{{ message }}
Repository navigation
TT block-float forwards narrow weights and FP32 bias before the final cast #3863
A second FP16 case with all weights 4096, bias -65536, and all-one input returns -inf from layer(x) versus 0 when the packed grid is accumulated with the FP32 bias before the final cast.
Cause
TTBlockfloatLinear.forward narrows the preserved FP32 checkpoint bias to the activation dtype before either kernel or fallback execution; the fallback also dequantizes the packed weight to that dtype before F.linear. The CUDA binding requires bias dtype equal to activation dtype and the HIP binding casts it, so the same precision loss applies to native paths. The recent checkpoint-bias precision fix (#3843) preserves storage dtype, but forward execution discards it.
Expected
Accumulate the block-float grid and stored FP32 bias with sufficient range and precision, then cast the final output to the requested activation dtype. Cover cancellation and range cases for BF16/FP16 on fallback and native paths.
Related tied-head fallback
The tied output head has the same early weight-narrowing problem even without bias. On CPU, construct a TTBlockfloatEmbedding(1, 16, bits=8, dtype=torch.float16) with quantized FP32 grid row [65536, -65536, 0, ...], then call TTBlockfloatTiedHead(embedding) on a half-precision input whose first two entries are 1. TTBlockfloatTiedHead.forward decodes the shared weight to FP16 before its CPU matmul and returns nan; the FP32 grid dot is exactly zero and rounds to FP16 0. This tied-head fallback belongs to the same early-narrowing issue, though its native path has not been tested here.
changed the title [-]TT block-float forward narrows FP32 bias before low-precision epilogue[/-][+]TT block-float forwards narrow weights and FP32 bias before the final cast[/+]on Nov 14, 2026
Activity
[-]TT block-float forward narrows FP32 bias before low-precision epilogue[/-][+]TT block-float forwards narrow weights and FP32 bias before the final cast[/+]fix(tenstorrent): keep fp32 bias precision through block-float forward (