Skip to content

Commit be48b41

Browse files
naromero77amdAkshat-Tripathi
authored andcommitted
[Bugfix] Flush TunableOp results before worker processes are destroyed. (vllm-project#13623)
Signed-off-by: Nichols A. Romero <nick.romero@amd.com>
1 parent 5bf3a9b commit be48b41

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

vllm/executor/multiproc_worker_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ def _run_worker_process(
250250
except Exception:
251251
logger.exception("Worker failed")
252252

253+
# Flush TunableOp results when TunableOp is enabled and
254+
# online (in situ) tuning is enabled.
255+
# Offline tuning API (record_untuned_is_enabled()) only
256+
# available in PyTorch 2.6 or later.
257+
import torch.cuda.tunable as tunable
258+
if (tunable.is_enabled() and tunable.tuning_is_enabled()
259+
and not tunable.record_untuned_is_enabled()):
260+
tunable.write_file()
261+
253262
logger.info("Worker exiting")
254263

255264

0 commit comments

Comments
 (0)