Add initial TileArray programming model and Neura compiler flow - #2
Merged
Conversation
guosran
reviewed
Aug 22, 2026
guosran
reviewed
Aug 22, 2026
guosran
reviewed
Aug 24, 2026
guosran
reviewed
Aug 24, 2026
guosran
reviewed
Aug 24, 2026
guosran
reviewed
Aug 24, 2026
guosran
reviewed
Aug 24, 2026
guosran
reviewed
Aug 25, 2026
guosran
reviewed
Aug 25, 2026
guosran
reviewed
Aug 25, 2026
Collaborator
|
Yeah I mean one constructor for each single operations.
________________________________
From: Shangkun LI ***@***.***>
Sent: Tuesday, 25 August 2026 19:36:28
To: coredac/synapse ***@***.***>
Cc: GUO Shiran ***@***.***>; Review requested ***@***.***>
Subject: Re: [coredac/synapse] Add initial TileArray programming model and Neura compiler flow (PR #2)
@ShangkunLi commented on this pull request.
________________________________
In python/synapse/frontend/lowering.py<#2 (comment)>:
@@ -103,6 +105,41 @@ def get_placement(tile: Tile) -> DictAttr:
}
)
+ @singledispatch
+ def lower_operation(operation: TileArrayOp, operands, result_type):
+ """Lower one frontend TileArray operation to a Neura operation.
+
+ The caller handles common lowering such as resolving operands,
+ attaching placement, and recording the resulting SSA value.
+ """
+ raise NotImplementedError(
+ f"unsupported tile-array operation: {type(operation).__name__}"
+ )
+
+ @lower_operation.register
+ def lower_constant(operation: ConstantOp, operands, result_type):
But we may have some additional checking other than just the number of operands, so it would be better to implement operation-specific checking.
—
Reply to this email directly, view it on GitHub<#2?email_source=notifications&email_token=BHMYV7VBOT3HWINWHAI26N35LV23ZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMBRHA2DANZXGUZKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#discussion_r3852553409>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHMYV7SHJTIRJR2P3U2M7BD5LV23ZAVCNFSNUABGKJSXA33TNF2G64TZHMYTENZQGMZTGMJZGE5US43TOVSTWNJRHEZDSNBSHA3DHILWAI>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
Collaborator
|
Got it
________________________________
From: Shangkun LI ***@***.***>
Sent: Tuesday, 25 August 2026 19:42:36
To: coredac/synapse ***@***.***>
Cc: GUO Shiran ***@***.***>; Review requested ***@***.***>
Subject: Re: [coredac/synapse] Add initial TileArray programming model and Neura compiler flow (PR #2)
@ShangkunLi commented on this pull request.
________________________________
In python/synapse/language/tile_array_program.py<#2 (comment)>:
-# This union explicitly lists every operation currently supported by the
-# tile-array frontend. Future operations such as MacOp and GatherOp should be
-# added here.
-TileArrayOp: TypeAlias = ConstantOp | AddOp
***@***.***(frozen=True)
+class AddOp(TileArrayOp):
+ """A scalar addition executed by a tile-array operation."""
But add and constant are used to define the API exposed to users.
—
Reply to this email directly, view it on GitHub<#2?email_source=notifications&email_token=BHMYV7RD7KA32BRL54OJ4HD5LV3SZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMBRHA2DKNRUGYZKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#discussion_r3852596530>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHMYV7VSC23KT3IWND7YHYT5LV3SZAVCNFSNUABGKJSXA33TNF2G64TZHMYTENZQGMZTGMJZGE5US43TOVSTWNJRHEZDSNBSHA3DHILWAI>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
guosran
approved these changes
Aug 26, 2026
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
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
TileArrayspatial abstraction using Neura-compatible(x, y)coordinates.i32andf32support.--leverage-predicated-value--insert-data-movCurrent Compiler Flow
Current Scope
This PR intentionally targets the first single-task milestone:
i32andf32scalar 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:
Run it with:
The compiler tests require the pinned LLVM/MLIR build and the Amoeba Python bindings described in the README.