Skip to content

Comments

[Schedule] Allow partitioning the same array on multiple dimensions (#547)#549

Merged
chhzh123 merged 4 commits intocornell-zhang:mainfrom
zzzDavid:fix-multi-dim-partition
Feb 8, 2026
Merged

[Schedule] Allow partitioning the same array on multiple dimensions (#547)#549
chhzh123 merged 4 commits intocornell-zhang:mainfrom
zzzDavid:fix-multi-dim-partition

Conversation

@zzzDavid
Copy link
Contributor

@zzzDavid zzzDavid commented Feb 8, 2026

Summary

  • Relaxes the duplicate partition check in Schedule.partition() to allow partitioning the same array on different dimensions, fixing [Bug] Cannot partition the same array on multiple dimensions #547
  • The MLIR backend already supports composing multiple partition layout maps, and the HLS emitter already emits per-dimension #pragma HLS array_partition directives — the error was an overly restrictive Python-level check
  • Updates the FEATHER example to use selective per-dimension partitioning instead of the full-partition workaround
  • Adds test_partition_multi_dim covering complete, block, cyclic, and mixed-type multi-dim partitions with HLS codegen verification

Test plan

  • python -m pytest tests/test_schedule_memory.py::test_partition_multi_dim -v — new test passes
  • python -m pytest tests/test_schedule_memory.py -k partition -v — all 11 partition tests pass
  • Lint checks pass (license headers, black, clang-format)

🤖 Generated with Claude Code

zzzDavid and others added 3 commits February 7, 2026 00:49
…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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 weights on dimensions 2 and 3 instead of fully partitioning all dimensions.
  • Add test_partition_multi_dim to 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>
Copy link
Member

@chhzh123 chhzh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@chhzh123 chhzh123 merged commit f7b5e26 into cornell-zhang:main Feb 8, 2026
1 check passed
@zzzDavid zzzDavid deleted the fix-multi-dim-partition branch February 8, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants