Use torch.gather instead of generic int indexing for cross_entropy example#2058
Draft
AmesingFlank wants to merge 1 commit intomainfrom
Draft
Use torch.gather instead of generic int indexing for cross_entropy example#2058AmesingFlank wants to merge 1 commit intomainfrom
AmesingFlank wants to merge 1 commit intomainfrom
Conversation
AmesingFlank
added a commit
that referenced
this pull request
Apr 20, 2026
…ample stack-info: PR: #2058, branch: AmesingFlank/stack/25
d29d610 to
341a5ff
Compare
341a5ff to
bcb53ba
Compare
AmesingFlank
added a commit
that referenced
this pull request
Apr 20, 2026
…ample stack-info: PR: #2058, branch: AmesingFlank/stack/25
bcb53ba to
c160d88
Compare
AmesingFlank
added a commit
that referenced
this pull request
Apr 20, 2026
…ample stack-info: PR: #2058, branch: AmesingFlank/stack/25
c160d88 to
efbe2a5
Compare
…ample stack-info: PR: #2058, branch: AmesingFlank/stack/25
efbe2a5 to
c95b79f
Compare
Contributor
|
Is there a way to know how this is affecting the GPU performance of this kernel? Or is the kernel code (e.g., triton) the same? |
Contributor
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked PRs:
Use torch.gather instead of generic int indexing for cross_entropy example. The benefit of this is that the gather operation is applied on a
tile, which is more friendly than an int-indexing expression on the entire tensor. Paired with #2060, this unblocks thiscross_entropyexample on TPUs