Repository navigation
Commit e8a9b16
committed
Compare the module trees, not two compilations of them
tests/vllm/_granite4_fullsize_tests.py::test_logits_match[4.0-micro] fails on
the vllm20 CI leg and passes on vllm19, and has done so on unrelated PRs -- 117
(2f919be) is a docs-and-comments-only commit, which cannot move a logit. So the
assertion is measuring something other than the code under test.
What it measures is compilation. The test asserts atol=rtol=0 between two
separately launched vLLM engines: upstream GraniteMoeHybrid and GraniteSwitch
with num_adapters=0. Those are different graphs, so torch.compile and inductor
are free to fuse and tile them differently, and at production dimensions that
is enough to round one bf16 logit's last bit apart. vLLM logs its own per-engine
kernel choice: the failing engine reported IrOpPriorityConfig(rms_norm=
['native']) where its sibling reported ['vllm_c', 'native'] -- a different
RMSNorm kernel in 80 places.
The attribution rests on what does pass. 4.0-1b and 4.0-350m have the same 40
dense layers and are bit-exact on both legs; the same comparison on the HF
backend is bit-exact for all three; and real granite-4.0-micro weights are
bit-exact through vLLM in test_skinning_equivalence.py. A weight-transfer or
skinning bug would not spare all of those.
So run these eager. Bit-exactness is a property of the module tree, and eager is
where the module tree is what executes -- enforce_eager takes the compiler, the
CUDA-graph capture and vLLM's on-disk compile cache out of the comparison and
leaves the gate at atol=rtol=0 rather than loosening it. There was already
precedent for the flag in _granite4_mini_tests.py's _UPSTREAM_EAGER_CONFIGS. The
compiled path keeps the coverage it already had, from the two tests that are
deliberately tolerant of a flipped last bit: test_skinning_equivalence.py on
real weights and test_generation_equivalence.py on distributions.
Two supporting changes, because the failure was also unreadable:
* The bit-exact branch now calls this repo's assert_close instead of
torch.testing.assert_close. A msg= string handed to the latter *replaces*
its whole diagnostic, which is why four CI runs recorded "logprobs should be
bit-exact" and not one number -- there was no way to tell a last-bit drift
from a real regression without re-running 4 GPU-hours. assert_close reports
the count, the worst diff and its magnitude.
* assert_close now treats matching non-finite entries as equal. Logprob
tensors are padded with -inf for positions vLLM did not return, and
-inf - -inf is nan, which fails every comparison including diff <= 0.0. That
trap was latent while only the tolerance branch used the helper; the
bit-exact branch would have hit it as a bogus worst=nan.
The margin is printed on a pass too, so a gate that has quietly started riding
at one ULP is visible before it trips.
Verified on CPU: 35 tests in tests/hf/test_granite4_mini.py and
test_granitemoe_mini.py (the existing assert_close callers) still pass, the three
TestGranite4FullSizeWeightTransfer cases pass, and the five assert_close
semantics above were checked directly. The GPU legs are the real gate.
Signed-off-by: itzikvaisman <yizhak.vaisman@ibm.com>1 parent 24aa420 commit e8a9b16
2 files changed
Lines changed: 64 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
34 | 45 | | |
35 | 46 | | |
36 | 47 | | |
37 | 48 | | |
38 | | - | |
| 49 | + | |
39 | 50 | | |
40 | 51 | | |
41 | 52 | | |
| |||
256 | 267 | | |
257 | 268 | | |
258 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
259 | 285 | | |
260 | 286 | | |
261 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
0 commit comments