-
Notifications
You must be signed in to change notification settings - Fork 75
WIP: ScanOp #4211
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
Draft
jacobhinkle
wants to merge
43
commits into
main
Choose a base branch
from
jh/scan_wip
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.
Draft
WIP: ScanOp #4211
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
3bd640d
Allow definition of PrefixSumOp
jacobhinkle cde4b31
Update test to compile and run
jacobhinkle 22ea549
Start implementing indexing for PrefixSumOp
jacobhinkle 61291be
Merge remote-tracking branch 'origin/main' into jh/scan_wip
jacobhinkle eefe3d8
Enable TensorIndexer in test
jacobhinkle e8ae971
Update indexing
jacobhinkle 1caf5eb
Add note about inlining in test
jacobhinkle fb24bfd
Fix evaluation of scalar discount factor
jacobhinkle bd5fd7b
Merge remote-tracking branch 'origin/main' into jh/scan_wip
jacobhinkle 978d082
Add Concrete2D test
jacobhinkle bb44a1a
Fix discount factor
jacobhinkle 6e7e001
Add broken online softmax test, with notes in comments
jacobhinkle f581d16
Generalize to ScanOp
jacobhinkle e376e5e
Generalize evaluation, some cleanups
jacobhinkle 2b3eff4
Add LHS and RHS, use to improve OnlineSoftmax def
jacobhinkle 3b90e99
Remove stale comment
jacobhinkle 7cfa4b1
Add exclusive
jacobhinkle 756508d
Evaluate exclusive scan
jacobhinkle d2c7bd6
Merge remote-tracking branch 'origin/main' into jh/scan_wip
jacobhinkle 19a1e50
Fix evaluation. OnlineSoftmax test passes but is not inlined
jacobhinkle be81b65
Use computeWith to "inline" OnlineSoftmax into one loop
jacobhinkle 01fa5b2
Cache inputs and outputs in OnlineSoftmax test
jacobhinkle bb81c4a
Add OnlineSoftmaxOuter test
jacobhinkle 9cf09ec
Introduce IterType::Scan
jacobhinkle 6de0839
Skip allocating scan dimensions
jacobhinkle 4834913
Merge remote-tracking branch 'origin/main' into jh/scan_wip
jacobhinkle 11ceeff
Remove stale comments from tests
jacobhinkle 21fd7c1
First draft of validation
jacobhinkle f5574c2
Merge remote-tracking branch 'origin/main' into jh/scan_wip
jacobhinkle d5b95c7
Set iter type in non-exclusive scan
jacobhinkle cc845dc
Allocate scan dims when needed
jacobhinkle de35509
Add ComputeAtLogicalDomainMapBuilder::handle(ScanOp*)
jacobhinkle 4369a16
Fix inlining in OnlineSoftmax tests
jacobhinkle db5798c
Use previously computed exclusive scan to compute inclusive
jacobhinkle aed6eb2
Switch OnlineSoftmax{,Outer} to symbolic sizes
jacobhinkle 8e846b4
Fix outer test
jacobhinkle 6c48103
Compute full softmax in test
jacobhinkle 14e52bb
Introduce ScanResult
jacobhinkle d145b82
Enable reduction output, but not in indexing yet.
jacobhinkle 4c655ec
Fix build
jacobhinkle 1a01914
Add FlashAttentionNoMma test
jacobhinkle deaff1f
More fixes to FlashAttentionNoMma
jacobhinkle 302015c
Merge remote-tracking branch 'origin/main' into jh/scan_wip
jacobhinkle 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
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
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 |
|---|---|---|
|
|
@@ -2333,8 +2333,13 @@ kir::TensorIndex* Index::getConsumerIndex( | |
| GpuLower::current()->idModelOptions().consumerIndex() || | ||
| GpuLower::current()->tmemInfo().hasTMemTensor()) { | ||
| NVF_ERROR(rotated_loops.empty(), "Loop rotation is not supported"); | ||
| std::unordered_map<IterDomain*, Val*> override_index_ids; | ||
| for (auto& [pos, idx] : override_index) { | ||
| override_index_ids.emplace( | ||
| consumer->getMaybeAllocationDomain().at((size_t)pos), idx); | ||
| } | ||
| index = GpuLower::current()->tensorIndexer().getLinearIndex( | ||
| consumer, consumer->definition(), loops); | ||
| consumer, consumer->definition(), loops, override_index_ids); | ||
|
Comment on lines
+2336
to
+2342
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. I believe this is necessary for |
||
| if (generate_pointer) { | ||
| auto address_offset = index; | ||
| if (consumer->getMemoryType() == MemoryType::Shared) { | ||
|
|
||
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.
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 believe this is a bug since emplace will simply fail and return false if there is a pre-existing entry, whereas we need to update the index here instead.