[Pallas] Fix block size constraint assuming spec order matches tensor dim order#1987
Closed
[Pallas] Fix block size constraint assuming spec order matches tensor dim order#1987
Conversation
… dim order The fallback `ndim - 1 - i` in `adjust_block_size_constraints` assumed BlockSizeSpec ordering matches tensor dimension ordering. For `hl.tile([M, N, B])` on a tensor with shape `[B, M, N]`, B is the last spec (i=2) but maps to the first tensor dim (dfe=2). The fallback computed dfe=0, incorrectly applying 128-alignment to a small batch dim. Skip alignment constraints when no tensor dim mapping is found instead of guessing from the spec index.
a87f98b to
5a5b54b
Compare
Contributor
Author
|
Closing — the fallback code being fixed is effectively dead code. Every block_id maps to at least one tensor dimension through dim_matches(), so min_dim_from_end.get(bid) never returns None in practice. Will fold this cleanup into PR #1972 instead. |
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
adjust_block_size_constraintsfallback that assumed BlockSizeSpec ordering matches tensor dimension orderingndim - 1 - icomputed wrongdim_from_endwhen tile order differs from tensor dim order (e.g.,hl.tile([M, N, B])on tensor[B, M, N])