xnn.common.models.dispersion.auto_triplet_chunk#

xnn.common.models.dispersion.auto_triplet_chunk(like)[source]#

Triplets per recompute block from the free device memory.

A block’s transient state is about 100 values of like.dtype plus 40 bytes of indices per triplet, twice over in the backward pass; the block takes a quarter of the free memory within [2^20, 2^24] (CPU: 2^22). Fewer, larger blocks amortize the per-block set-up, which is paid in both passes.

Parameters:

like (Tensor)

Return type:

int