MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / load_weights

Method load_weights

tensorrt_llm/_torch/modules/linear.py:2341–2353  ·  view source on GitHub ↗
(self,
                     weights: List[Dict],
                     allow_partial_loading: bool = False)

Source from the content-addressed store, hash-verified

2339 return output
2340
2341 def load_weights(self,
2342 weights: List[Dict],
2343 allow_partial_loading: bool = False):
2344 assert self._weights_created
2345
2346 weight_mode = self.weights_loading_config.weight_mode
2347 if not isinstance(self.quant_method, UnquantizedLinearMethod):
2348 assert allow_partial_loading is False, "allow_partial_loading is only supported for non-unquantized linear methods now"
2349 self.quant_method.load_weights(
2350 self,
2351 weights,
2352 weight_mode,
2353 allow_partial_loading=allow_partial_loading)
2354
2355 def post_load_weights(self):
2356 self.quant_method.post_load_weights(self)

Callers 15

test_linear_mxfp4Function · 0.95
column_lm_head_forwardFunction · 0.95
row_lm_head_forwardFunction · 0.95
mlp_forwardFunction · 0.95
column_linear_forwardFunction · 0.95
row_linear_forwardFunction · 0.95
fp4_row_linear_allreduceFunction · 0.95
test_fp8_linearFunction · 0.95
test_fp8_rowwise_linearFunction · 0.95
test_w4a16_linearFunction · 0.95

Calls

no outgoing calls

Tested by 15

test_linear_mxfp4Function · 0.76
column_lm_head_forwardFunction · 0.76
row_lm_head_forwardFunction · 0.76
mlp_forwardFunction · 0.76
column_linear_forwardFunction · 0.76
row_linear_forwardFunction · 0.76
fp4_row_linear_allreduceFunction · 0.76
test_fp8_linearFunction · 0.76
test_fp8_rowwise_linearFunction · 0.76
test_w4a16_linearFunction · 0.76