Skip to content

Introduce placement pass#2900

Merged
yenjames merged 11 commits intomainfrom
sequential-placer-pass
Mar 30, 2026
Merged

Introduce placement pass#2900
yenjames merged 11 commits intomainfrom
sequential-placer-pass

Conversation

@yenjames
Copy link
Copy Markdown
Collaborator

@yenjames yenjames commented Feb 26, 2026

Summary

This PR implements the --aie-place-tiles pass with sequential placer algorithm, completing logical-to-physical tile mapping.

Changes

  • New pass definition that can be extended with other placer algorithm.
  • Follows structure similar to AIEPathfinder pass.
  • Not registered to aiecc for now.
  • Removed "Pure" class from aie.logical_tile, noticed canonicalization pass was removing logical_tiles because they appear identical in mlir.

Future PR

  • Enhance placer to handle ShimPL tiles.
  • Consolidate with ObjectFifo refactor plans.

Update (2026-03-18): Change plans to merge this PR first as it's self isolated. Will introduce this pass without registering to aiecc.cpp and part of lowering pipeline. This pass has been verified with local tests.


Update (2026-03-24):
Review Changes:

  • Placer as a typed enum option.
  • Support partially constrained tiles with sequential placer. These are provided a "filtered" list of candidate tiles for them to map to.
  • Additional tests: mem/shim/compute tile exhaustion, cores-per-col exceeding device capacity, exact capacity fitting.
  • Added checks to tests to ensure tiles are actually merged (by checking next tile in coordinate system wasn't created).

@yenjames yenjames force-pushed the sequential-placer-pass branch from 1997911 to 388a061 Compare February 26, 2026 22:47
@yenjames yenjames force-pushed the sequential-placer-pass branch 2 times, most recently from 05ef19a to 077a736 Compare February 27, 2026 22:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2026

Coverage Report

Created: 2026-03-27 17:59

Click here for information about interpreting this report.

FilenameFunction CoverageLine CoverageRegion CoverageBranch Coverage
include/aie/Dialect/AIE/Transforms/AIEPasses.h 100.00% 100.00% 100.00% -
include/aie/Dialect/AIE/Transforms/AIEPlacer.h 80.00% 80.00% 77.78% 50.00%
lib/Dialect/AIE/Transforms/AIEPlaceTiles.cpp 100.00% 92.50% 90.48% 71.43%
lib/Dialect/AIE/Transforms/AIEPlacer.cpp 100.00% 95.90% 94.96% 85.59%
Totals 95.83% 95.31% 94.12% 84.52%
Generated by llvm-cov -- llvm version 18.1.3

yenjames and others added 5 commits March 18, 2026 15:03
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… are placed correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nnected by objectfifo.link together.

- The common column function was incorrectly obtaining a global best column when it should be by fifo or fifoGroup if linked.
- Reformatted the placement code structure; PlacementAnalysis is kept thin, considered removal but this allows re-calling placer
or even a set of placers if future implementation is iterative placement.
- Each placer will obtain its own necessary mlir ops.
- Canonicalization was accidentally removing logical tiles because they appear the same in syntax; removed Pure trait.
TODO:
- Trace support is not added for IRON and mlir itself; trace operations aren't mapped to use aie.logical_tile.
- cores_per_column that limits sequentialplacer's row usage feature not implemented yet.
@yenjames yenjames force-pushed the sequential-placer-pass branch from 077a736 to 1ea63ec Compare March 18, 2026 21:16
@yenjames yenjames changed the base branch from logical-tile-iron to main March 18, 2026 21:18
- Add GEN_PASS_DEF_AIEPLACETILES to properly generate pass base class
- Use fully qualified xilinx::AIE::impl::AIEPlaceTilesBase for CRTP
- Add -split-input-file flag to cores_per_col test for multi-module files
- Revert example changes (pass not yet registered to aiecc pipeline)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yenjames yenjames force-pushed the sequential-placer-pass branch from 1ea63ec to 5d4d200 Compare March 18, 2026 21:25
- Add MemTile DMA exhaustion test (single-column device)
- Add allocation_scheme attribute copy test
- Add unknown placer error test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yenjames yenjames marked this pull request as ready for review March 19, 2026 21:18
Copilot AI review requested due to automatic review settings March 19, 2026 21:18
Copy link
Copy Markdown
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

This PR introduces a new --aie-place-tiles MLIR pass that performs logical-to-physical tile placement using a C++ sequential placer, then rewrites aie.logical_tile ops into concrete aie.tile ops.

Changes:

  • Add AIEPlaceTiles pass + options (placer, cores-per-col) and wire it into the AIE transforms library build.
  • Implement a C++ Placer interface with an initial SequentialPlacer + PlacementAnalysis.
  • Add a focused lit test suite for sequential placement behavior and error cases; adjust aie.logical_tile traits to avoid incorrect IR canonicalization/CSE.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/place-tiles/unknown_placer.mlir Verifies unknown placer option produces an error.
test/place-tiles/sequential_placer/test_objectfifo_link.mlir Tests placement behavior around aie.objectfifo.link grouping/column choice.
test/place-tiles/sequential_placer/place_tiles_simple.mlir Tests basic core placement and attribute propagation (allocation_scheme).
test/place-tiles/sequential_placer/place_tiles_objectfifo.mlir Tests mem/shim/core placement interactions across multiple ObjectFifos/consumers.
test/place-tiles/sequential_placer/place_tiles_constrained.mlir Tests fully constrained and mixed constrained/unconstrained placement cases.
test/place-tiles/sequential_placer/partial_constraints_ignored.mlir Documents current behavior: partial constraints are ignored.
test/place-tiles/sequential_placer/edge_detect.mlir End-to-end style test matching expected placement for an edge-detect pattern.
test/place-tiles/sequential_placer/cores_per_col.mlir Tests cores-per-col option spreads cores across columns.
test/place-tiles/sequential_placer/channel_capacity_bad.mlir Negative tests for DMA channel capacity validation / exhaustion.
lib/Dialect/AIE/Transforms/CMakeLists.txt Adds new placer + placement pass sources to the transforms library.
lib/Dialect/AIE/Transforms/AIEPlaceTiles.cpp Implements the --aie-place-tiles pass and logical→physical tile rewrite.
lib/Dialect/AIE/Transforms/AIEPlacer.cpp Implements the sequential placement algorithm + channel accounting and grouping.
include/aie/Dialect/AIE/Transforms/AIEPlacer.h Declares placer interface and sequential placer/analysis types.
include/aie/Dialect/AIE/Transforms/AIEPasses.td Declares the new aie-place-tiles pass and CLI options.
include/aie/Dialect/AIE/Transforms/AIEPasses.h Exposes createAIEPlaceTilesPass() factory.
include/aie/Dialect/AIE/IR/AIEOps.td Removes Pure from aie.logical_tile to prevent incorrect CSE/canonicalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Dialect/AIE/Transforms/AIEPlacer.cpp
Comment thread lib/Dialect/AIE/Transforms/AIEPlacer.cpp Outdated
Comment thread lib/Dialect/AIE/Transforms/AIEPlacer.cpp
Comment thread include/aie/Dialect/AIE/Transforms/AIEPlacer.h Outdated
Comment thread lib/Dialect/AIE/Transforms/AIEPlacer.cpp Outdated
Comment thread lib/Dialect/AIE/Transforms/AIEPlaceTiles.cpp
- Add ShimPLTile error diagnostic for unsupported unplaced ShimPLTiles
- Add fallback placement for non-core tiles not in ObjectFifos
- Fix comment: row-major -> column-major placement
- Reduce over-commenting in AIEPlacer.cpp
- Reorganize tests: consolidate 8 files into 5 with split-input-file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread test/place-tiles/unknown_placer.mlir Outdated
Copy link
Copy Markdown
Collaborator

@hunhoffe hunhoffe left a comment

Choose a reason for hiding this comment

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

Overall, this looks very good! I'd prefer a bit more testing (although the current Placer isn't that well tested).

