From 168e578efc3f9fb1beaf1e89809d5678ed375bdb Mon Sep 17 00:00:00 2001 From: Yongtao Huang Date: Sun, 19 Oct 2025 00:51:57 +0800 Subject: [PATCH] Fix incorrect string formatting in barrier timeout exceptions (#27149) Signed-off-by: Yongtao Huang --- vllm/distributed/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vllm/distributed/utils.py b/vllm/distributed/utils.py index a5df81e55e36c..17f267d873281 100644 --- a/vllm/distributed/utils.py +++ b/vllm/distributed/utils.py @@ -277,7 +277,7 @@ class StatelessProcessGroup: # Check for timeout cur_time = time.time() if cur_time - start_time > timeout: - raise RuntimeError("Barrier timed out after %f seconds", timeout) + raise RuntimeError(f"Barrier timed out after {timeout:.2f} seconds") # Check for each process for i in range(self.world_size): @@ -324,7 +324,9 @@ class StatelessProcessGroup: while len(processes_departed) < self.world_size: # Check for timeout if time.time() - start_time > timeout: - raise RuntimeError("Barrier departure timed out after %f s", timeout) + raise RuntimeError( + f"Barrier departure timed out after {timeout:.2f} seconds" + ) # Check for each process for i in range(self.world_size):