-
Notifications
You must be signed in to change notification settings - Fork 15
Enable e2e lowering of neura-compiler with arch #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…e the flag --architecture-spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enables end-to-end lowering in the neura-compiler by adding support for specifying architecture specifications via command-line flags. The YAML parsing logic has been refactored and extracted from MapToAcceleratorPass into reusable utility modules (ArchParser and ParserUtils), improving code organization and maintainability.
Changes:
- Added command-line argument parsing for
--architecture-specflag in both neura-compiler and mlir-neura-opt - Refactored YAML parsing into dedicated utility classes (ArchParser and ParserUtils) for better code reuse
- Updated the compiler pass pipeline to include MapToAcceleratorPass and GenerateCodePass for complete end-to-end lowering
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/neura-compiler/neura-compiler.cpp | Added manual command-line parsing for --architecture-spec flag and implementation of getArchitecture() function |
| tools/mlir-neura-opt/mlir-neura-opt.cpp | Added getArchitecture() function to provide architecture access to passes |
| test/visualize/test2.mlir | Updated test to use --architecture-spec flag and updated FileCheck assertions for new output format |
| lib/NeuraDialect/Util/ParserUtils.cpp | New file containing refactored YAML parsing utility functions |
| lib/NeuraDialect/Util/ArchParser.cpp | New file containing ArchParser class for parsing architecture YAML files |
| lib/NeuraDialect/Transforms/MapToAcceleratorPass.cpp | Removed inline YAML parsing code, now uses getArchitecture() function |
| lib/NeuraDialect/Transforms/GenerateCodePass.cpp | Added max_ctrl_mem_items parameter to Architecture constructor call |
| lib/NeuraDialect/NeuraPasses.cpp | Added MapToAcceleratorPass and GenerateCodePass to the neura-conversion pipeline |
| lib/NeuraDialect/CMakeLists.txt | Added new source files (ArchParser.cpp and ParserUtils.cpp) to build |
| lib/NeuraDialect/Architecture/Architecture.cpp | Added max_ctrl_mem_items parameter to constructor and getter method |
| include/NeuraDialect/Util/ParserUtils.h | New header file declaring parser utility functions |
| include/NeuraDialect/Util/ArchParser.h | New header file declaring ArchParser class |
| include/NeuraDialect/Architecture/Architecture.h | Added max_ctrl_mem_items parameter to constructor, getter method, and getArchitecture() function declaration |
| .github/workflows/main.yml | Optimized git clone with --depth 1 and --filter=blob:none for faster CI builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to create e2e (e.g., create a compiler_e2e folder) test using this compiler? (instead opt invoking each pass)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add it in 62daa94
Related issue: #189
This PR
neura-compilerTODO: