Claude 0a697f5871 arch(scan): dispatch_scan.cuh Phase 1/Phase 2 separation in GDN chunk loop
Direct translation of CCCL dispatch_scan.cuh (1469 lines) architecture:

CCCL dispatch_scan has two kernels:
  1. DeviceScanInitKernel — initializes tile_state (parallelizable)
  2. DeviceScanKernel — sequential scan using tile_state propagation

Our _torch_chunk_gated_delta_rule now separates:
  Phase 1 (init, parallelizable): pre-compute ALL chunk-local attn matrices
    attn_i[c] = q[c] @ k[c].T * decay[c] — does NOT depend on state
    Also pre-compute g.exp() and clamped g once, outside loop
  Phase 2 (scan, sequential): only state-dependent ops in the loop
    v_prime, v_new, attn_inter, core_out, state update

This matches CCCL's insight: everything that doesn't need tile_state
should be computed before the scan kernel, not interleaved with it.
2026-08-09 10:44:43 +00:00
2026-08-07 08:43:51 +00:00
2026-07-30 17:03:23 +08:00
2026-08-07 07:47:01 +00: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%