Claude
ab42fc1fd7
feat: hgemm_blocktiling.cu — FP16 GEMM kernel for MoE expert dispatch on BI-V100
Adapted from siboehm/SGEMM_CUDA kernel 6 (vectorize + A transpose)
and wangzyon/NVIDIA_SGEMM_PRACTICE kernel 6 (mysgemm_v6).
Key design decisions:
- FP16 data with FP32 accumulation (avoid precision loss)
- No WARPSIZE dependency (safe for BI-V100 warp_size=64)
- Boundary checks for non-aligned M/N/K (MoE expert token counts vary)
- BM=128 BN=128 BK=8 TM=8 TN=8 (256 threads, fits BI-V100 128KB smem)
- A transpose in shared memory for coalesced reads
Two entry points:
1. hgemm(A, B) — standalone FP16 GEMM
2. moe_expert_gemm(input, weights, expert_counts) — MoE prefill path
loops over experts with variable token counts
For decode (M=1), use cublasHgemmStridedBatched (confirmed working).
Upstream refs: upstream_ref/sgemm_cuda/6_kernel_vectorize.cuh
upstream_ref/nvidia_sgemm_practice/kernel_6.cuh
2026-08-14 16:22:00 +00:00
..
2026-08-14 12:09:50 +00:00
2026-08-14 07:48:52 +00:00
2026-08-10 09:12:05 +00:00
2026-08-13 02:48:28 +00:00
2026-08-14 16:22:00 +00:00
2026-08-13 03:19:39 +00:00
2026-08-13 03:19:39 +00:00
2026-08-12 01:33:24 +00:00
2026-08-10 04:01:21 +00:00
2026-08-12 01:33:24 +00:00
2026-08-10 07:50:28 +00:00