-
Notifications
You must be signed in to change notification settings - Fork 0
Multiply with inverse scale in loop inside of dividing to improve perf #12
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
Conversation
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
stack-info: PR: #12, branch: danielvegamyhre/stack/6
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
b11627a
to
555b024
Compare
This was referenced Jul 6, 2025
Merged
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
555b024
to
fed7987
Compare
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
fed7987
to
7aa8fc0
Compare
3631dea
to
2039e19
Compare
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
7aa8fc0
to
f797f4d
Compare
2039e19
to
28a31b6
Compare
f797f4d
to
52b2b0e
Compare
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
28a31b6
to
2c4677c
Compare
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
52b2b0e
to
503ec5d
Compare
2c4677c
to
c40ace9
Compare
danielvegamyhre
added a commit
that referenced
this pull request
Jul 6, 2025
stack-info: PR: #12, branch: danielvegamyhre/stack/6
bd8511c
to
6a9276b
Compare
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:
Multiply with inverse scale in loop inside of dividing to improve perf
__fdiv_rn
32 times in an unrolled loop is much slower than doing it once to calculate the inverse scale, then multiplyingdata * inverse_scale
32 times inside the loop inside.Test plan
pytest test_kernels.py -k cuda_mx -s
Performance
Before change:
After change:
Benchmarking against Triton
CUDA dim1 cast now achieves ~23% faster runtime and ~23% higher mem bw utilization than the Triton kernel with this change.
CUDA: 5114 gbps, 159us
Triton: 4137gbps, 197us