Enable e2e lowering of neura-compiler with arch#249
Merged
BenkangPeng merged 18 commits intocoredac:mainfrom Jan 31, 2026
Merged
Enable e2e lowering of neura-compiler with arch#249BenkangPeng merged 18 commits intocoredac:mainfrom
BenkangPeng merged 18 commits intocoredac:mainfrom
Conversation
…e the flag --architecture-spec
BenkangPeng
commented
Jan 26, 2026
Contributor
There was a problem hiding this comment.
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.
tancheng
reviewed
Jan 26, 2026
tancheng
reviewed
Jan 27, 2026
tancheng
approved these changes
Jan 28, 2026
Collaborator
Author
|
Oh, seems that the CI of main branch failed after merging this pr. I will fix it as soon as possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #189
This PR
neura-compilerTODO: