A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 17:15 UTC
Fix incorrect filenames in vllm_compile_cache.py (#15494)
Signed-off-by: <zou3519@gmail.com> Signed-off-by: youkaichao <youkaichao@gmail.com> Co-authored-by: youkaichao <youkaichao@gmail.com>
Richard Zou committed
Mar 27, 2025 at 06:33 UTC
6278bc829eb6214f3375cc50347d58dbae81bc31
1 file changed
+14
-1
vllm/compilation/compiler_interface.py
+14
-1
@@ -229,7 +229,20 @@ class InductorAdaptor(CompilerInterface):
229
inductor_compiled_graph = output
230
if inductor_compiled_graph is not None:
231
nonlocal file_path
232
- file_path = inductor_compiled_graph.current_callable.__code__.co_filename # noqa
232
+ compiled_fn = inductor_compiled_graph.current_callable
233
+ file_path = compiled_fn.__code__.co_filename # noqa
234
+ if not file_path.startswith(self.cache_dir):
235
+ # hooked in the align_inputs_from_check_idxs function
236
+ # in torch/_inductor/utils.py
237
+ for cell in compiled_fn.__closure__:
238
+ if not callable(cell.cell_contents):
239
+ continue
240
+ code = cell.cell_contents.__code__
241
+ if code.co_filename.startswith(self.cache_dir):
242
+ # this is the real file path
243
+ # compiled from Inductor
244
+ file_path = code.co_filename
245
+ break
246
hash_str = inductor_compiled_graph._fx_graph_cache_key
247
return output
248