Subdivision of threadgroups
Also named as simdgroups, warps, waves
Subgroup operations make sharing and reducing data across threads in a subgroup measurably faster
Their size vary across GPUs
We can have these operations in WGSL (WebGPU Shading Language)
How:
Subgroup operations exposed to web are
Basic Operations |
---|
subgroup_size |
subgroup_invocation_idx |
subgroupIsFirst |
Vote Operations |
---|
subgroupAll |
subgroupAny |
Arithmetic Operations |
---|
subgroupAdd |
subgroupMul |
subgroupMin |
subgroupMax |
subgroupAnd |
subgroupOr |
subgroupXor |
Arithmetic Prefix Operations |
---|
subgroupPrefixAdd |
subgroupPrefixMul |
Ballot Operations |
---|
subgroupBallot |
subgroupBroadcastFirst |
Desktop: available everywhere
Mobile: most of the next generation chips support
Raised concerns mostly fall out-of-scope for this PR, not blockers for adoption as-is
Technically can make into MVP as a good addition in the standard library of WGSL
You can check out the PR itself #954