Unverified Commit d74a306c authored by Frederik Gossen's avatar Frederik Gossen Committed by GitHub
Browse files

[Core] Use tuple_return in split_module for tuple-conformant subgraphs (#38752)


Signed-off-by: default avatarFrederik Gossen <frgossen@meta.com>
Co-authored-by: default avatarBoyuan Feng <boyuan@meta.com>
parent 0e9f0a51
...@@ -31,6 +31,7 @@ from vllm.logging_utils import lazy ...@@ -31,6 +31,7 @@ from vllm.logging_utils import lazy
from vllm.platforms import current_platform from vllm.platforms import current_platform
from vllm.tracing import instrument, instrument_manual from vllm.tracing import instrument, instrument_manual
from vllm.utils.import_utils import resolve_obj_by_qualname from vllm.utils.import_utils import resolve_obj_by_qualname
from vllm.utils.torch_utils import is_torch_equal_or_newer
from .compiler_interface import ( from .compiler_interface import (
CompilerInterface, CompilerInterface,
...@@ -575,11 +576,14 @@ def split_graph( ...@@ -575,11 +576,14 @@ def split_graph(
# the semantics of the graph will change when we # the semantics of the graph will change when we
# have mutations in the graph # have mutations in the graph
with _use_lazy_graph_module(True): with _use_lazy_graph_module(True):
has_tuple_return = is_torch_equal_or_newer("2.12.0.dev")
tuple_return_kwarg = {"tuple_return": True} if has_tuple_return else {}
split_gm = torch.fx.passes.split_module.split_module( split_gm = torch.fx.passes.split_module.split_module(
graph, graph,
None, None,
lambda node: node_to_subgraph_id[node], lambda node: node_to_subgraph_id[node],
keep_original_order=True, keep_original_order=True,
**tuple_return_kwarg,
) )
outputs = [] outputs = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment