From 5217d1b3bc8f80b154c9b372527b8157d6f3776a Mon Sep 17 00:00:00 2001 From: rzou Date: Thu, 24 Apr 2025 14:39:28 -0700 Subject: [PATCH] [easy] Fix logspam on PiecewiseBackend errors Sometimes when there is an error, we get spammed with a dump of the current torch.fx.Graph that is being compiled. That is due to this code here: https://github.com/pytorch/pytorch/blob/fc6e37ceb23f99808265c11a37368078d5f982b8/torch/fx/interpreter.py#L173-L183 We turn off this flag so we don't get logspams. The spam is not helpful, also vLLM has other ways of dumping the graphs to file. Signed-off-by: rzou --- vllm/compilation/backends.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm/compilation/backends.py b/vllm/compilation/backends.py index c493a764f56d..979b00586ef0 100644 --- a/vllm/compilation/backends.py +++ b/vllm/compilation/backends.py @@ -239,6 +239,8 @@ def __init__(self, module: torch.fx.GraphModule, self.graph_pool = graph_pool self.vllm_config = vllm_config self.vllm_backend = vllm_backend + # When True, it annoyingly dumps the torch.fx.Graph on errors. + self.extra_traceback = False def run(self, *args): fake_args = [