Reject sub-MIL-floor cross-compile targets instead of raising - #2
Merged
sbryngelson merged 2 commits intoJun 14, 2026
Merged
Conversation
preflight() queried per-family limits (limit(), defined only at/above the H13+ MIL floor) before checking supports_mil(), so cross_compile_check(graph, 'h11') - a sub-floor target family (Family.OLDER) - raised ValueError instead of returning False. Guard preflight() with supports_mil(): below the floor, report every op rejected (not ok) and skip the floor-only limit lookups. Fixes both cross_compile_check and compile(target=). Host capability is unaffected (an M5 is family 5; only sub-floor TARGETS reject).
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.
Problem
cross_compile_check(graph, "h11")raisedValueErrorinstead of returningFalse:preflight()callslimit("max_tensor_dim", family)(and other per-family caps) at the top, butlimit()is only defined at or above the H13+ MIL floor (Family.A13=2). For a sub-floor target family —Family.OLDER=1, i.e.h11/h12/m9/t0—limit()correctly raises, andpreflightnever reaches itsrep.okrejection path. Socross_compile_check(andcompile(target=), which gates on the samepreflight) crashed on any below-floor target.This is the deterministic failure behind
tests/test_cross_compile.py::test_relu_rejected_below_the_mil_floorin the on-device corpus.Fix
Guard
preflight()with the existingsupports_mil(family)check. Below the floor, report every op as rejected (sorep.okisFalse) without querying the floor-only limits, reusing the function's own graph-walk:Fixed at the root layer (
preflight), so bothcross_compile_checkandcompile(target=)now reject sub-floor targets cleanly.Note: host capability is unaffected
This only changes the verdict for sub-floor target families being cross-compiled for; it does not gate the host. Verified:
Verification
test_relu_rejected_below_the_mil_floornow passes.pytest tests/test_cross_compile.py tests/test_cross_compile_matrix.py tests/test_compile_targets.py tests/test_targets.py: 141 passed.family < 2, which never occurs for real hardware or normal compiles.Branched off
main, independent of the display/ASCII cleanup in #1.