Expand description
2026-09-25: Host launch of the Kimi K3 KDA decode kernels (PTX module MODULE) for one token.
Two launches per token: CONV_ENTRY updates the short-conv state and
applies SiLU, then RECURRENT_ENTRY L2-normalises q and k and runs the
gated delta-rule step. The CPU reference is
kda_decode_token.
Decode uses launch_k3_kda_decode_token_on_device unless K3_CUDA_KDA=0.
Owner: model-arch, Kimi K3. Invariants:
- Every temporary device buffer a launch allocates gets a
freecall before it returns, on success and on error; a failedfreeis ignored. KdaDeviceState::alloc_and_upload, when it fails, callsfreeon what it allocated, ignoring a failedfree.
Structs§
- K3Kda
Decode Kernels - KdaDevice
State - 2026-09-25: One sequence’s KDA conv and recurrent state on the device.
launch_k3_kda_decode_token_on_deviceupdates it in place and copies only the output back;downloadcopies it to a hostKdaState.
Constants§
- CONV_
ENTRY - MODULE
- 2026-09-25: Built from
kernels/gb10/kimi-k3/bf16/kda_decode.cu. - RECURRENT_
ENTRY
Functions§
- launch_
k3_ kda_ decode_ token - 2026-09-25: One decode token against a host
KdaState: uploads the state, runs both kernels, and downloads the updated state. - launch_
k3_ kda_ decode_ token_ on_ device - 2026-09-25: One decode token against a
KdaDeviceState; only the output is copied back to the host.