[Fix] Stamp sequence-parallel state on dummy forward batches (#38564)
Co-authored-by: pranjalssh <pranjalssh@fb.com>
This commit is contained in:
co-authored by
pranjalssh
parent
13469c16d3
commit
35df2fecde
@@ -1508,6 +1508,10 @@ class ModelRunner:
|
||||
|
||||
def prepare_dummy_forward_batch(self, forward_batch: ForwardBatch) -> ForwardBatch:
|
||||
"""Customize a runner-created dummy batch before attention metadata initialization."""
|
||||
# Dummy runs bypass the MLP-sync/scatter passes that stamp real batches.
|
||||
forward_batch.attn_tp_sequence_sharded = self.attn_tp_sequence_sharded(
|
||||
forward_batch._forward_num_tokens()
|
||||
)
|
||||
return forward_batch
|
||||
|
||||
def attn_tp_sequence_sharded(self, num_tokens: int) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user