Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tensorrt_llm/_torch/auto_deploy/utils/node_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ def find_get_attr_node(weight_node: Node) -> Node:
n for n in node.args if isinstance(n, Node) and find_get_attr_node(n) is not None
]
# can be two weights (if bias weight is present)
assert len(weight_nodes) >= 1, (
weight_node = None
if weight_nodes:
weight_node = weight_nodes[0]
# for modelopt quantized graph, there will be a quantize_op
_, weight_params, _ = get_quantization_params_from_linear_node(node)
weight_node = weight_params.input_node if weight_params else weight_node
assert weight_node is not None, (
"Expected exactly at least one weight node in the parametrized node"
)
weight_node = weight_nodes[0]
# for modelopt quantized graph, there will be a quantize_op
_, weight_params, _ = get_quantization_params_from_linear_node(node)
weight_node = weight_params.input_node if weight_params else weight_node

return find_get_attr_node(weight_node)


Expand Down