fix: parenthesize profile_detail condition

This commit is contained in:
2026-06-02 02:56:13 +00:00
parent 4734e894c7
commit 7114c48575

View File

@@ -567,7 +567,7 @@ def forward_layer(X_l, w, li, cfg, rope_cos, rope_sin,
f"|X_l|={X_l.abs().max().item():.1f} "
f"|X_mid|={X_mid.abs().max().item():.1f} "
f"|X_next|={X_next.abs().max().item():.1f}", flush=True)
if _profile_detail and li < 3 or li == 30 or li >= 58:
if _profile_detail and (li < 3 or li == 30 or li >= 58):
torch.cuda.synchronize()
attn_ms = (t_attn1 - t_attn0) * 1000
ffn_ms = (t_ffn1 - t_ffn0) * 1000