[project] name = "kda" version = "0.0.1" description = "Hand-written KDA implementation from naive recurrent to fused Triton + training + inference" requires-python = ">=3.10" # kda 是独立 uv 项目 (自带 uv.lock + .venv), 自声明运行依赖, 不依赖仓库根环境 dependencies = [ "torch>=2.9.0", # uv 解析最新满足版 (含 CUDA 构建); 与根环境 2.9.0+cu128 仅下限一致 "einops>=0.7.0", # kda/ops/reference/chunkwise.py 的 rearrange "packaging>=23.0", # vendored FLA utils version checks "sentencepiece>=0.2.0", # toy SentencePiece "datasets>=3.0.0", # 中文 wiki 语料加载 "transformers>=4.51.0", # Qwen3 tokenizer for 0.5b preset "swanlab>=0.9.7", ] # 训练机 / Docker 镜像: uv sync --extra train [project.optional-dependencies] train = [ "swanlab>=0.6.0", "sacrebleu>=2.4.0", "langdetect>=1.0.9", ] # uv run / uv sync 默认安装 dev group [dependency-groups] dev = [ "pytest>=7.0", "torchlens>=2.34", # 计算图展开集成测试; 未装时测试模块自动 skip "tensorlens>=0.0.3", # Flask viewer 集成测试; 未装时测试模块自动 skip ] [tool.uv] # 公共入口: `from kda import CausalLM, KDAConfig, K3Config, chunk_kda` package = true [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["kda"]