---
title: "subgroup_id: builtin value, TypeShade language reference"
description: "subgroup_id, a builtin value in the TypeShade language reference. The current subgroup's index within its workgroup."
url: https://typeshade.dev/reference/builtin-values/subgroup_id/
language: en
---

# `@builtin("subgroup_id")`

Builtin value

The current subgroup's index within its workgroup.

**Valid in**

compute input

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

`@builtin("subgroup_id"): u32`

## Description

Compute stage only; on the CPU oracle and on WebGL2 a subgroup is one invocation, so it is the local invocation index.

## Examples

- [`gallery/subgroup-reduce/subgroup-reduce.shade.ts`](https://typeshade.dev/guide/examples/subgroup-reduce/)

## See also

- [Builtin values](https://typeshade.dev/reference/builtin-values/)
