Add bit-exact tests for SonicMoE weight layout kernels#62
Open
A-nnonymous wants to merge 1 commit into
Open
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.
Summary
ernie_compat.weight_layout_fusionentry points:fused_grouped_w1_to_sonicfused_sonic_w1_to_groupedfused_transpose_w2_layoutSONIC_MOE_RUN_LARGE_LAYOUT_TESTS=1so CI can keep the normal path lightweight while still supporting int32-index-boundary validation on large-GPU runners.Large tensor coverage
The opt-in cases allocate BF16 tensors with more than
2^31elements and more than 4GiB per weight tensor, then check high-address sentinel mappings for each layout kernel without building another full-size reference tensor.Validation
python -m py_compile sonicmoe/ernie_compat/weight_layout_fusion.py tests/ops/test_weight_layout_fusion.pyCUDA_VISIBLE_DEVICES=0 python -m pytest -q tests/ops/test_weight_layout_fusion.py54 passed, 3 skippedCUDA_VISIBLE_DEVICES=5 SONIC_MOE_RUN_LARGE_LAYOUT_TESTS=1 python -m pytest -q tests/ops/test_weight_layout_fusion.py -k large_tensor_crosses_int32_boundary3 passedCUDA_VISIBLE_DEVICES=6 SONIC_MOE_RUN_LARGE_LAYOUT_TESTS=1 compute-sanitizer --tool memcheck --leak-check no --target-processes all --error-exitcode 99 --print-limit 20 python -m pytest -q tests/ops/test_weight_layout_fusion.py::test_transpose_w2_large_tensor_crosses_int32_boundary1 passedERROR SUMMARY: 0 errorsCUDA_VISIBLE_DEVICES=6 SONIC_MOE_RUN_LARGE_LAYOUT_TESTS=1 compute-sanitizer --tool memcheck --leak-check no --target-processes all --error-exitcode 99 --print-limit 20 python -m pytest -q tests/ops/test_weight_layout_fusion.py::test_grouped_w1_to_sonic_large_tensor_crosses_int32_boundary tests/ops/test_weight_layout_fusion.py::test_sonic_w1_to_grouped_large_tensor_crosses_int32_boundary2 passedERROR SUMMARY: 0 errorsNo kernel implementation changes are included in this PR.