[Schedule] Allow partitioning the same array on multiple dimensions (#547)#549
Merged
chhzh123 merged 4 commits intocornell-zhang:mainfrom Feb 8, 2026
Merged
Conversation
…ornell-zhang#547) Relax the duplicate partition check to allow partitioning the same array on different dimensions, which the MLIR backend already supports. Update the FEATHER example to use selective per-dimension partitioning instead of the full-partition workaround. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that the generated Vivado HLS code contains per-dimension #pragma HLS array_partition directives for both complete and block partition types when partitioning the same array on multiple dimensions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Relaxes Schedule.partition()’s duplicate-partition guard to allow partitioning the same array across different dimensions (fixing #547), aligns the FEATHER example with the intended per-dimension partitioning strategy, and adds a regression test covering multi-dimension partition behavior with HLS codegen checks.
Changes:
- Update
Schedule.partition()to permit multiple partitions on the same array as long as they target different dimensions. - Update FEATHER example to partition
weightson dimensions 2 and 3 instead of fully partitioning all dimensions. - Add
test_partition_multi_dimto validate multi-dim partition combinations and expected HLS pragmas, plus error cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
allo/customize.py |
Relaxes duplicate-partition validation to allow per-dimension composition while still blocking conflicting cases. |
examples/feather/feather.py |
Switches from full-partition workaround to explicit per-dimension partitions on weights. |
tests/test_schedule_memory.py |
Adds a new test covering multi-dimension partitioning and HLS pragma emission expectations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback: make the error message for mixing all-dim (dim=0) with per-dimension partitions more descriptive. Co-Authored-By: Claude Opus 4.6 <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.
Summary
Schedule.partition()to allow partitioning the same array on different dimensions, fixing [Bug] Cannot partition the same array on multiple dimensions #547#pragma HLS array_partitiondirectives — the error was an overly restrictive Python-level checktest_partition_multi_dimcovering complete, block, cyclic, and mixed-type multi-dim partitions with HLS codegen verificationTest plan
python -m pytest tests/test_schedule_memory.py::test_partition_multi_dim -v— new test passespython -m pytest tests/test_schedule_memory.py -k partition -v— all 11 partition tests pass🤖 Generated with Claude Code