[profiler] Ignore PREBUILT batches in profile-by-stage (#40098)

Co-authored-by: hanminglu <hanminglu@fb.com>
This commit is contained in:
Hanming Lu
2026-09-17 22:33:55 -07:00
committed by GitHub
co-authored by hanminglu
parent 6215aecd51
commit 6e1d9c1464
@@ -432,7 +432,9 @@ class SchedulerProfilerManager:
if self.profiler_decode_ct > self.profiler_target_decode_ct:
if self.profile_in_progress:
self._stop_profile(stage=ForwardMode.DECODE)
elif batch.forward_mode.is_idle():
elif batch.forward_mode.is_idle() or batch.forward_mode.is_prebuilt():
# PREBUILT is the disaggregated-decode placeholder for requests
# whose KV just arrived; it never enters a model forward.
pass
else:
raise RuntimeError(f"unsupported profile stage: {batch.forward_mode}")