Repository navigation
Converter tests: an L-shaped synthetic map from preset M's layout - #98
Merged
Merged
Conversation
cases.l_shaped_map turns the preset-M map's layout into an L-shaped one: the input encoder's output linear 64 x 128, a stage with two linears and a C = 32 Swin block before enc0, a C = 32 Swin block before dec0, "preset": "L". run_tests.py fills it with random data (shipped_like_case) and checks every tensor at two placements, and preset L's message for a file without the block. Stage names and placement are stand-ins until the real preset-L map exists. No converter source changes. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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.
#94's preset-L test uses a minimal synthetic map. This adds an L-shaped one: preset M's real map layout, turned into
the shape Model L's map is described to have, filled with our own random data. That way the converter is exercised at L's
record kinds and sizes before the real preset-L map exists. Tests only; no converter source changes.
clean/converter/tests/cases.pyl_shaped_map(m_map): starts from the shipped preset-M map's layout and makes:enc0W) 64 x 128 (M: 64 x 80);enc0_prebeforeenc0: two linears, 20 -> 32 and 32 -> 32, with biases, then a C = 32 Swin block(the usual record set: gamma1, gamma2, Wqk, Wv, B, Wp, bp, W1, b1, W2, b2; 2 heads, 16 x 16 position bias, MLP 128);
dec0_prebeforedec0: a C = 32 Swin block;"preset": "L", map version 1, no source F (whether L has the output-filter group is open).The new records are appended after M's block in W. The stage names, order and placement are stand-ins: the real
preset-L map defines its own. Only the record kinds and shapes follow L's description.
clean/converter/tests/run_tests.pytest_l_shaped: the map is filled with random data by the existingshipped_like_caseat two placements (W at an even offset and at one shifted by 2 bytes). For each, every tensor ofevery stage is checked against the reference, together with the offsets, all stage digests, the 64 x 128 encoder
linear and the 11 records of each C = 32 block. A file with another block of the same layout gives preset L's
message (exit 12). It runs with the other large cases (not under
--quick).clean/converter/README.md: a short paragraph. It also records one open point found here: a map of versions 1-4must have the sources W, D and K. Should preset L turn out to have no dither table or constants, that rule becomes per
preset; it is not changed on a guess.
Refs #89
Tested
Run locally on Windows, CPU only, Ninja Release
/MTwith MSVC, on main 3a6d9e7 plus this commit.ctest(unit, decompression-vectors, synthetic, synthetic5): 4/4 passed.run_tests.py: 4481 checks passed, 0 failed (main: 3757; the 724 more aretest_l_shaped).identical to main's.
python tools/ci/check_line_endings.py: 1150 files, 0 problems. Public gates (secrets, personal data, licence,chunks) pass.
Not tested