[Feature] Native SIMD Support & MLIR Vector Dialect Integration
Open
Nobody has claimed this yet.
codegen
core-lang
enhancement
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 61
Description
We need to implement native SIMD support in the Vx compiler to accelerate AI workloads like the LLaMA-2 inference benchmark.
Proposed Changes:
-
AST & Parser:
- Introduce
Type::Simd(ElementType, usize)into theast::Typeenumeration. - Implement syntax for vector types:
<N x T>(e.g.,<4 x f32>).
- Introduce
-
MLIR Codegen:
- Lower
Type::Simddirectly to MLIR'sVectorType(vector<4xf32>). - Implement lowering for arithmetic binary operations (
Add,Sub,Mul,Div) intovector.addf,vector.mulf, etc. - Support vector loads and stores via pointer dereferencing.
- Lower
-
Benchmarks:
- Modify the
transformer()inference loop inllama2_100.vxandllama2.vxto leverage<4 x f32>SIMD operations, replacing purely scalar loops.
- Modify the
This is a critical requirement to remove the $O(N^2)$ scalar math bottleneck in self-attention.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the AST/parser and MLIR codegen entry points, then inspect the transformer() inference loops in llama2_100.vx and llama2.vx. The work is done when types, vector arithmetic, loads, and stores lower correctly and the benchmark loops use <4 x f32> SIMD operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100