Repository navigation
test: make fusion rounding probe independent of accumulation order - #40
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fusion rounding probe failed on this VM because it assumed a sequential float64 dot product, while the reference convolution uses PyTorch/MKL matrix multiplication with a CPU-dependent accumulation order. The replacement probe keeps the intended portable distinction: formulation A (rounded partials) differs from B (double partials) and from the monolithic convolution. The unchanged historical fixture also checks A and B through the real grouped code. A separate scalar calculation checks only the historical monolithic result, whose accumulation-order dependence is documented.
Diagnosis
On unchanged main at base
a988d79101a401f55ea77bbf24795253b67bf5ff:MKL_ENABLE_INSTRUCTIONS=AVX2returns monolithic[1, 1];SSE4_2returns[1, 0]for the original probe.[2^53, 1, 1, -2^53]produces{0, 1, 2}. The two unit contributions can be absorbed at2^53.threadpoolctlis unavailable.Change and scope
Test layer only:
test_upernet_fusion_optimized.pyand itshelpers.pyreference helper.The portable convolution fixture uses integer-generated dyadic products of magnitude at most
2^40, with absolute sums at most2^41 + 2. Every double subtotal is exact in any order: monolithic and B return[1, 2], while A loses the units when its partials are rounded and returns[0, 0].The original historical fixture is restored unchanged except for its name,
grouped_probe_inputs_historical(verified by AST comparison). It checks A[0, 0]and B[1, 1]through the realMU.grouped_roundedandMU.grouped_doubleimplementations. Each group dot has at most two nonzero terms; its result does not depend on the BLAS reduction order. Only the historical monolithic[1, 0]result uses explicit scalar sequential addition of products derived from that fixture. Its docstring explains the2^53cancellation caveat and points to the real grouped checks. The helpers docstring distinguishes the unchanged historical fixture from the new portable fixture. There is no library, golden graph, tolerance, skip, xfail, or shared-environment change.Validation
Final clean revision:
08b907a748a0e4f94912e07b3e35ed3f6ee4ab28. Fix round 1 retains the portable fixture and all three assertions unchanged, restores real-code historical grouped coverage, and limits the explicit sequential test to monolithic. Mainbb76ab958f7f4e0a0135edf7671a4451b45137b9was merged without conflicts inc6c3b3b7b77abd24ddfd04e7b02072aa5451e4b1; no rebase was used. Only the two test files differ from main. Local Python commands usedPYTHONPATH=.and two OMP/MKL/OpenBLAS threads; heavy checks ran serially under the shared lock.python tools/graph_identity.py --check docs/evidence/l00-golden-graphs.json: passed before and after; 36 fixture graphs equal, 9 trained graphs not compared because checkpoints are unavailable. No--resourcesused.python tools/graph_identity.py --check-ext docs/evidence/x00-g1ext-golden-graphs.json: passed before and after, 19/19 graphs equal. Asset-backed SegFormer raw-input drift was reported informationally; graphs and weight-shard plans match.python tools/block_catalogue.py --check: passed, catalogue in sync.python -m pytest -q tests/test_upernet_fusion_optimized.py: 9 passed in 11.47 seconds.sitecustomize.py: 1 expected module skip in 0.14 seconds, no failure.MKL_ENABLE_INSTRUCTIONS=AVX2andSSE4_2: 3 passed, 6 deselected each (4.53 and 4.47 seconds), including the real historical grouped A/B assertions.python tools/live_fixtures.py --offline window/group_product/g4-w7 --output <temporary-output>: passed, zero cloud calls, largest absolute mirror-versus-PyTorch error8.34e-7, zero values over1e-4.python tools/live_fixtures.py --plan window/group_product/g4-w7: within budget, 1 request, 0 assets, 0 tasks; 14 by 14 grid, 2,744 values, 208,749 request bytes.git diff --check: passed.The full suite is left to hosted CI. No live Earth Engine calls were made. This change makes an offline test portable; it adds no live numerical or model-accuracy claim. Hosted CI results are recorded below.
Hosted CI result before fix round 1
Run 41613302939 passed at
5fe7bfe07968b8c803b7c1e2860d08b4c40ca23d:All three jobs completed successfully on the earlier head. Hosted CI for fix round 1 passed; the completed result is recorded below. This PR remains a draft pending independent re-review.
Hosted CI result for fix round 1
Run 41617177380 passed at
08b907a748a0e4f94912e07b3e35ed3f6ee4ab28:All jobs completed successfully. This PR remains a draft for independent re-review and the maintainer’s decision.