v152 · graphics · webgpu

WebGPU: Subgroup Size Control

The optional WebGPU feature subgroup-size-control adds the WGSL enable subgroup_size_control extension and @subgroup_size(...) compute entry-point attribute so expert workloads can request a specific subgroup size.

concepts

  1. Feature gate

    Request a WebGPU adapter and check whether its optional features include subgroup-size-control.

  2. WGSL shader builder

    Generate the exact enable subgroup_size_control and @subgroup_size compute shader text for a chosen subgroup size.

  3. Workgroup validation

    Validate the power-of-two subgroup requirement and the workgroup_size.x multiple rule before trying pipeline creation.

why it shipped

Compute-heavy workloads such as AI kernels sometimes need predictable subgroup sizes for correctness testing, memory sizing, and architecture-specific performance tuning. The optional feature lets those apps request a size and handle pipeline-creation failure when the implementation cannot support it.

references