DEBUG: check gsa values and pinpoint exact failing operation

This commit is contained in:
2026-06-04 01:16:37 +00:00
parent e77455c3ba
commit ccbc713658

View File

@@ -374,6 +374,13 @@ class Nvfp4SharedExpert:
print(f" SE L2: quantize_nvfp4_gpu_fused FAILED after sync: {e}", flush=True)
print(f" intermediate: shape={tuple(intermediate.shape)} dtype={intermediate.dtype} dev={intermediate.device}", flush=True)
raise
# DEBUG: check gsa values before assignment
try:
gsa_first = gsa_l2_gpu[0].item() # DEBUG: read value
print(f" SE L2 gsa[0]={gsa_first:.6f} shape={tuple(gsa_l2_gpu.shape)} buf_shape={tuple(self._l2_gsa_buf.shape)}", flush=True)
except RuntimeError as e:
print(f" SE L2: gsa[0].item() FAILED: {e}", flush=True)
raise
# Copy first element of gsa to pre-allocated buffer.
self._l2_gsa_buf[0] = gsa_l2_gpu[0] # scalar GPU → GPU, no sync, graph-capturable
else: