Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions flashinfer/comm/allreduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ def allreduce_fusion(
workspace: AllReduceFusionWorkspace,
pattern: int,
launch_with_pdl: bool = False,
trigger_completion_at_end: Optional[bool] = None,
Comment thread
nv-yunzheq marked this conversation as resolved.
Resolved
# ===== OUTPUT tensors (pre-allocated, will be filled) =====
output: Optional[torch.Tensor] = None,
residual_out: Optional[torch.Tensor] = None,
Expand Down Expand Up @@ -494,7 +495,13 @@ def allreduce_fusion(
- kARResidualRMSNormOutFP8Quant = 4
- kARResidualRMSNormOutFP4Quant = 5
Note: MNNVL only supports patterns 0 and 1
launch_with_pdl: Use Persistent Dependency Launch
launch_with_pdl: Use Programmatic Dependent Launch
trigger_completion_at_end: Controls when PDL completion is signaled.
None (default): follows launch_with_pdl for backward compatibility.
True: signal completion after the kernel finishes (safe, no overlap).
False: signal completion early, allowing the next PDL-aware kernel
to overlap with this one. Only safe when the subsequent kernel also
uses cudaGridDependencySynchronize().

# ===== OUTPUT tensors (pre-allocated, filled by function) =====
output: AllReduce output [token_num, hidden_dim]
Expand Down Expand Up @@ -611,7 +618,9 @@ def _flatten_checked(t, name):
hidden_dim=hidden_dim,
workspace_ptrs=workspace.workspace_tensor,
launch_with_pdl=launch_with_pdl,
trigger_completion_at_end=launch_with_pdl, # Same meaning
trigger_completion_at_end=trigger_completion_at_end
if trigger_completion_at_end is not None
else launch_with_pdl,
Comment thread
nv-yunzheq marked this conversation as resolved.
Resolved
fp32_acc=fp32_acc,
pattern_code=pattern, # type: ignore[arg-type]
use_oneshot=use_oneshot,
Expand Down
Loading