Skip to content

Add initial TileArray programming model and Neura compiler flow - #2

Open
ShangkunLi wants to merge 9 commits into
mainfrom
feature/support-neura-programming
Open

Add initial TileArray programming model and Neura compiler flow#2
ShangkunLi wants to merge 9 commits into
mainfrom
feature/support-neura-programming

Conversation

@ShangkunLi

Copy link
Copy Markdown
Collaborator

Summary

This PR establishes the initial Synapse programming model and compiler flow for explicitly placed programs on a CGRA tile array.

It introduces a Python TileArray DSL, records typed tile-level operations, lowers them through the MLIR Python bindings into a single Taskflow task containing a Neura kernel, and invokes the Amoeba/Neura backend to produce mapped Neura IR.

Key Changes

  • Add the initial Python frontend and AST parser.
  • Add the user-facing TileArray spatial abstraction using Neura-compatible (x, y) coordinates.
  • Add a typed TileArray program representation with initial i32 and f32 support.
  • Add frontend operations for placed constants and additions.
  • Lower a captured TileArray program into:
func.func
  taskflow.task
    neura.kernel
      placed Neura operations
  • Generate Neura placement attributes directly from Tile coordinates.
  • Add a compiler driver that runs:
    • --leverage-predicated-value
    • --insert-data-mov
    • template mapping in spatial-only mode
  • Return the final mapped IR separately from backend diagnostic output.
  • Replace the standalone Neura dependency with a pinned Amoeba submodule, with Neura managed by Amoeba.
  • Add tests for frontend parsing, TileArray semantics, program recording, pre-mapping IR, and final mapped IR.
  • Reorganize Python tests into frontend, language, and compiler directories.
  • Expand the README with LLVM, Amoeba, Python binding, build, and test instructions.
  • Add CI jobs for:
    • Python 3.10 and 3.11 frontend/language tests.
    • Python 3.11 compiler integration using a pinned LLVM revision and locally built Amoeba/Neura bindings.

Current Compiler Flow

Python TileArray program
  → TileArrayProgram
  → Taskflow + placed Neura IR
  → predicated Neura values
  → inserted data movement
  → template mapping
  → mapped tiles, links, registers, and time steps

Current Scope

This PR intentionally targets the first single-task milestone:

  • one implicit Taskflow task;
  • one Neura kernel;
  • explicitly placed TileArray operations;
  • constants and additions;
  • i32 and f32 scalar values.

Task-level syntax, multiple tasks, task dependencies, inter-core communication, automatic template selection, and general structured lowering remain future work.

Testing

The focused local test suite passes:

9 passed

Run it with:

python -m pytest -q \
  tests/python/frontend \
  tests/python/language \
  tests/python/compiler

The compiler tests require the pinned LLVM/MLIR build and the Amoeba Python bindings described in the README.

@ShangkunLi
ShangkunLi requested review from guosran and tancheng August 19, 2026 13: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.

1 participant