Replies: 1 comment
No. There is no runtime-indexed gather, scatter, or arbitrary-permute instruction in the AIE2 ISA.
I don't know of an existing example, so I've attempted a vectorized butterfly network to implement the left-pack step, which beats the naive scalar version by ~3.6x: https://github.com/Xilinx/mlir-aie/tree/vector_compact/programming_examples/basic/vector_compact I've only tested on aie2p. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context. I've been hand-authoring AIE2 kernels (gen-1 XDNA1 / Phoenix,
npu1, via IRON + Peano) for a non-bijunctive "collapse/prune" primitive: threshold a vector, then left-pack the survivors into a dense prefix (stream compaction). Repo for context: https://github.com/Scottcjn/open-xdnaWhat I found in the vector API:
aie::shuffleand friends (shuffle_up/shuffle_down, rotate, interleave,select) are structured — the permute/select pattern is fixed at compile time or a fixed shift, not a data-dependent runtime index vector.dst[i] = src[idx[i]]/dst[idx[i]] = src[i]whereidxis a runtime vector — analogous to x86vpgatherdd/pshufbor PPCvec_permwith a runtime control vector. Nor aload_gather/store_scatter.Consequence. SIMD stream-compaction (left-pack) isn't directly expressible on the AIE2 vector unit, because the placement step needs a data-dependent scatter. I vectorized the threshold/select fine, but fell back to the scalar unit for the actual compaction.
Questions:
aieAPI that I missed?Not a complaint — just trying to confirm whether this is a genuine ISA boundary or a missing API. Thanks!
All reactions