tilelang.contrib.ptodsl.rng¶

Classes¶

PhiloxRNG

Philox 4x32-10 PRNG for PTO SIMT path.

Module Contents¶

class tilelang.contrib.ptodsl.rng.PhiloxRNG(seed, seq, off)¶

Philox 4x32-10 PRNG for PTO SIMT path.

Each SIMT thread creates its own instance with a unique (seed, seq) pair. The seed and initial 128-bit counter are immutable. The caller owns a logical draw index and threads it through each method explicitly, so PTODSL can carry the ordinary Python SSA name through runtime control flow. rand() returns a uint32; rand_uniform() returns float32 in [0, 1); rand_normal() uses the same cached Box-Muller construction as the AscendC backend.

base_counter_lo¶
base_counter_hi¶
base_lane¶
rand(draw_index)¶
rand_uniform(draw_index)¶
rand_normal(draw_index, normal_cache, has_normal)¶

Return one normal draw and the updated cached Box-Muller state.