Repository navigation
Fix the CoreAI op-order check of the joint sparsity + palettization e2e test - #171
Merged
dengqiaoyu merged 1 commit intoOct 28, 2026
Merged
Conversation
…d program The CoreAI order check of the joint sparsity + palettization e2e test parsed the lowered MLIR text for coreai.build_sparse_with_bitmask and coreai.sparse_with_bitmask_to_dense. That passes with the public coreai-core / coreai-torch, but the internal CI installs internal Core AI builds that do not lower the sparse ops to those names, so the six CoreAI test_mnist cases and both test_mnist_vector_palettization cases failed with "assert 0 == 6" even though the conversion and the output comparison passed. Check the order on the exported torch program instead (lut_to_dense -> sparse_to_dense -> constexpr_blockwise_shift_scale), which is what coreai-opt produces and which the test already uses to count the ops, so it no longer depends on how a Core AI version lowers or prints them. The CoreML check on the MIL program is unchanged.
dengqiaoyu
self-requested a review
October 28, 2026 20:19
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.
What:
tests/export/test_joint_sparsity_palettization_e2e.pyso it passes with any Core AI build, not only the one it was written againstWhy:
coreai.build_sparse_with_bitmaskandcoreai.sparse_with_bitmask_to_dense. Builds of Core AI that lower the sparse ops under other names make it fail withassert 0 == 6, even though the conversion and the output comparison pass. That fails the six CoreAItest_mnistcases and bothtest_mnist_vector_palettizationcases.How:
lut_to_dense->sparse_to_dense->constexpr_blockwise_shift_scale(the last one only when a per-channel scale or a quantized LUT is used). This is the layercoreai-optproduces, and the test already uses it to count the ops, so the check no longer depends on how a Core AI version lowers or prints them._export(..., check_order=True), so the tests no longer call a separate_assert_op_order.Testing:
coreai-coreandcoreai-torchreleases.lut_to_denseandsparse_to_densemakes the same eight CoreAI cases fail, so the check still guards the order.