forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 7
Allow splitting inner-most ID to create virtual innermost ID in transpose scheduler #1930
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
63e3e76
Allow splitting inner-most ID to create virtual innermost ID
zasdfgbnm 5a423a0
remove obselete comment
zasdfgbnm bf956ac
Merge branch 'devel' of github.com:csarofeen/pytorch into transpose-s…
zasdfgbnm 5678868
Merge branch 'devel' of github.com:csarofeen/pytorch into transpose-s…
zasdfgbnm 3157504
Merge branch 'devel' of github.com:csarofeen/pytorch into transpose-s…
zasdfgbnm 27b6893
Merge branch 'devel' of github.com:csarofeen/pytorch into transpose-s…
zasdfgbnm dee9639
Merge branch 'devel' of github.com:csarofeen/pytorch into transpose-s…
zasdfgbnm 79b7ce6
getInnerLeafDim
zasdfgbnm 39cdd0d
Merge branch 'transpose-split-inner' of github.com:csarofeen/pytorch …
zasdfgbnm 32e954c
fix
zasdfgbnm fff3396
remove thin wrapper
zasdfgbnm 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -932,6 +932,37 @@ TEST_F(NVFuserTest, FusionScheduleTransposeSmallInnerSize3_CUDA) { | |
testValidate(&fusion, outputs, {input}, {tv_ref}, __LINE__, __FILE__); | ||
} | ||
|
||
// x->sin->transpose->cos->y | ||
TEST_F(NVFuserTest, FusionScheduleTranspose2DSmallInnerSize_CUDA) { | ||
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.
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. Before this PR:
|
||
std::array<std::vector<int64_t>, 2> shapes{ | ||
std::vector<int64_t>{1024 * 1024 * 128, 2}, | ||
std::vector<int64_t>{2, 1024 * 1024 * 128}}; | ||
for (const auto& shape : shapes) { | ||
Fusion fusion; | ||
FusionGuard fg(&fusion); | ||
|
||
auto tv0 = makeContigTensor(2); | ||
fusion.addInput(tv0); | ||
auto tv1 = sin(tv0); | ||
auto tv2 = transpose(tv1, 0, 1); | ||
auto tv3 = cos(tv2); | ||
fusion.addOutput(tv3); | ||
|
||
auto options = at::TensorOptions().dtype(at::kFloat).device(at::kCUDA, 0); | ||
at::Tensor input = at::randn(shape, options); | ||
|
||
auto lparams = scheduleTranspose(&fusion, {input}); | ||
|
||
FusionExecutor fe; | ||
fe.compileFusion(&fusion, {input}, lparams); | ||
auto outputs = fe.runFusion({input}, lparams); | ||
|
||
auto tv_ref = input.sin().transpose(0, 1).cos(); | ||
|
||
testValidate(&fusion, outputs, {input}, {tv_ref}, __LINE__, __FILE__); | ||
} | ||
} | ||
|
||
} // namespace jit | ||
} // namespace torch | ||
#endif // #if defined(USE_CUDA) |
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.