Epic: Migrate to Formal MLIR Rust Crate (`melior`) for Hardware Plugin IR Generation
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 61
Description
The current plugin architecture uses lightweight, string-based mocking for MLIR generation (Operation, Module structs in hardware_trait.rs). To fully comply with the formal VxHardwarePlugin contract, we must replace this mock strategy with robust, AST-based MLIR generation utilizing a proper Rust bindings crate (such as melior).
Rationale
Relying on string concatenation for IR generation does not scale to complex hardware topologies and hinders modular optimization passes. A formal MLIR crate ensures type safety, predictable lowering, and standard validation before binary generation.
Subtasks
- Investigate and integrate
melior(or another suitable MLIR Rust binding library) into theVxbuild system. - Refactor
codegen.rsto construct an actual MLIR Context, Module, and Operations using the library's AST instead ofStringaccumulation. - Update
VxHardwarePlugintrait to pass nativemelior::ir::Operationpointers. - Migrate
AppleNPEPlugin(and any other reference plugins) to utilize the formal MLIR inputs for their vendor-specific passes and lowering. - Ensure the JIT execution (
lli) andmlir-optpipeline interacts correctly with the dynamically produced MLIR.
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 with hardware_trait.rs and codegen.rs to understand the current string-based Operation and Module flow, then inspect the Vx build system and AppleNPEPlugin integration. Review how lli and mlir-opt are currently invoked. Done means the formal MLIR crate is integrated, plugins use native IR inputs, and the JIT and optimization pipeline still interact correctly with generated MLIR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100