@@ -93,27 +93,19 @@ def bytecode_hook(self, old_code: CodeType, new_code: CodeType):
93
93
return
94
94
95
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" )
104
101
if not os .path .exists (decompiled_file ):
105
102
try :
106
103
# usually the decompilation will succeed for most models,
107
104
# as we guarantee a full-graph compilation in Dynamo.
108
105
# but there's no 100% guarantee, since decompliation is
109
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 )
117
109
118
110
with open (decompiled_file , "w" ) as f :
119
111
f .write (src )
0 commit comments