Skip to content

Commit 379e637

Browse files
zhxchen17DarkLight1337
authored andcommitted
[compile] Add fallback path to AOT compile when serialization fails. (vllm-project#27350)
Signed-off-by: zhxchen17 <zhxchen17@fb.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
1 parent 6dd9b99 commit 379e637

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

vllm/compilation/decorators.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,17 @@ def patched_inline_call(self_):
403403
output = self.aot_compiled_fn(self, *args, **kwargs)
404404
assert aot_compilation_path is not None
405405
assert cache_dir is not None
406-
os.makedirs(cache_dir, exist_ok=True)
407-
self.aot_compiled_fn.save_compiled_function(aot_compilation_path)
406+
try:
407+
os.makedirs(cache_dir, exist_ok=True)
408+
self.aot_compiled_fn.save_compiled_function(
409+
aot_compilation_path
410+
)
411+
except Exception as e:
412+
logger.warning(
413+
"Cannot save aot compilation to path %s, error: %s",
414+
aot_compilation_path,
415+
str(e),
416+
)
408417
else:
409418
output = self.compiled_callable(*args, **kwargs)
410419
return output

0 commit comments

Comments
 (0)