Comment thread lib/Dialect/AIE/Transforms/AIEPlacer.cpp Outdated
Comment thread lib/Dialect/AIE/Transforms/AIEPlacer.cpp
Comment thread lib/Dialect/AIE/Transforms/AIEPlaceTiles.cpp Outdated
Comment thread test/place-tiles/sequential_placer/test_place_basic.mlir Outdated
//
//===----------------------------------------------------------------------===//

// RUN: not aie-opt --split-input-file --aie-place-tiles %s 2>&1 | FileCheck %s
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are there any other error cases you need to check?

}

// -----

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think there need to be a few more tests about column grouping, exceeding channels (so place near column group)

@@ -0,0 +1,155 @@
//===- test_place_basic.mlir -----------------------------------*- MLIR -*-===//
//
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There might need to be a test for "exactly fills capacity" in various ways. It's good to double check the edge cases.

Comment thread test/place-tiles/sequential_placer/test_place_options.mlir
Comment thread test/place-tiles/test_placer_unknown.mlir
…roved tests

  - Convert placer pass option from string to enum (PlacerType)
  - Fix partial constraint support for CoreTile, MemTile, and ShimTile
  - Add cores-per-col validation against device capacity

  Test improvements:
  - Use separate logical tiles per fifo to properly test merging behavior
  - Add CHECK-NOT patterns to verify no extra tiles created during merging
  - Add exact capacity tests (core, shim, memtile channel limits)
  - Add overflow tests (partial capacity remaining triggers new tile)
  - Add error tests: ShimNOC/MemTile exhaustion, compute tile exhaustion
Copy link
Copy Markdown
Collaborator

@hunhoffe hunhoffe left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the changes/tests

@yenjames yenjames enabled auto-merge March 27, 2026 17:41
@yenjames yenjames added this pull request to the merge queue Mar 27, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 28, 2026
@yenjames yenjames added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit c7741f2 Mar 30, 2026
71 checks passed
@yenjames yenjames deleted the sequential-placer-pass branch March 30, 2026 15:52
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.

3 participants