Files
gym/Cargo.toml
zeekayandHanzo Dev df832f2104 gym 0.1.1: cached decoding, gym synth, gym trainjob
Rollouts go through a KV cache (prompt prefilled once per group, one decode
step per token); cached logits match the full forward to 1e-4. GRPO runs end
to end on Metal — a mixed group at step 5 gives reward 0.75, loss −0.032,
gradient norm 1.19 — after the clipping reduction stopped going through f64,
which Metal does not have.

gym synth ports Data Designer's core: sampler, expression and LLM columns
(text, structured, judge) generated per row in dependency order against any
OpenAI-compatible endpoint, validators that drop or regenerate, jsonl or
parquet out.

gym trainjob is the Kubeflow TrainJob entry for the hosted fine-tuning API:
the broker's env contract becomes a Config; METHOD=lora is served, qlora and
full are refused by name. Dockerfile.cuda and image.yml build
ghcr.io/hanzoai/gym on the forge runners.

84 tests.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-01 10:49:00 -07:00

63 lines
1.7 KiB
TOML

[package]
name = "hanzo-gym"
version = "0.1.1"
edition = "2021"
rust-version = "1.85"
license = "Apache-2.0"
description = "Hanzo Gym — LoRA fine-tuning and GRPO for language models, in Rust on hanzo-ml"
repository = "https://github.com/hanzoai/gym"
keywords = ["llm", "fine-tuning", "lora", "grpo", "training"]
categories = ["science"]
[lib]
name = "gym"
path = "src/lib.rs"
[[bin]]
name = "gym"
path = "src/main.rs"
[dependencies]
hanzo-ml = "0.11.95"
hanzo-nn = "0.11.39"
tokenizers = { version = "0.21", default-features = false, features = ["onig"] }
minijinja = { version = "2", features = ["builtins", "json", "loader"] }
hf-hub = { version = "0.4", default-features = false, features = ["ureq", "rustls-tls"] }
safetensors = "0.7"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
clap = { version = "4", features = ["derive"] }
anyhow = "1"
thiserror = "2"
rand = "0.9"
rand_distr = "0.5"
regex = "1"
indicatif = "0.18"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
ureq = { version = "3", features = ["json"] }
memmap2 = "0.9"
half = "2"
parquet = { version = "58", default-features = false, features = ["json", "snap", "zstd", "lz4", "flate2-zlib-rs", "brotli"] }
minijinja-contrib = { version = "2", features = ["pycompat"] }
chrono = "0.4"
jsonschema = { version = "0.49", default-features = false }
[features]
default = []
cuda = ["hanzo-ml/cuda", "hanzo-nn/cuda"]
cudnn = ["cuda", "hanzo-ml/cudnn"]
metal = ["hanzo-ml/metal", "hanzo-nn/metal"]
accelerate = ["hanzo-ml/accelerate", "hanzo-nn/accelerate"]
mkl = ["hanzo-ml/mkl", "hanzo-nn/mkl"]
[profile.release]
lto = "thin"
codegen-units = 1
[workspace]
[dev-dependencies]
hanzo-transformers = "0.11.9"