Skip to content

Conversation

danielvegamyhre
Copy link
Contributor

@danielvegamyhre danielvegamyhre commented Aug 21, 2025

Stacked PRs:


[fp8 blockwise] load 2d chunks for groupwise quant to enable coalesced gmem accesses

NCU flagged uncoalesced gmem accesses when loading input tensor data. I was loading in skinny tiles of size (1 x blocksize) or (blocksize x 1), which can cause uncoalesced loads and stores depending on the underlying memory layout.

By loading 2d chunks of (num_groups, blocksize) or (blocksize, num_groups) we can enable the uncoalesced loads to be grouped into several coalesced loads.

This results in a 20-33% speedup.

Kernel performance

Individual linear fwd + bwd

bf16: 7690 us
Screenshot 2025-08-20 at 7 05 14 PM

fp8 blockwise: 6302 us (22% speedup)
Screenshot 2025-08-20 at 7 05 19 PM

E2E training performance

Eager llama3 8b with FDSP=4 on H100s

  • bf16: ~6080 TPS
  • fp8 blockwise: ~6170 TPS

…d gmem accesses

stack-info: PR: #2827, branch: danielvegamyhre/stack/46
Copy link

pytorch-bot bot commented Aug 21, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2827

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@danielvegamyhre danielvegamyhre force-pushed the danielvegamyhre/stack/46 branch from 8e32c2e to e9c558c Compare August 21, 2025 00:24
danielvegamyhre added a commit that referenced this pull request Aug 21, 2025
…d gmem accesses

stack-info: PR: #2827, branch: danielvegamyhre/stack/46
@danielvegamyhre danielvegamyhre force-pushed the danielvegamyhre/stack/45 branch from f2f5e62 to 2f44322 Compare August 21, 2025 00:24
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2025
@danielvegamyhre danielvegamyhre added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Aug 21, 2025
@danielvegamyhre danielvegamyhre changed the base branch from danielvegamyhre/stack/45 to main August 21, 2025 00:51
danielvegamyhre added a commit that referenced this pull request Aug 21, 2025
…d gmem accesses

stack-info: PR: #2827, branch: danielvegamyhre/stack/46
@danielvegamyhre danielvegamyhre force-pushed the danielvegamyhre/stack/46 branch from e9c558c to c77a12e Compare August 21, 2025 00:51
@danielvegamyhre danielvegamyhre changed the base branch from main to danielvegamyhre/stack/45 August 21, 2025 00:51
@danielvegamyhre danielvegamyhre changed the base branch from danielvegamyhre/stack/45 to main August 21, 2025 01:37
@danielvegamyhre danielvegamyhre changed the base branch from main to danielvegamyhre/stack/45 August 21, 2025 01:37
@danielvegamyhre danielvegamyhre changed the base branch from danielvegamyhre/stack/45 to main August 21, 2025 05:34
@danielvegamyhre danielvegamyhre changed the base branch from main to danielvegamyhre/stack/45 August 21, 2025 05:34
@danielvegamyhre danielvegamyhre changed the base branch from danielvegamyhre/stack/45 to main August 22, 2025 21:34
@danielvegamyhre danielvegamyhre force-pushed the danielvegamyhre/stack/46 branch from c77a12e to ba52b69 Compare August 22, 2025 21:34
@danielvegamyhre danielvegamyhre changed the base branch from main to danielvegamyhre/stack/45 August 22, 2025 21:34
@danielvegamyhre danielvegamyhre force-pushed the danielvegamyhre/stack/45 branch from e48e077 to e8185a1 Compare August 27, 2025 22:02
danielvegamyhre added a commit that referenced this pull request Aug 27, 2025
…d gmem accesses

stack-info: PR: #2827, branch: danielvegamyhre/stack/46
@danielvegamyhre danielvegamyhre force-pushed the danielvegamyhre/stack/46 branch 2 times, most recently from 0ccc43f to d79b806 Compare August 27, 2025 22:38
@danielvegamyhre danielvegamyhre changed the base branch from danielvegamyhre/stack/45 to main August 27, 2025 22:38
@danielvegamyhre danielvegamyhre merged commit 3bf21d0 into main Aug 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants