project6 f140825a56 arch(moe): translate CCCL sync_handler.cuh — register-at-init, resolve-on-first-call
sync_handler.cuh entire design (140 lines):
  Centralized synchronization resource manager for GPU kernels.
  Two-phase lifecycle:
    Phase 1 (host, constexpr): registerResource(numStages) + registerPhase()
      Declares what resources are needed. No allocation yet.
    Phase 2 (device, once): clusterInitSync()
      Initializes all mbarriers in one pass. After this, no more registration.
  Key properties:
    - Non-copyable, non-movable (single source of truth)
    - Fixed-size arrays (mMaxNumResources=10) — no dynamic allocation
    - Destructor asserts mHasInitialized (catch forgotten init)
    - Block-strided barrier init (all warps participate)

Translation to MoeSparseBlock:
  Previous: hasattr() checks in forward hot path to lazy-init _use_native_moe
  Now: Pre-declare _use_native_moe=None in __init__ (Phase 1: registration)
       First forward resolves it via _hw_policy (Phase 2: initialization)
       Subsequent forwards: None-check is faster than hasattr()
  Also pre-declare _moe_out_buf fields to avoid attribute creation in forward.

CCCL source: cub/cub/detail/warpspeed/sync_handler.cuh
Maps to: qwen3_6_scripts/qwen3_5.py (Qwen3_5MoeSparseBlock)
2026-08-07 09:14:49 +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%