vllm-project/vllm · error · RuntimeError
Unsupported node from codegen: {node.format_node()}
Error message
Unsupported node from codegen: {node.format_node()} What it means
The code generator supports exactly placeholder, call_module (with_submod only), call_function, and output FX node ops. Any other op — typically call_method (tensor.method(...)) or get_attr — reaches the final else and raises RuntimeError with node.format_node() so the developer sees which node type broke codegen.
Source
Thrown at vllm/compilation/codegen.py:112
source = ref(node.args[0])
index = node.args[1]
assert isinstance(index, int)
lines.append(f" {node.name} = {source}[{index}]")
else:
args_str = ", ".join(ref(a) for a in node.args)
kwargs_str = ", ".join(f"{k}={ref(v)}" for k, v in node.kwargs.items())
all_args = ", ".join(filter(None, [args_str, kwargs_str]))
lines.append(
f" {node.name} = {_get_qualified_name(node.target)}({all_args})"
)
elif node.op == "output":
assert len(node.args) == 1
ret = ref(node.args[0])
lines.append(f" return {ret}")
else:
raise RuntimeError(f"Unsupported node from codegen: {node.format_node()}")
# Emit del for variables whose last use was this node.
if i in del_after and i < len(nodes) - 2:
names = sorted(del_after[i])
lines.append(f" del {', '.join(names)}")
assert len(param_names) > 0
params = ", ".join(param_names)
kw_params = ", *, __vllm_submods__" if with_submod else ""
header = f"\ndef {fn_name}({params}{kw_params}):"
return (
"".join(inlined_submods) + "\n".join([header] + lines) + "\n",
submod_names,
consts,
)
@dynamo_timed("vllm.generate_execution_code")View on GitHub (pinned to c794754062)
Solutions
- Update vLLM (and torch) to a matching pair where the compiler pipeline lowers call_method/get_attr before codegen
- Refactor the offending model code from method calls to torch functional APIs (torch.reshape(x, ...) instead of x.view(...)) if the node name in the message points at your model
- Disable piecewise compilation for that model (VLLM_DISABLE_COMPILE_CACHE=1 / -O0) to bypass codegen while investigating
Example fix
# before (model code that traces to call_method) x = x.view(B, S, H) # after x = torch.reshape(x, (B, S, H))
Defensive patterns
Strategy: validation
Validate before calling
allowed = {"placeholder", "call_function", "output", "call_module"}
bad = [n for n in graph.nodes if n.op not in allowed]
assert not bad, f"unsupported ops: {[(n.op, n.target) for n in bad]}" Type guard
def codegen_supported(graph: torch.fx.Graph, with_submod: bool = True) -> bool:
allowed = {"placeholder", "call_function", "output"} | ({"call_module"} if with_submod else set())
return all(n.op in allowed for n in graph.nodes) Prevention
- Prefer torch functional APIs over tensor methods in models slated for compile
- Pin matched vLLM+torch versions; report unlowered call_method graphs upstream
When it happens
Trigger: Passing an FX graph to the codegen helper that contains call_method nodes (e.g. x.view(...), x.to(...) traced as methods) or get_attr nodes that dynamo did not lift into constants/placeholders.
Common situations: Dynamo/torch version behavior changes that leave call_method nodes unlowered; custom models whose method calls survive tracing; internal vLLM compile-pipeline bugs — end users usually see this via the compile cache path on unsupported model code.
Related errors
- call_module is not allowed for codegen target {target}.
- Expected {ty} but got {type(value)} for {value}
- PostGradPassManager can not be kept in CompilationConfig.
- The compiled artifact is not serializable. This usually mean
- vLLM failed to compile the model. The most likely reason for
AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14).
Data as JSON: /api/errors/c615c38dda387a75.
Report an issue: GitHub.