[Pallas] Use fori_loop if loop bounds includes non-constexpr symbolic values#1927
Merged
Conversation
AmesingFlank
added a commit
that referenced
this pull request
Apr 2, 2026
… values stack-info: PR: #1927, branch: AmesingFlank/stack/3
927f4d5 to
31c7abf
Compare
v0i0
reviewed
Apr 2, 2026
AmesingFlank
added a commit
that referenced
this pull request
Apr 2, 2026
… values stack-info: PR: #1927, branch: AmesingFlank/stack/3
31c7abf to
2314a4c
Compare
… values stack-info: PR: #1927, branch: AmesingFlank/stack/3
2314a4c to
ad0f62f
Compare
v0i0
approved these changes
Apr 3, 2026
norx1991
added a commit
that referenced
this pull request
Apr 3, 2026
For single-tile Pallas kernels with no inner loops, pallas_loop_type (emit_pipeline/fori_loop) is meaningless and wastes autotuner trials. Move the fragment registration from PallasBackend.tunable_fragments() to ConfigSpec._flat_fields(), gated on a has_pallas_inner_loops flag that is set during tracing when an inner device loop is encountered. Also simplify the symbolic-bounds logic from #1927: instead of mutating backend_tunable_fragments, set a has_pallas_symbolic_bounds flag and filter out "default" when building the fragment in _flat_fields().
norx1991
added a commit
that referenced
this pull request
Apr 3, 2026
For single-tile Pallas kernels with no inner loops, pallas_loop_type (emit_pipeline/fori_loop) is meaningless and wastes autotuner trials. Move the fragment registration from PallasBackend.tunable_fragments() to ConfigSpec._flat_fields(), gated on a has_pallas_inner_loops flag that is set during tracing when an inner device loop is encountered. Also simplify the symbolic-bounds logic from #1927: instead of mutating backend_tunable_fragments, set a has_pallas_symbolic_bounds flag and filter out "default" when building the fragment in _flat_fields().
norx1991
added a commit
that referenced
this pull request
Apr 3, 2026
For single-tile Pallas kernels with no inner loops, pallas_loop_type (emit_pipeline/fori_loop) is meaningless and wastes autotuner trials. Move the fragment registration from PallasBackend.tunable_fragments() to ConfigSpec._flat_fields(), gated on a has_pallas_inner_loops flag that is set during tracing when an inner device loop is encountered. Also simplify the symbolic-bounds logic from #1927: instead of mutating backend_tunable_fragments, set a has_pallas_symbolic_bounds flag and filter out "default" when building the fragment in _flat_fields().
norx1991
added a commit
that referenced
this pull request
Apr 3, 2026
For single-tile Pallas kernels with no inner loops, pallas_loop_type (emit_pipeline/fori_loop) is meaningless and wastes autotuner trials. Move the fragment registration from PallasBackend.tunable_fragments() to ConfigSpec._flat_fields(), gated on a has_pallas_inner_loops flag that is set during tracing when an inner device loop is encountered. Also simplify the symbolic-bounds logic from #1927: instead of mutating backend_tunable_fragments, set a has_pallas_symbolic_bounds flag and filter out "default" when building the fragment in _flat_fields().
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.
Stacked PRs:
The "default" loop type requires constexpr loop bounds. So if we have that, remove the "default" loop type and use
fori_looporemit_pipelineinstead.