Repository navigation
Description
gpu/kittens was extracted into feitreim/ferro-kittens on 2026-07-26 (last local commit 6b9c883 at 12:35, ferro's first commit at 16:43 the same day) and has been frozen here since, while ferro-kittens has ~167 PRs of evolution on top of the same 1851-line snapshot. Replace the local crate with a git dependency on ferro-kittens and retire gpu/kittens.
The cuda-oxide pin rides along: this repo is at b099f64, ferro-kittens is at 20a5616 (50 upstream commits apart). The pins must match — kittens re-exports and takes cuda_device/cuda_core types in its signatures, so a consumer at a different rev gets two copies of those crates in one graph and type-mismatch errors, and modal_app.py already documents that the cargo-oxide backend and the crates must come from one revision.
Plan
1. Bump cuda-oxide b099f64 → 20a5616 everywhere
- All eight
gpu/*/Cargo.toml(kittens,gemm,flash-attn,model,ops,tensor-gpu,bench-util,vecadd) plus their lockfiles. modal_app.py:24CUDA_OXIDE_REF(drives thecargo install cargo-oxidebackend rev — the comment above it says keep in sync).SPEC.mdcitesb099f64in a few places (lines 21, 1416, 1515); repoint or date the claims rather than leave them asserting the old pin.
Evidence this is cheap: ferro-kittens made the identical bump in feitreim/ferro-kittens#152 with zero non-comment Rust changes — the API surface both projects use was source-compatible across those 50 commits. What did move there was codegen: 46 of 272 register counts shifted. So expect register/occupancy numbers here to move too; re-baseline any gates that pin counts instead of treating shifts as regressions.
2. Swap the dependency
In gemm, flash-attn, model (the three consumers):
kittens = { package = "ferro-kittens", git = "https://github.com/feitreim/ferro-kittens", rev = "<pin>", features = ["host"] }ferro-kittens' [lib] name is still kittens, so every use kittens::… path keeps its spelling — the migration cost is API drift, not import churn. Pin a rev rather than tracking main (it moves daily); caa6075 is current HEAD. Only flash-attn and model need features = ["host"] today; gemm currently takes the default features — preserve that split.
3. Fix API drift at the call sites
Survey of the kernels' actual imports against current ferro-kittens:
Still present by name (signatures need a compile-driven pass, several are now generic where they were concrete): mma::{mma_ab, mma_abt}, tmem::{TmemTile, alloc_block, dealloc_block}, sync::{Semaphore, SemaphoreRing, PhasedSemaphore}, shared::{Bf16, SharedTile, SharedTileRing, Swizzle128B}, global::{PanelMap, encode_bf16_panels}, ldst::stmatrix_m8n8_x2, pipeline::run.
Known breaks:
ldst::store_fragment_bf16is gone — the store path is element-generic now (store_fragment, plus a_x4form that is what ferro's shipped GEMM epilogue uses). Used in this repo's kernels.Semaphore::multicast_alias()(called atgpu/gemm/src/optimized.rs:65) was removed in Semaphore cluster-scope arrival: the GEMM deadlocks without a workaround ferro-kittens#50 — it was correct only for rank 0 of a CTA pair. Replacement isSemaphore::at_rank(mapa-based, any rank).pipeline::Job(implemented byflash-attn'sPersistentForward) has been reshaped: item mapping is%clusterid-based (pipeline::run cannot schedule a cluster: work items are blockIdx.x-strided ferro-kittens#51), the trait carriesRANKS, andrun_stealing/groupedexist besiderun. At a one-CTA cluster the new mapping degenerates to the old loop, so this may be a trait-conformance fix rather than a rewrite.
Scale: the three consumers are ~17k lines, but the drift is confined to kittens call sites. Rough estimate: low hundreds of changed lines, concentrated in flash-attn/src/tcgen05.rs and gemm/src/optimized.rs.
4. Delete gpu/kittens
After the consumers build against the git dep. Its history is preserved here and its living descendant is ferro-kittens.
5. Verify
cargo oxide build --arch sm_100aof all kernel crates throughmodal_app.py(post-monomorphizationconstasserts only fire at codegen).- Device tests / numeric gates for gemm, flash-attn, model on B200.
- Expect register-count and occupancy shifts from the pin bump alone (per The pin moves to 20a5616, and two doc claims did not survive the audit ferro-kittens#152); compare against re-baselined numbers.
Scope guard
This is a rename-level port: make the kernels compile and pass against ferro-kittens' current surface, nothing more. Adopting the new surface — kittens::lane()/warp_id() (#127), plan::SharedPlan (#125), the mm_* fresh-accumulator entry points, epilogue::StoreRing — is real improvement but belongs in follow-ups, so the migration diff stays reviewable and any numeric change is attributable to the swap itself.
Activity
sample.rs never followed the model to an L-deep MoE stack