Skip to content

Replace gpu/kittens with ferro-kittens; bump cuda-oxide to 20a5616 #66

Closed

Description

@feitreim

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:24 CUDA_OXIDE_REF (drives the cargo install cargo-oxide backend rev — the comment above it says keep in sync).
  • SPEC.md cites b099f64 in 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:

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions