@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 91b3d190ae
Fork 0

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, 02:15 UTC

[cold start] replace VLLM_COMPILE_DEPYF with debug_dump_dir (#20940)

Signed-off-by: Boyuan Feng <boyuan@meta.com>

Boyuan Feng committed Jul 14, 2025 at 22:02 UTC 91b3d190ae86aeec185ec1da663c0dda5da30545
2 files changed +7 -21
vllm/compilation/wrapper.py
+7 -15
@@ -93,27 +93,19 @@ class TorchCompileWrapperWithCustomDispatcher:
93 return
94
95 self.compiled_codes.append(new_code)
96 - local_cache_dir = self.vllm_config.compilation_config.local_cache_dir
97 - if isinstance(local_cache_dir, str):
98 - decompiled_file_name = ("transformed_code.py"
99 - if envs.VLLM_COMPILE_DEPYF else
100 - "transformed_code_README.txt")
101 -
102 - decompiled_file = os.path.join(local_cache_dir,
103 - decompiled_file_name)
96 + debug_dump_dir = self.vllm_config.compilation_config.debug_dump_path
97 + if isinstance(debug_dump_dir, str) and debug_dump_dir != "":
98 + rank = self.vllm_config.parallel_config.rank
99 + decompiled_file = os.path.join(debug_dump_dir, f"rank_{rank}",
100 + "transformed_code.py")
101 if not os.path.exists(decompiled_file):
102 try:
103 # usually the decompilation will succeed for most models,
104 # as we guarantee a full-graph compilation in Dynamo.
105 # but there's no 100% guarantee, since decompliation is
106 # not a reversible process.
110 - if envs.VLLM_COMPILE_DEPYF:
111 - import depyf
112 - src = depyf.decompile(new_code)
113 - else:
114 - src = (
115 - "To get a transformed_code.py file, re-run with "
116 - "VLLM_COMPILE_DEPYF=1")
107 + import depyf
108 + src = depyf.decompile(new_code)
109
110 with open(decompiled_file, "w") as f:
111 f.write(src)
vllm/envs.py
-6
@@ -97,7 +97,6 @@ if TYPE_CHECKING:
97 VLLM_ENABLE_V1_MULTIPROCESSING: bool = True
98 VLLM_LOG_BATCHSIZE_INTERVAL: float = -1
99 VLLM_DISABLE_COMPILE_CACHE: bool = False
100 - VLLM_COMPILE_DEPYF: bool = False
100 Q_SCALE_CONSTANT: int = 200
101 K_SCALE_CONSTANT: int = 200
102 V_SCALE_CONSTANT: int = 100
@@ -742,11 +741,6 @@ environment_variables: dict[str, Callable[[], Any]] = {
741 "VLLM_DISABLE_COMPILE_CACHE":
742 lambda: bool(int(os.getenv("VLLM_DISABLE_COMPILE_CACHE", "0"))),
743
745 - # If set, vllm will decompile the torch compiled code and dump to
746 - # transformed_code.py. This is useful for debugging.
747 - "VLLM_COMPILE_DEPYF":
748 - lambda: bool(int(os.getenv("VLLM_COMPILE_DEPYF", "0"))),
749 -
744 # If set, vllm will run in development mode, which will enable
745 # some additional endpoints for developing and debugging,
746 # e.g. `/reset_prefix_cache`