Unverified Commit aceadb5e authored by Angela Yi's avatar Angela Yi Committed by GitHub
Browse files

Use lazy graph module during split_module to defer recompile() (#37609)


Signed-off-by: default avatarangelayi <yiangela7@gmail.com>
parent ec228061
...@@ -20,6 +20,7 @@ import torch ...@@ -20,6 +20,7 @@ import torch
import torch.fx as fx import torch.fx as fx
from torch._dynamo.utils import dynamo_timed from torch._dynamo.utils import dynamo_timed
from torch._logging._internal import trace_structured from torch._logging._internal import trace_structured
from torch.fx._lazy_graph_module import _use_lazy_graph_module
import vllm.envs as envs import vllm.envs as envs
from vllm.config import CompilationConfig, CUDAGraphMode, VllmConfig from vllm.config import CompilationConfig, CUDAGraphMode, VllmConfig
...@@ -573,9 +574,13 @@ def split_graph( ...@@ -573,9 +574,13 @@ def split_graph(
# otherwise pytorch might reorder the nodes and # otherwise pytorch might reorder the nodes and
# 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
split_gm = torch.fx.passes.split_module.split_module( with _use_lazy_graph_module(True):
graph, None, lambda node: node_to_subgraph_id[node], keep_original_order=True split_gm = torch.fx.passes.split_module.split_module(
) graph,
None,
lambda node: node_to_subgraph_id[node],
keep_original_order=True,
)
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