triton-lang/triton

Dynmic indexing surpport?

Offen

#707 geöffnet am 24.09.2022

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)MLIR (3.136 Forks)github user discovery
help wanted

Repository-Metriken

Stars
 (19.995 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 2T 18h) (185 gemergte PRs in 30 T)

Beschreibung

I wanna know if dynamic indexing is supported in triton. For, example, can I load a value tensor based on another index tensor instantiated at runtime like below?

indicies_ptr = index_ptr + pid_n * BLOCK_SIZE_N +  tl.arange(0, BLOCK_SIZE_N) 
indicies = tl.load(indicies_ptr)
indexed_values_ptr = value_ptr + indices
indexed_values = tl.load(indexed_values_ptr)

I've read all tutorials in the official docs, all loading is based on static indexing with tl.arange(). Before I try triton for my project, I just want to confirm if dynamic indexing is supported, this is important for my application.

Contributor Guide