Share BD size/stride verification between AIE and AIEX dialects (#2566)#3109
Draft
hunhoffe wants to merge 1 commit into
Draft
Share BD size/stride verification between AIE and AIEX dialects (#2566)#3109hunhoffe wants to merge 1 commit into
hunhoffe wants to merge 1 commit into
Conversation
…linx#2566) Factors the size/stride/granularity portion of AIEX::verifyStridesWraps into a shared helper AIE::verifyBDSizesStrides, called from both DMABDOp::verify and the AIEX BD-emitting paths. This (1) lets DMABDOp accept inner-dim strides > 1 on sub-32b types when stride*elemWidth is a granularity multiple (previously rejected outright), and (2) makes DMABDOp reject sub-word innermost contiguous runs (previously silently accepted). The bfp/>32b inner-stride==1 constraint from Xilinx#2435 is preserved in the shared helper. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
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.
Closes #2566.
AIEX::verifyStridesWrapsalready had a careful granularity-based check for BD sizes and strides — this PR pulls the size/stride/granularity portion into a shared helperAIE::verifyBDSizesStridessoaie.dma_bd's verifier can use the same logic. Two follow-on behavior changes fall out:aie.dma_bdnow accepts inner-dim strides > 1 on sub-32b types whenstride × elemWidthis a multiple of the address granularity (e.g.memref<128xi16>, [<size=32, stride=2>]— 2 × 16b = 32b, perfectly word-aligned). The previous blanket check rejected these even though hardware can encode them.aie.dma_bdnow rejects sub-word innermost contiguous runs (e.g.memref<128xi8>, [<size=3, stride=4>, <size=2, stride=1>]— innermost run = 2 bytes). The AIEX path already caught these; the AIE path didn't.The
elemWidth > granularityconstraint added in #2435 (innermost stride must be 1 for bfp / wide types) is preserved in the shared helper, matching the silentstrides[0] = 0behavior ingetHardwareStridesWraps.