jgrusewski
9951b8b8cb
perf: curiosity training — cuBLAS GEMMs (1085ms → <5ms)
Replace the serial curiosity_fwd_bwd_per_block kernel (CUR_TOTAL_PARAMS=11306
loop iterations × block-level shared-memory reduction per-iteration = 1085ms)
with a cuBLAS GEMM pipeline matching the existing curiosity inference path:
Forward: curiosity_prepare_input → GEMM1(W1) → bias_leaky_relu → GEMM2(W2) → mse_fwd_grad
Backward: gemm_dw(dW2) → bias_grad_reduce(db2) → gemm_dx(d_hidden) → leaky_relu_bwd → gemm_dw(dW1) → bias_grad_reduce(db1)
New CUDA kernels added to curiosity_training_kernel.cu:
- curiosity_mse_fwd_grad: +b2 in-place, d_pred = 2/CUR_OUTPUT*(pred-target)
- curiosity_leaky_relu_bwd: gates d_hidden by sign of post-activation hidden
- curiosity_bias_grad_reduce: sum dy[N, D] over batch → grad_b[D]
GpuCuriosityTrainer rewritten with CuriosityGemm (dedicated cuBLAS+cublasLt
handle) + intermediate buffers (input_buf, hidden_buf, pred_buf, d_hidden_buf).
Reuses forward kernels from curiosity_inference_kernel.cu. Keeps curiosity_adam_step.
Drops partial_grads buffer (max_blocks*11306 floats saved).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:54:18 +02:00
..
2026-04-11 11:54:09 +02:00
2026-04-02 16:29:55 +02:00
2026-04-19 12:54:18 +02:00
2026-04-18 10:30:04 +02:00
2026-04-19 10:16:11 +02:00
2026-03-29 22:35:37 +02:00
2026-03-29 22:35:37 +02:00
2026-04-17 02:05:20 +02:00
2026-03-29 19:18:47 +02:00
2026-04-18 10:19:12 +02:00
2026-04-10 18:54:14 +02:00