Skip to content

[ExecuTorch][WebGPU] Route exact prefill shapes to the BK64 GEMM - #21130

Merged
meta-codesync[bot] merged 11 commits into
gh/JCNTH/106/basefrom
gh/JCNTH/106/head
Aug 7, 2026
Merged

[ExecuTorch][WebGPU] Route exact prefill shapes to the BK64 GEMM#21130
meta-codesync[bot] merged 11 commits into
gh/JCNTH/106/basefrom
gh/JCNTH/106/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Llama prefill drives the ordinary quantized-linear projections at a small set
of fixed batch-row counts, and the generic Steel schedule leaves throughput on
the table for them. This adds a frozen BK64 Steel quantized-GEMM route for the
exact accepted Llama ordinary-projection shapes at live M128, M508, and M512,
selected only when the capability and dynamic-route guards all pass. M511 and
other prefill sizes stay on the generic Steel schedule and M1 stays on bicol
decode, so the route fails closed outside its accepted shapes. Mirrors Vulkan
xplat/executorch/backends/vulkan/runtime/graph/ops/glsl/q4gsw_linear_gemm__w_4x8.glsl
(the 4-bit grouped-symmetric-weight GEMM), specialized here for the BK64 tile.

Key changes:

  • runtime/ops/quantized_linear/q4gsw_steel_bk64.wgsl (+ generated header): the
    BK64-tiled q4gsw prefill GEMM kernel.
  • QuantizedLinear.cpp, WebGPUUtils.h: exact-shape predicate, capability guard,
    and dynamic re-entry into and out of the BK64 route.
    @exported-using-ghexport

Differential Revision: D113171739

Differential Revision: D113171739

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 37 New Failures, 30 Pending

As of commit 1b7fdc1 with merge base 28a7fac (image):

