Skip to content

[executorch][cuda] Optimize short-query INT6 matvec kernels - #21474

Open
Gasoonjia wants to merge 1 commit into
gh/gasoonjia/179/basefrom
gh/gasoonjia/179/head
Open

[executorch][cuda] Optimize short-query INT6 matvec kernels#21474
Gasoonjia wants to merge 1 commit into
gh/gasoonjia/179/basefrom
gh/gasoonjia/179/head

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Add compile-time M=1/2/3/4 short-query paths and share their safe implementation through a ROWS/USE_SUM/GS16 device template. These kernels were generated and tuned with KernelAgent. Dispatch uses the regular gs16 kernels for M=1/2 and the precomputed-activation-sum kernels for M=3/4. The M=3 non-sum entry remains explicit as a performance/correctness comparison because templating that entry increased register pressure.

A100 op-level results (N=6656, gs=16, three seeds):

  • M1, generic reference -> gs16: 0.039416 -> 0.038211 ms (1.032x; no regression)
  • M2, generic reference -> gs16: 0.055348 -> 0.032540 ms (1.701x)
  • M3, optimized non-sum -> activation-sum: 0.040003 -> 0.039949 ms (1.001x; neutral incremental change)
  • M4, generic reference -> activation-sum: 0.100204 -> 0.045694 ms (2.193x)

The M3 baseline is intentionally the optimized non-sum kernel rather than the generic reference; this isolates the activation-sum optimization. All candidates are bitwise-correct across the three seeds, and ptxas reports zero spills.

Differential Revision: D114032330

[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/21474

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

❌ 2 New Failures, 1 Cancelled Job

As of commit 3121545 with merge base a6315eb (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

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.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant