muh-engine c7d3da7922 [ENGINE] sampler.py: CCCL counting_iterator tensor reuse pattern
Applied counting_iterator.cu + alias_temporaries pattern:
cache bin_counts tensor across _get_bin_counts_and_mask calls.

CCCL counting_iterator generates [0,N) without materializing storage.
Our equivalent: reuse bin_counts buffer instead of torch.zeros() each
sampling call. For Qwen3.6 (vocab=152064, batch=8 decode), this
saves 9.7MB of CUDA malloc per decode step.

Also reads from: device_radix_sort.cuh (DoubleBuffer reuse pattern),
dispatch_reduce.cuh (alias_temporaries pre-allocation).

CCCL files: thrust/examples/counting_iterator.cu,
cub/device/device_radix_sort.cuh
2026-08-06 00:15:02 +00:00
2026-07-30 17:03:23 +08:00

project_6

Description
No description provided
Readme 427 MiB
Languages
C++ 41.8%
Cuda 31.6%
Python 22.2%
C 2.1%
CMake 1.1%
Other 1.1%