Skip to content

[ET-VK][qconv] Add software fallback for dotPacked4x8AccSatEXT in q8ta_ shaders#17691

Closed
SS-JIA wants to merge 1 commit intogh/SS-JIA/444/basefrom
gh/SS-JIA/444/head
Closed

[ET-VK][qconv] Add software fallback for dotPacked4x8AccSatEXT in q8ta_ shaders#17691
SS-JIA wants to merge 1 commit intogh/SS-JIA/444/basefrom
gh/SS-JIA/444/head

Conversation

@SS-JIA
Copy link
Copy Markdown
Contributor

@SS-JIA SS-JIA commented Feb 25, 2026

Stack from ghstack (oldest at bottom):

Devices that lack VK_KHR_shader_integer_dot_product (older GPUs, emulators)
currently fail with ShaderNotSupportedError when running int8-quantized
conv2d/linear because the q8ta_ shaders unconditionally require
GL_EXT_integer_dot_product. This adds fallback SPIR-V variants that use a
pure-GLSL software implementation so those devices can still execute the
operators at a performance cost.

Approach: compile-time macro USE_INT8_DOT_PRODUCT_EXT selects the
implementation. Each affected YAML file gains a *_fallback shader variant
compiled with USE_INT8_DOT_PRODUCT_EXT=0. At C++ dispatch time,
adapter_ptr()->supports_int8_dot_product() picks the matching variant.

Changes:

  • common.glslh: add dotPacked4x8Acc_fallback() and dotPacked4x8AccSat()
    dispatch macro
  • linear_fp_output_tile_int8_int8_compute.glslh: guard extension + use macro
  • q8ta_conv2d/pw/linear/linear_gemv .glsl: inject USE_INT8_DOT_PRODUCT_EXT
    template define, guard extension, replace direct EXT calls with macro
  • q8ta_conv2d/pw/linear/linear_gemv .yaml: add USE_INT8_DOT_PRODUCT_EXT
    parameter and *_fallback shader variants
  • Q8taConv2d/PW/Linear/LinearGemv .cpp: call supports_int8_dot_product() to
    select hardware vs. fallback variant at runtime

Differential Revision: D94314256

…a_ shaders

Devices that lack VK_KHR_shader_integer_dot_product (older GPUs, emulators)
currently fail with ShaderNotSupportedError when running int8-quantized
conv2d/linear because the q8ta_ shaders unconditionally require
GL_EXT_integer_dot_product. This adds fallback SPIR-V variants that use a
pure-GLSL software implementation so those devices can still execute the
operators at a performance cost.

Approach: compile-time macro USE_INT8_DOT_PRODUCT_EXT selects the
implementation. Each affected YAML file gains a *_fallback shader variant
compiled with USE_INT8_DOT_PRODUCT_EXT=0. At C++ dispatch time,
adapter_ptr()->supports_int8_dot_product() picks the matching variant.

Changes:
- common.glslh: add dotPacked4x8Acc_fallback() and dotPacked4x8AccSat()
  dispatch macro
- linear_fp_output_tile_int8_int8_compute.glslh: guard extension + use macro
- q8ta_conv2d/pw/linear/linear_gemv .glsl: inject USE_INT8_DOT_PRODUCT_EXT
  template define, guard extension, replace direct EXT calls with macro
- q8ta_conv2d/pw/linear/linear_gemv .yaml: add USE_INT8_DOT_PRODUCT_EXT
  parameter and *_fallback shader variants
- Q8taConv2d/PW/Linear/LinearGemv .cpp: call supports_int8_dot_product() to
  select hardware vs. fallback variant at runtime

Differential Revision: [D94314256](https://our.internmc.facebook.com/intern/diff/D94314256/)

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 25, 2026

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 5cc872f with merge base 63f9724 (image):

NEW FAILURES - The following jobs have failed:

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 Feb 25, 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