Commit 929e461
authored
[Bugfix] Fix GLM-5.1 IndexCache weight loading (vllm-project#11363)
## What this PR does / why we need it?
The existing patch treated `skip_topk=True` as proof that the checkpoint
omitted the layer's `Indexer`. This is valid for GLM-5.2 shared-indexer
layers, but not for GLM-5.1 when IndexCache is enabled through runtime
HF overrides. GLM-5.1 checkpoints still contain `indexer.*` weights for
every layer, so removing the module makes `AutoWeightsLoader` reject
those weights.
This change separates top-k reuse from checkpoint structure: `skip_topk`
controls computation, while `indexer_types[layer_id] == "shared"`
controls whether the module is omitted.
- Keep per-layer `Indexer` modules for GLM-5.1 when IndexCache is
enabled through `use_index_cache` and `index_topk_freq` overrides.
- Skip `Indexer` initialization only for GLM-5.2 layers explicitly
marked as `shared` in `indexer_types`.
- Keep complete `Indexer` modules for MTP layers.
- Add focused unit coverage for GLM-5.1, GLM-5.2 shared-indexer, and MTP
behavior.
## How was this patch tested?
- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
Signed-off-by: ZYang6263 <50876451+ZYang6263@users.noreply.github.com>1 parent c56b0d8 commit 929e461
3 files changed
Lines changed: 69 additions & 23 deletions
File tree
- tests/ut/patch/worker
- vllm_ascend/patch
- worker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | | - | |
766 | | - | |
767 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
768 | 769 | | |
769 | | - | |
770 | | - | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
771 | 773 | | |
772 | 774 | | |
773 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
27 | 48 | | |
28 | 49 | | |
29 | 50 | | |
| |||
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 185 | + | |
| 186 | + | |
168 | 187 | | |
169 | 188 | | |
170 | 189 | | |
| |||
196 | 215 | | |
197 | 216 | | |
198 | 217 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
0 commit comments