helion.language.prefetch#
- helion.language.prefetch(tensor, index, extra_mask=None)[source]#
Hint that
tensor[index]will be read soon by warming the L2 cache.indexandextra_maskfollowload()(tiles, integers, slices,hl.arange/ integer-tensor gathers). Nothing is returned and nothing is ordered: a prefetch neither waits for earlier stores nor makes later loads see anything, so dropping it never changes a result. Unlikeload()it takes noindexing, eviction-policy or cache-modifier config slot, so adding one leaves every load’s tunables where they were.On NVIDIA GPUs (Triton backend), when the last index is a full slice or a tile of a stride-1 dim and there is no
extra_mask, each element of the leading indices issues onecp.async.bulk.prefetch.L2covering its row segment (sm_90+). Any other prefetch issuesprefetch.global.L2per element (one 128-byte line each). Other targets drop it.