Repository navigation
Commit b256920
fix(gguf): fail closed for per-projection v2 -- remove the env-only overclaim
Reviewer revision (Gaff REJECT-WITH-REVISION on #591): the block_layout_version=2
opt-in was a bare environment flag wired into the production export path, so
MOBIUS_ENABLE_BQMOE_PERPROJ_V2=1 could make build_from_gguf emit a v2 node the
current runtime cannot execute while still reporting a green build. No shipped
onnx-genai runtime implements the per-projection v2 ABI and there is no typed
runtime-capability handshake yet, so v2 must never be reachable from production.
Honesty fix (narrow; approved fusion/builder behavior unchanged):
* Remove _perproj_bqmoe_v2_runtime_available() and the now-unused os import. The
production authority path (_fuse_native_block_moe) no longer enables v2 at all:
a mixed-format layer always typed-rejects with SparseMoEExportError. The env
var is retired and has no effect on any build.
* Flip the public fuse_block_quantized_moe default from perproj_v2_runtime=True to
fail-closed, and rename the parameter to the private, test-only
_allow_perproj_v2_schema (default False). A direct public caller now rejects a
mixed-format v2 layer by default; the only way to emit a v2 node is an explicit
schema-construction test opt-in, unreachable from the builder, CLI, or
environment, and the node it builds is schema-only and never runnable.
* Update the _plan_layer reject message: no env override; v2 stays a
schema-construction test path until a typed runtime-capability handshake ships.
Tests:
* New: setting the retired MOBIUS_ENABLE_BQMOE_PERPROJ_V2 (every truthy spelling)
cannot bypass the blocker -- _fuse_native_block_moe and end-to-end
build_from_gguf both still raise SparseMoEExportError with the dense graph left
untouched; env + allow_dense keeps the runnable dense fallback, never a v2 node.
* Direct public fuse_block_quantized_moe rejects mixed-format v2 by default; v1
uniform still fuses; the private schema hook stays covered for the v2 shape.
* Removed the two runtime-probe tests and the two v2-via-env emission tests (the
env capability they asserted no longer exists).
Focused 42 passed; full rewrite_rules/ + integrations/gguf/ 575 passed, 1 skipped.
ruff check + ruff format --check clean on all four changed files.
Co-authored-by: Copilot <[email protected]>1 parent e851b2e commit b256920
4 files changed
Lines changed: 128 additions & 110 deletions
File tree
- src/mobius
- integrations/gguf
- rewrite_rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
| 63 | + | |
65 | 64 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 65 | | |
72 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
118 | | - | |
119 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
120 | 133 | | |
121 | 134 | | |
122 | | - | |
123 | | - | |
| 135 | + | |
124 | 136 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | 144 | | |
| |||
232 | 244 | | |
233 | 245 | | |
234 | 246 | | |
235 | | - | |
236 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
237 | 251 | | |
238 | 252 | | |
239 | 253 | | |
| |||
363 | 377 | | |
364 | 378 | | |
365 | 379 | | |
366 | | - | |
367 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
368 | 387 | | |
369 | 388 | | |
370 | 389 | | |
371 | | - | |
| 390 | + | |
372 | 391 | | |
373 | 392 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
| 393 | + | |
| 394 | + | |
382 | 395 | | |
383 | 396 | | |
384 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | 228 | | |
250 | 229 | | |
251 | 230 | | |
252 | 231 | | |
253 | 232 | | |
254 | 233 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
258 | 245 | | |
259 | 246 | | |
260 | 247 | | |
261 | 248 | | |
262 | 249 | | |
263 | | - | |
264 | 250 | | |
265 | 251 | | |
266 | | - | |
267 | | - | |
268 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
269 | 255 | | |
270 | 256 | | |
271 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
608 | 610 | | |
609 | 611 | | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
616 | 620 | | |
617 | 621 | | |
618 | 622 | | |
| |||
668 | 672 | | |
669 | 673 | | |
670 | 674 | | |
671 | | - | |
| 675 | + | |
672 | 676 | | |
673 | 677 | | |
674 | 678 | | |
675 | 679 | | |
676 | | - | |
677 | | - | |
678 | | - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
679 | 685 | | |
680 | 686 | | |
681 | 687 | | |
| |||
829 | 835 | | |
830 | 836 | | |
831 | 837 | | |
832 | | - | |
| 838 | + | |
833 | 839 | | |
834 | 840 | | |
835 | 841 | | |
| |||
858 | 864 | | |
859 | 865 | | |
860 | 866 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
869 | 878 | | |
870 | 879 | | |
871 | 880 | | |
| |||
893 | 902 | | |
894 | 903 | | |
895 | 904 | | |
896 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
897 | 908 | | |
898 | 909 | | |
899 | 910 | | |
| |||
0 commit comments