File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
tensorrt_llm/_torch/auto_deploy/utils Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -139,14 +139,15 @@ def find_get_attr_node(weight_node: Node) -> Node:
139139 n for n in node .args if isinstance (n , Node ) and find_get_attr_node (n ) is not None
140140 ]
141141 # can be two weights (if bias weight is present)
142- assert len (weight_nodes ) >= 1 , (
142+ weight_node = None
143+ if weight_nodes :
144+ weight_node = weight_nodes [0 ]
145+ # for modelopt quantized graph, there will be a quantize_op
146+ _ , weight_params , _ = get_quantization_params_from_linear_node (node )
147+ weight_node = weight_params .input_node if weight_params else weight_node
148+ assert weight_node is not None , (
143149 "Expected exactly at least one weight node in the parametrized node"
144150 )
145- weight_node = weight_nodes [0 ]
146- # for modelopt quantized graph, there will be a quantize_op
147- _ , weight_params , _ = get_quantization_params_from_linear_node (node )
148- weight_node = weight_params .input_node if weight_params else weight_node
149-
150151 return find_get_attr_node (weight_node )
151152
152153
You can’t perform that action at this time.
0 commit comments