mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Replace frame_traced_fn hook with get_traced_code() util (#155249)
#153622 introduced a hook for getting the relevant code objects after frame tracing. The idea is to have vLLM use this instead of monkey-patching `inline_call_()` to determine the source code files to hash. Unfortunately, the hook runs too late; the vLLM backend needs access to the set of source code filenames while it's running. This PR replaces the newly-added hook with a utility function that a backend can call to get this information. I've made the change in vLLM and can verify that this allows the information to be queried at the right time. Pull Request resolved: https://github.com/pytorch/pytorch/pull/155249 Approved by: https://github.com/zou3519
This commit is contained in:
committed by
PyTorch MergeBot
parent
8892b782a8
commit
c4b93e6579
@ -2630,10 +2630,6 @@ def compile(
|
||||
if options and isinstance(options, dict):
|
||||
guard_filter_fn = options.pop("guard_filter_fn", None)
|
||||
|
||||
frame_traced_fn = None
|
||||
if options and isinstance(options, dict):
|
||||
frame_traced_fn = options.pop("frame_traced_fn", None)
|
||||
|
||||
if backend == "inductor":
|
||||
backend = _TorchCompileInductorWrapper(mode, options, dynamic)
|
||||
else:
|
||||
@ -2645,7 +2641,6 @@ def compile(
|
||||
dynamic=dynamic,
|
||||
disable=disable,
|
||||
guard_filter_fn=guard_filter_fn,
|
||||
frame_traced_fn=frame_traced_fn,
|
||||
)(model) # type: ignore[return-value]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user