For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Python function
num_heads_for_device
num_heads_for_device()β
max.nn.attention.num_heads_for_device(*, num_heads, device_idx, num_devices)
Computes the number of attention heads assigned to a specific device.
Distributes heads across devices, handling cases where the total is not evenly divisible by the number of devices. Earlier devices receive one extra head when there is a remainder.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!