NEW FAILURES - The following jobs have failed:

  • Cadence Build & Test / cpu-test / test-aot / test-aot (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9D8E:35B914:837BF5A:1BA9DE1D:6A760B5C and timestamp 2026-08-07 16:44:12 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • Cadence Build & Test / cpu-test / test-ops / test-ops (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID A122:2B8F95:35A3F3D:B6B2DE7:6A760B5E and timestamp 2026-08-07 16:44:14 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-eval_llama-wikitext-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID B662:37B3D4:36F0E8A:BAE34F5:6A760BBB and timestamp 2026-08-07 16:45:47 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-llama_runner_eager-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D41E:157945:8870B8F:1CA5391E:6A760BD1 and timestamp 2026-08-07 16:46:09 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-lora-multimethod-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID E21A:3FF05C:84CBA8E:1BFAF156:6A760BB9 and timestamp 2026-08-07 16:45:45 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-mediatek-models-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID E708:63CA7:82491FD:1B74FDCA:6A760BBD and timestamp 2026-08-07 16:45:49 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (add_mul, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 8034:6D448:838793C:1BAA22E3:6A760BD4 and timestamp 2026-08-07 16:46:12 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (add_mul, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (add, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D3E2:19516B:80ADCFB:1B33ED3C:6A760BAA and timestamp 2026-08-07 16:45:30 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (add, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D562:56AB6:831488A:1B7F7E31:6A760BD1 and timestamp 2026-08-07 16:46:09 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (emformer_join, portable, linux.4xlarge.memory) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID BEB0:3440A9:365BD26:B905608:6A760B3A and timestamp 2026-08-07 16:43:38 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (emformer_transcribe, portable, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (ic3, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (linear, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 8D84:208B0:4CFCAEE:1047D39A:6A760BB1 and timestamp 2026-08-07 16:45:37 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (linear, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID CDB6:35B914:83AF2CF:1BB4C439:6A760BC2 and timestamp 2026-08-07 16:45:54 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (llama3_2_vision_encoder, portable, linux.4xlarge.memory) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D3C0:182A50:362140F:B84B212:6A760B63 and timestamp 2026-08-07 16:44:20 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (mobilebert, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 82DC:3E7121:35A4D72:B69718B:6A760BD6 and timestamp 2026-08-07 16:46:14 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (mobilebert, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (mv2, portable, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (resnet18, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C3F8:2D8E74:4C4675B:102BBD69:6A760BC6 and timestamp 2026-08-07 16:45:58 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (resnet50, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID A3E0:1B80FE:81229E8:1B23FABE:6A760BC8 and timestamp 2026-08-07 16:46:00 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (mv3, portable, cmake, linux.2xlarge, executorch-ubuntu-22.04-clang12) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D366:7E39:8EBB232:1E38D982:6A760BB9 and timestamp 2026-08-07 16:45:45 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (mv3, xnnpack-quantization-delegation, buck2, linux.2xlarge, executorch-u... / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DEC6:4723F:36C870E:BA424D4:6A760BB8 and timestamp 2026-08-07 16:45:44 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (vit, portable, buck2, linux.2xlarge, executorch-ubuntu-22.04-clang12) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C4FA:2D8E74:4C360AA:10283A50:6A760B9C and timestamp 2026-08-07 16:45:16 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (vit, xnnpack-quantization-delegation, cmake, linux.2xlarge, executorch-u... / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID A306:208238:82EFE3E:1B788711:6A760BAE and timestamp 2026-08-07 16:45:34 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-multimodal-linux (gemma3-4b) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C34C:37DB1F:4CDD5F4:1046E8C8:6A760BB8 and timestamp 2026-08-07 16:45:44 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-direct-build-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9788:36D875:4DA8DDE:10700CCC:6A760BA4 and timestamp 2026-08-07 16:45:24 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.10) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID A1B0:3BE4F5:82B6351:1B7B6909:6A760B76 and timestamp 2026-08-07 16:44:38 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.11) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 8C3C:AA848:8636526:1C347EE7:6A760B7A and timestamp 2026-08-07 16:44:42 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.12) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-qnn-wheel-packages-linux (3.13) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 8D82:2ABE79:4C6C676:10294BDA:6A760B80 and timestamp 2026-08-07 16:44:48 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-samsung-quantmodels-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9544:37AD1A:820FDA4:1B4ECDA0:6A760BCD and timestamp 2026-08-07 16:46:05 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-setup-linux-gcc / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D7AC:3C7861:846DAD2:1BD0BB2B:6A760B87 and timestamp 2026-08-07 16:44:55 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-voxtral-realtime-xnnpack-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9FCA:2C3D6C:4C4541A:1023DAF5:6A760B4C and timestamp 2026-08-07 16:43:56 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / unittest / macos / macos-job (gh)
    ##[error]Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/Users/ec2-user/runner/_work/executorch/executorch/test-infra/.github/actions/check-disk-space'. Did you forget to run actions/checkout before running your local action?
  • pull / unittest-buck / macos / macos-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D636:2C3D6C:4C40E8C:1022EFA7:6A760B41 and timestamp 2026-08-07 16:43:45 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / unittest-editable / macos / macos-job (gh)
    ##[error]Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/Users/ec2-user/runner/_work/executorch/executorch/test-infra/.github/actions/check-disk-space'. Did you forget to run actions/checkout before running your local action?

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

@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]
[ghstack-poisoned]
[ghstack-poisoned]

@SS-JIA SS-JIA 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.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
  fbsource master

[ghstack-poisoned]
@meta-codesync
meta-codesync Bot merged commit 2c93f4f into gh/JCNTH/106/base Aug 7, 2026
145 of 183 checks passed
@meta-codesync
meta-codesync Bot deleted the gh/JCNTH/106/head branch August 7, 2026 17:20
@meta-codesync
meta-codesync Bot temporarily deployed to cherry-pick-bot August 7, 2026 17:20 Inactive
JCNTH added a commit that referenced this pull request Aug 7, 2026
Pull Request resolved: #21130

Llama prefill drives the ordinary quantized-linear projections at a small set
of fixed batch-row counts, and the generic Steel schedule leaves throughput on
the table for them. This adds a frozen BK64 Steel quantized-GEMM route for the
exact accepted Llama ordinary-projection shapes at live M128, M508, and M512,
selected only when the capability and dynamic-route guards all pass. M511 and
other prefill sizes stay on the generic Steel schedule and M1 stays on bicol
decode, so the route fails closed outside its accepted shapes. Mirrors Vulkan
xplat/executorch/backends/vulkan/runtime/graph/ops/glsl/q4gsw_linear_gemm__w_4x8.glsl
(the 4-bit grouped-symmetric-weight GEMM), specialized here for the BK64 tile.

Key changes:
- runtime/ops/quantized_linear/q4gsw_steel_bk64.wgsl (+ generated header): the
  BK64-tiled q4gsw prefill GEMM kernel.
- QuantizedLinear.cpp, WebGPUUtils.h: exact-shape predicate, capability guard,
  and dynamic re-entry into and out of the BK64 route.
ghstack-source-id: 411961445
@exported-using-ghexport

Differential Revision: [D113171739](https://our.internmc.facebook.com/intern/diff/D113171739/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
Pull Request resolved: #21130

Llama prefill drives the ordinary quantized-linear projections at a small set
of fixed batch-row counts, and the generic Steel schedule leaves throughput on
the table for them. This adds a frozen BK64 Steel quantized-GEMM route for the
exact accepted Llama ordinary-projection shapes at live M128, M508, and M512,
selected only when the capability and dynamic-route guards all pass. M511 and
other prefill sizes stay on the generic Steel schedule and M1 stays on bicol
decode, so the route fails closed outside its accepted shapes. Mirrors Vulkan
xplat/executorch/backends/vulkan/runtime/graph/ops/glsl/q4gsw_linear_gemm__w_4x8.glsl
(the 4-bit grouped-symmetric-weight GEMM), specialized here for the BK64 tile.

Key changes:
- runtime/ops/quantized_linear/q4gsw_steel_bk64.wgsl (+ generated header): the
  BK64-tiled q4gsw prefill GEMM kernel.
- QuantizedLinear.cpp, WebGPUUtils.h: exact-shape predicate, capability guard,
  and dynamic re-entry into and out of the BK64 route.
ghstack-source-id: 411961445
@exported-using-ghexport

Differential Revision: [D113171739](https://our.internmc.facebook.com/intern/diff/D113171739/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
Pull Request resolved: #21130

Llama prefill drives the ordinary quantized-linear projections at a small set
of fixed batch-row counts, and the generic Steel schedule leaves throughput on
the table for them. This adds a frozen BK64 Steel quantized-GEMM route for the
exact accepted Llama ordinary-projection shapes at live M128, M508, and M512,
selected only when the capability and dynamic-route guards all pass. M511 and
other prefill sizes stay on the generic Steel schedule and M1 stays on bicol
decode, so the route fails closed outside its accepted shapes. Mirrors Vulkan
xplat/executorch/backends/vulkan/runtime/graph/ops/glsl/q4gsw_linear_gemm__w_4x8.glsl
(the 4-bit grouped-symmetric-weight GEMM), specialized here for the BK64 tile.

Key changes:
- runtime/ops/quantized_linear/q4gsw_steel_bk64.wgsl (+ generated header): the
  BK64-tiled q4gsw prefill GEMM kernel.
- QuantizedLinear.cpp, WebGPUUtils.h: exact-shape predicate, capability guard,
  and dynamic re-entry into and out of the BK64 route.
ghstack-source-id: 411961445
@exported-using-ghexport

Differential Revision: [D113171739](https://our.internmc.facebook.com/intern/diff/D113171739/)
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