mstar.model.glm52.weight_loader#
HF GLM-5.2 checkpoint loading.
Functions
|
Keys-to-read + per-key slice specs for the TP fast read path. |
|
|
|
|
|
|
|
|
|
Re-widen params the checkpoint stores fp32 before loading into them. |
|
Drop MTP-layer keys — and, with |
- mstar.model.glm52.weight_loader.build_glm52_read_plan(checkpoint_keys, config, tp_rank, tp_size, load_indexer=None)[source]#
Keys-to-read + per-key slice specs for the TP fast read path.
load_indexerdefaults toconfig.dsa_long_context: flag-off the model builds no indexer to fill, so its keys are never read.
- mstar.model.glm52.weight_loader.build_glm52_stacked_params(n_routed_experts, fp8_experts=False)[source]#
- mstar.model.glm52.weight_loader.load_glm52_hf_weights(module, weights, n_routed_experts, quant_config=None, fp8_experts=False, num_hidden_layers=78, load_indexer=True)[source]#
- Parameters:
module (nn.Module)
weights (Iterable[tuple[str, torch.Tensor]])
n_routed_experts (int)
quant_config (Fp8BlockQuantConfig | None)
fp8_experts (bool)
num_hidden_layers (int)
load_indexer (bool)
- Return type:
- mstar.model.glm52.weight_loader.restore_fp32_params(module)[source]#
Re-widen params the checkpoint stores fp32 before loading into them.
- Parameters:
module (Module)
- Return type:
None