vllm.models.mistral.mistral_large4.nvidia.model
¶
Mistral Large 4: MLA + DSA sparse attention, MoE, NoPE layers, KV sharing.
The text model is hosted by PixtralForConditionalGeneration for the
multimodal checkpoint.
Classes:
Functions:
-
defers_allreduce–Whether sublayers leave their outputs TP-partial and fuse the all-reduce
MistralLarge4DecoderLayer
¶
Bases: Module
Methods:
-
forward–Run the layer on the outputs of
input_norm. -
input_norm–Fold the previous layer's output into the residual stream and
-
residual_norm–Add a sublayer output to the residual stream and normalize; with
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
forward(positions, hidden_states, residual, log_positions, rotary_emb)
¶
Run the layer on the outputs of input_norm.
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
input_norm(hidden_states, residual)
¶
Fold the previous layer's output into the residual stream and normalize; the returned residual is the stream entering this layer.
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
residual_norm(norm, hidden_states, residual)
¶
Add a sublayer output to the residual stream and normalize; with
defer_allreduce the output is a TP-partial sum reduced here.
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
_check_pp_stage(specs, start, end)
¶
A pipeline stage must own the KV cache and the top-k indices its layers read: KV-sharing sources and the indexer a shared layer reuses stay local.
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
_load_weights(model, mistral_model, weights)
¶
Load a Mistral consolidated checkpoint into model.
model holds mistral_model as model.model and the LM head as
model.lm_head.
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | |
_map_quant_config_layers(quant_config, prefix)
¶
Point the layer names of a Mistral-format quantization config at this model's modules.
Such a config lists checkpoint modules (e.g. ModelOpt quantized_layers
keys such as layers.1.attention.wq or layers.1.experts); a fused module
resolves through the checkpoint modules stacked into it.
Source code in vllm/models/mistral/mistral_large4/nvidia/model.py
defers_allreduce(vllm_config)
¶
Whether sublayers leave their outputs TP-partial and fuse the all-reduce into the next residual RMSNorm.