[Bugfix] Complete one-shot fused all-reduce PDL at end to avoid NaN (#45448)

This commit is contained in:
Ace Eldeib
2026-06-18 00:54:39 +00:00
committed by GitHub
parent ebbb2d55ac
commit b4092176b9
@@ -238,7 +238,17 @@ if flashinfer_comm is not None:
use_oneshot=use_oneshot,
fp32_acc=fp32_acc,
weight_bias=weight_bias,
trigger_completion_at_end=num_tokens > PDL_ADVANCE_LAUNCH_TOKENS,
# The one-shot Lamport all-reduce signals PDL completion before its
# output buffer is committed when trigger_completion_at_end is
# False, so the next PDL-launched kernel can read the uninitialized
# Lamport buffer and produce NaN. This only fires for
# num_tokens <= PDL_ADVANCE_LAUNCH_TOKENS (the batch=1 / spec-decode
# shapes, where the one-shot path is always selected). Complete at
# the end for the one-shot path; the two-shot path is synchronized
# and keeps the early completion. Related one-shot instability in
# the same kernel: flashinfer-ai/flashinfer#1223.
trigger_completion_at_end=use_oneshot
or num_tokens > PDL_ADVANCE_LAUNCH_TOKENS,
)
def call_trtllm_fused_allreduce_norm_fake(