Skip to content

[executorch][cuda] Optimize short-query INT4 matvec kernels - #21473

Merged
meta-codesync[bot] merged 2 commits into
gh/gasoonjia/178/basefrom
gh/gasoonjia/178/head
Jul 30, 2026
Merged

[executorch][cuda] Optimize short-query INT4 matvec kernels#21473
meta-codesync[bot] merged 2 commits into
gh/gasoonjia/178/basefrom
gh/gasoonjia/178/head

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Add compile-time M=2/3/4 fused short-query kernels while preserving the existing M=1 path. The shared ROWS template was reviewed and benchmarked by KernelAgent; KA found no faster safe rewrite, so the validated template is retained.

A100 kernel microbenchmarks versus main:

  • M1: 0.10226 -> 0.10228 ms (performance neutral; no regression)
  • M2: 0.196 -> 0.127 ms (1.54x)
  • M3: 0.289 -> 0.159 ms (1.82x)
  • M4: 0.383 -> 0.196 ms (1.95x)

Correctness tests cover M=1,2,3,4 with three randomized seeds. ptxas reports zero spills.

Differential Revision: D114032326

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21473

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

❌ 1 Unclassified Failure

As of commit 2058ca5 with merge base f4a21b8 (image):

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

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

@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 Jul 29, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

[ghstack-poisoned]

@digantdesai digantdesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
meta-codesync Bot merged commit 97c14de into gh/gasoonjia/178/base Jul 30, 2026
231 of 234 checks passed
@meta-codesync
meta-codesync Bot deleted the gh/gasoonjia/178/head branch July 30, 2026 22:34
@meta-codesync
meta-codesync Bot temporarily deployed to cherry-pick-bot July 30, 2026 22:34 Inactive
Gasoonjia added a commit that referenced this pull request Jul 30, 2026
This PR was created by the merge bot to help merge the original PR into
the main branch.
ghstack PR number: #21473 by
@Gasoonjia
^ Please use this as the source of truth for the PR details, comments,
and reviews
ghstack PR base:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/178/base
ghstack PR head:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/178/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head:
https://github.com/pytorch/executorch/tree/gh/gasoonjia/178/orig
Differential Revision:
[D114032326](https://our.internmc.facebook.com/intern/diff/D114032326/)
@diff-train-skip-merge

Co-authored-by: gasoonjia <gasoonjia@icloud.com>
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants