Skip to content

Conversation

@BenkangPeng
Copy link
Collaborator

@BenkangPeng BenkangPeng commented Jan 26, 2026

Related issue: #189

This PR

  • Enables end-to-end lowering pipeline in neura-compiler
  • Adds support for specifying the architecture_spec via command-line flags
  • The YAML parsing logic has been refactored and moved out of passes.

TODO:

  • Pass the architecture into CodeGenPass.

@BenkangPeng BenkangPeng changed the title Enable e2e test with arch Enable e2e lowering of neura-compiler with arch Jan 26, 2026
Copy link
Contributor

Copilot AI left a 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-spec flag 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 tancheng requested a review from n0thingNoob January 26, 2026 22:49
Copy link
Contributor

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it in 62daa94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants