Apply default stream to priority 0 in scheduling. (#16438)

This commit is contained in:
Liangsheng Yin
2026-03-03 00:05:27 -08:00
committed by GitHub
parent 07b8d763ef
commit 7a2d3df96f
2 changed files with 39 additions and 34 deletions
@@ -1039,7 +1039,7 @@ class SchedulerPPMixin:
)
if not mbs[next_mb_id].forward_mode.is_prebuilt():
with self.copy_stream_ctx:
self.copy_stream.wait_stream(self.default_stream)
self.copy_stream.wait_stream(self.schedule_stream)
batch_result = self._pp_prep_batch_result(
mbs[next_mb_id], mb_metadata[next_mb_id], next_pp_outputs
)
@@ -1057,7 +1057,7 @@ class SchedulerPPMixin:
):
with torch.profiler.record_function("run_batch"):
with self.forward_stream_ctx:
self.forward_stream.wait_stream(self.default_stream)
self.forward_stream.wait_stream(self.schedule_stream)
result = self.run_batch(self.cur_batch, pp_proxy_tensors)
mb_metadata[mb_id] = PPBatchMetadata(
can_run_cuda_graph=result.can_run_cuda_graph,