-
Notifications
You must be signed in to change notification settings - Fork 4
Add automatic tiling #153
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
EmilySillars
wants to merge
8
commits into
opencompl:main
Choose a base branch
from
CAPS-UMU:add-automatic-tiling
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
Add automatic tiling #153
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f6319b9
add automatic tiling with myrtle
EmilySillars 3371c34
prepare to split this branch into pieces
EmilySillars 5169e12
automatically tile nsnet2 (provided tile sizes are passed in)
EmilySillars b01e197
remove myrtle submodule
EmilySillars 46e0a02
clean up spacing, comments, etc
EmilySillars 133df80
remove nsnet2 changes
EmilySillars 0275795
fix newlines
EmilySillars df16d45
remove old manual tiling pass
EmilySillars 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 |
|---|---|---|
|
|
@@ -50,6 +50,9 @@ | |
| #include "LibraryBuilder.h" | ||
| #include "Passes.h" | ||
|
|
||
| #include "TilingScheme.h" | ||
| #include "llvm/Support/ErrorHandling.h" | ||
|
|
||
| using namespace mlir; | ||
| using namespace mlir::iree_compiler; | ||
| using namespace quidditch::Snitch; | ||
|
|
@@ -81,6 +84,9 @@ struct QuidditchTargetOptions { | |
| std::string xDSLOptPath; | ||
| std::string toolChainRoot; | ||
| bool assertCompiled = false; | ||
| std::string importTiles = ""; // added for Configure Tiles Pass | ||
| quidditch::TileInfoTbl tileInfo = | ||
| quidditch::TileInfoTbl(); // added for Configure Tiles Pass | ||
| // TODO: This should actually be 112640 but DMA stack overflows. Ooopsie! | ||
| unsigned l1MemoryBytes = 100000; | ||
|
|
||
|
|
@@ -108,6 +114,11 @@ struct QuidditchTargetOptions { | |
| "iree-quidditch-toolchain-root", toolChainRoot, llvm::cl::cat(category), | ||
| llvm::cl::desc("Path to the root directory of the Quidditch toolchain " | ||
| "(containing the toolchain file)")); | ||
| // added for Configure Tiles Pass | ||
| binder.opt<std::string>( | ||
| "iree-quidditch-import-tiles", importTiles, llvm::cl::cat(category), | ||
| llvm::cl::desc( | ||
| "Path to a JSON file from which we import tiling schemes")); | ||
| binder.opt<bool>( | ||
| "iree-quidditch-assert-compiled", assertCompiled, | ||
| llvm::cl::cat(category), | ||
|
|
@@ -173,7 +184,20 @@ class QuidditchTargetBackend final : public IREE::HAL::TargetBackend { | |
| } | ||
| modulePassManager.addPass(createMaterializeUserConfigsPass()); | ||
| FunctionLikeNest funcPassManager(modulePassManager); | ||
| funcPassManager.addPass(quidditch::createConfigureForSnitchPass); | ||
|
|
||
| // import any manually supplied tile sizes | ||
| if (targetOptions.importTiles != "") { | ||
| std::string errs; | ||
| quidditch::fillTileInfoTable(&targetOptions.tileInfo, | ||
| targetOptions.importTiles, errs); | ||
| } | ||
|
Comment on lines
+188
to
+193
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Import tiling schemes and populate the table before creating the ConfigureTiles pass |
||
|
|
||
| // automatically tile the dispatches | ||
| funcPassManager.addPass([&] { | ||
| auto thePass = quidditch::createConfigureTiles( | ||
| {targetOptions.importTiles, (std::uintptr_t)&targetOptions.tileInfo}); | ||
| return thePass; | ||
| }); | ||
| } | ||
|
|
||
| void buildTranslationPassPipeline(IREE::HAL::ExecutableTargetAttr targetAttr, | ||
|
|
||
Oops, something went wrong.
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.
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.
Since the tiling schemes are passed in by the user in a single json file, it made sense to me that before constructing the ConfigureTiles pass, that json file should be read once and its information populated in a lookup table. This way, each time the ConfigureTiles pass runs over a functionOp, it doesn't have to open and read the contents of the same file again.
I couldn't figure out an easy way to provide another argument to the ConfigureTiles pass without also exposing it to the user. Is it okay to leave it as is, or should I work harder and find a way to remove this as a command line argument?
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.
I'm not sure that I see the advantage, why not read it in the pass itself?