-
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
Open
BenkangPeng
wants to merge
18
commits into
coredac:main
Choose a base branch
from
BenkangPeng:enable-e2e-test-with-arch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e2b6996
Add the process of arch file.
BenkangPeng 2f8d9c8
Add the LowerArithToNeura pass.
BenkangPeng 5bf0395
[CI] Shallow clone llvm.
BenkangPeng 4a3d75f
Add LowerAffineToNeura pass to neura-compiler.
BenkangPeng 0cce2fe
Add passes to neura-compiler
BenkangPeng 9b3ad44
[Refactor] Move parser utils into seperate files.
BenkangPeng c001406
Add max_ctrl_mem_items into the constructor.
BenkangPeng a3cea71
Add ArchParser component
BenkangPeng 06a2008
[Refactor] Moving the logic of parsing yaml out from passes and enabl…
BenkangPeng 8f9517e
Add the createPrintOpGraphPass and update related test.
BenkangPeng 37882d7
[Fix] Fix the check-prefix.
BenkangPeng 2a50a48
[CleanUp] Remove the dead code
BenkangPeng 91c572a
[Fix] Fix the error-prefix.
BenkangPeng 82f6eaa
[Fix] Update the pass pipeline of neura-compiler
BenkangPeng d96f89b
Use the singleton pattern to return Architecture object
BenkangPeng b3ea845
Pass the const architecture object into GenerateCodePass
BenkangPeng 62daa94
Add e2e test of neura-compiler
BenkangPeng d8746f7
Add fir test and visualize test
BenkangPeng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #ifndef NEURA_ARCH_PARSER_H | ||
| #define NEURA_ARCH_PARSER_H | ||
|
|
||
| #include "NeuraDialect/Architecture/Architecture.h" | ||
| #include "llvm/Support/YAMLParser.h" | ||
| #include "mlir/Support/LogicalResult.h" | ||
|
|
||
| namespace mlir { | ||
| namespace neura { | ||
| namespace util { | ||
| class ArchParser { | ||
| public: | ||
| ArchParser(const std::string &architecture_spec_file); | ||
| ~ArchParser() = default; | ||
|
|
||
| mlir::FailureOr<Architecture> getArchitecture(); | ||
|
|
||
| private: | ||
| std::string architecture_spec_file; | ||
| bool parseArchitectureYaml( | ||
| llvm::yaml::Document &doc, int &multi_cgra_rows, int &multi_cgra_columns, | ||
| mlir::neura::BaseTopology &multi_cgra_base_topology, int &per_cgra_rows, | ||
| int &per_cgra_columns, mlir::neura::BaseTopology &per_cgra_base_topology, | ||
| int &max_ctrl_mem_items, mlir::neura::TileDefaults &tile_defaults, | ||
| std::vector<mlir::neura::TileOverride> &tile_overrides, | ||
| mlir::neura::LinkDefaults &link_defaults, | ||
| std::vector<mlir::neura::LinkOverride> &link_overrides); | ||
| }; | ||
| } // namespace util | ||
| } // namespace neura | ||
| } // namespace mlir | ||
| #endif // NEURA_ARCH_PARSER_H |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #ifndef NEURA_PARSER_UTILS_H | ||
| #define NEURA_PARSER_UTILS_H | ||
|
|
||
| #include "NeuraDialect/Architecture/ArchitectureSpec.h" | ||
| #include "NeuraDialect/Util/NeuraYamlKeys.h" | ||
| #include "llvm/ADT/SmallString.h" | ||
| #include "llvm/Support/YAMLParser.h" | ||
| #include "llvm/Support/raw_ostream.h" | ||
|
|
||
| namespace mlir { | ||
| namespace neura { | ||
| namespace util { | ||
| bool parseYamlScalarInt(const llvm::yaml::Node *node, int &result); | ||
| bool parseYamlScalarString(const llvm::yaml::Node *node, std::string &result); | ||
| void parseYamlStringSequence(llvm::yaml::Node *node, | ||
| std::vector<std::string> &result); | ||
|
|
||
| bool yamlParseError(const std::string &msg, const std::string &file = ""); | ||
|
|
||
| void parseTileDefaults(llvm::yaml::MappingNode *tile_defaults_map, | ||
| mlir::neura::TileDefaults &tile_defaults); | ||
| void parseTileOverrideOperations(llvm::yaml::MappingNode *override_map, | ||
| mlir::neura::TileOverride &override); | ||
| void parseSingleTileOverride(llvm::yaml::MappingNode *override_map, | ||
| mlir::neura::TileOverride &override); | ||
| bool parseTileOverrides(llvm::yaml::SequenceNode *tile_overrides_seq, | ||
| std::vector<mlir::neura::TileOverride> &tile_overrides); | ||
| bool parseLinkDefaults(llvm::yaml::MappingNode *link_defaults_map, | ||
| mlir::neura::LinkDefaults &link_defaults); | ||
| void parseSingleLinkOverride(llvm::yaml::MappingNode *override_map, | ||
| mlir::neura::LinkOverride &override); | ||
| bool parseLinkOverrides(llvm::yaml::SequenceNode *link_overrides_seq, | ||
| std::vector<mlir::neura::LinkOverride> &link_overrides); | ||
| mlir::neura::BaseTopology parseTopologyString(const std::string &topology_str); | ||
| } // namespace util | ||
| } // namespace neura | ||
| } // namespace mlir | ||
| #endif // NEURA_PARSER_UTILS_H |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.