-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Description
Currently in PR #173 , the affine-to-neura lowering pass supports the core loop-based operations (affine.for, affine.load, affine.store, affine.apply) but does not support some other Affine dialect operations.
Currently Supported
affine.for- Loop structures with constant boundsaffine.load/affine.store- Memory access operationsaffine.apply- Affine expression computations
Currently Unsupported
Examples include (but not limited to):
affine.if- Conditional operationsaffine.parallel- Parallel loopsaffine.min/affine.max- Min/max expressionsaffine.forwith dynamic bounds - Loops with runtime-dependent bounds- Other advanced affine constructs
Current Behavior
When encountering unsupported operations, the pass fails with legalization errors. For example, with affine.if:
error: failed to legalize operation 'affine.if' that was explicitly marked illegal
The affine operations remain unchanged in the IR, and the pass reports a failure.
A test file test/Conversion/AffineToNeura/unsupported-affine-if.mlir demonstrates one such case.
Example of Unsupported Case
func.func @affine_if_example(%arg0: memref<10xf32>, %N: index) {
affine.for %i = 0 to 10 {
affine.if affine_set<(d0) : (d0 - 5 >= 0)>(%i) {
%val = affine.load %arg0[%i] : memref<10xf32>
}
}
return
}Reason for Current Limitation
- The Neura dataflow model focuses on loop-based computation with static control flow
- The current implementation targets the most common loop kernels for CGRA acceleration
- Some constructs (like conditionals or dynamic bounds) would require:
- Predicated operations in the dataflow graph
- Additional control flow handling in hardware
- Runtime reconfiguration support
Metadata
Metadata
Assignees
Labels
No labels