Enable the native Kev example on NVIDIA GPUs through ExecuTorch's AOTI CUDA backend. The example landed in #23023 with XNNPACK and MLX support.
Kev runs prefill followed by a pointer head over option-boundary hidden states. A prefix snapshot is reused across question batches. The goal is to run this same workflow through the existing C++ API, without Python at inference.
Use Qwen3.5 MoE as the primary reference for CUDA export, native loading, and Gated DeltaNet (GDN). Its chunked GDN kernel and backend tests are useful starting points.
Work to cover:
- Add a CUDA export option for Kev's
prefill and score methods using CudaPartitioner. Reuse the existing GDN prefill kernel, adapting layouts, gate/scaling conventions, and explicit initial/final state to Kev.
- Wire up
aoti_cuda_backend in the example's CMake build and load the .pte plus CUDA delegate .ptd data through Module. Handle device memory and synchronization when retaining prefix snapshots and reading scores on the host.
- Preserve
system_one, explicit prefill/evaluate, configurable token limits, variable question/option counts, and batching beyond eight questions. Repeated evaluations must leave the prefix unchanged.
- Support unquantized BF16 weights while preserving FP32 recurrence, pointer-head scoring, fitted temperature, and checkpoint metadata. Compare logits and probabilities against upstream Kev's PyTorch implementation and the existing FP32 path, with documented tolerances.
- Validate varying batch/sequence shapes, including GDN chunk boundaries and repeated prefix reuse. Add reproducible export/build/run commands and measurements using
kev_benchmark to the README; verify the backbone actually runs on CUDA and report any CPU fallback.
Keep the integration in the existing example and reuse the runner and benchmark. An NVIDIA GPU and CUDA development environment are needed for validation.
cc @iseeyuan @lucylq @helunwencser @tarun292 @kimishpatel @jackzhxng @Gasoonjia @digantdesai
Enable the native Kev example on NVIDIA GPUs through ExecuTorch's AOTI CUDA backend. The example landed in #23023 with XNNPACK and MLX support.
Kev runs prefill followed by a pointer head over option-boundary hidden states. A prefix snapshot is reused across question batches. The goal is to run this same workflow through the existing C++ API, without Python at inference.
Use Qwen3.5 MoE as the primary reference for CUDA export, native loading, and Gated DeltaNet (GDN). Its chunked GDN kernel and backend tests are useful starting points.
Work to cover:
prefillandscoremethods usingCudaPartitioner. Reuse the existing GDN prefill kernel, adapting layouts, gate/scaling conventions, and explicit initial/final state to Kev.aoti_cuda_backendin the example's CMake build and load the.pteplus CUDA delegate.ptddata throughModule. Handle device memory and synchronization when retaining prefix snapshots and reading scores on the host.system_one, explicitprefill/evaluate, configurable token limits, variable question/option counts, and batching beyond eight questions. Repeated evaluations must leave the prefix unchanged.kev_benchmarkto the README; verify the backbone actually runs on CUDA and report any CPU fallback.Keep the integration in the existing example and reuse the runner and benchmark. An NVIDIA GPU and CUDA development environment are needed for validation.
cc @iseeyuan @lucylq @helunwencser @tarun292 @kimishpatel @jackzhxng @Gasoonjia @digantdesai