vx-lang / vx-lang/Vx

[Feature] Native SIMD Support & MLIR Vector Dialect Integration

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

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:
  1. AST & Parser:

    • Introduce Type::Simd(ElementType, usize) into the ast::Type enumeration.
    • Implement syntax for vector types: <N x T> (e.g., <4 x f32>).
  2. MLIR Codegen:

    • Lower Type::Simd directly to MLIR's VectorType (vector<4xf32>).
    • Implement lowering for arithmetic binary operations (Add, Sub, Mul, Div) into vector.addf, vector.mulf, etc.
    • Support vector loads and stores via pointer dereferencing.
  3. Benchmarks:

    • Modify the transformer() inference loop in llama2_100.vx and llama2.vx to leverage <4 x f32> SIMD operations, replacing purely scalar loops.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.