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!