Expand description
Softcap (tanh-based logit capping) GPU dispatch.
Computes: tanh(logits / cap) * cap
This bounds output logits to the range (-cap, +cap). Gemma 4 uses
cap = 30.0 for final logit capping.
Statics§
- SOFTCAP_
SHADER_ SOURCE - MSL source for the softcap kernels (embedded at compile time).
Functions§
- dispatch_
softcap - Dispatch a softcap operation on the GPU.
- register
- Register softcap shader sources with the given kernel registry.