From ebd329f8bc080bbc64fbea3167501636c94a2382 Mon Sep 17 00:00:00 2001 From: BREW <81044362+b-re-w@users.noreply.github.com> Date: Sat, 3 Oct 2026 15:25:53 +0900 Subject: [PATCH] Chore: Install CPU torch wheels on Windows and Linux The engine runs on CPU, but Windows took torch from the CUDA 12.8 index and Linux took PyPI's CUDA build: several GB of downloads with no use. Both now use the PyTorch CPU index; macOS keeps the PyPI default. CUDA returns in M4 as a cuda extra. AGENTS.md also notes that executable bits must be set with git update-index --chmod=+x (core.fileMode=false). --- AGENTS.md | 8 ++++++-- pyproject.toml | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 264066d9..f6259a70 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -235,14 +235,18 @@ report it as coverage. New behaviour starts with a real failing test (rule 5). ## 15. Dependencies - `torch` and `torchnative` are mutually exclusive extras (torchnative replaces `import torch`). - Do not add a version pin to `torch`; the Windows wheels come from the CUDA index configured under - `[tool.uv.sources]`. + Do not add a version pin to `torch`; on Windows and Linux it comes from the PyTorch CPU index + configured under `[tool.uv.sources]` (the engine runs on CPU; CUDA returns in M4 as a `cuda` extra). - The engine uses only the public `torch` / `transformers` API. Custom kernels cannot be registered from Gemstone (`torch.library` is a no-op on torchnative); they belong in torchnative. - Kotlin and library versions live in `gradle/libs.versions.toml`. Bump them there, not inline. ## 16. Line endings and encoding +This repository's git config has `core.fileMode=false`, so `chmod +x` is not recorded: set the +executable bit of a tracked script with `git update-index --chmod=+x ` (`gradlew` and +`tools/*.sh` were affected). + Write every file as UTF-8 with LF line endings. Some checkouts of this repository have had files converted to CRLF by an editor; do not mass-convert files you were not asked to touch, because the whole-file diff hides real changes. The repository's `.gitattributes` fixes LF (only `.bat`, `.cmd` and `.ps1` are CRLF), so new diff --git a/pyproject.toml b/pyproject.toml index df344a57..3d3d9436 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,15 +48,17 @@ conflicts = [ prerelease = "if-necessary" +# The engine runs on CPU (CUDA is planned for M4 as a `cuda` extra), so Windows and Linux take the +# PyTorch CPU wheels instead of multi-GB CUDA builds; macOS uses the PyPI default (CPU/MPS). [tool.uv.sources] torch = [ - { index = "pytorch-windows", marker = "platform_system == 'Windows'" }, + { index = "pytorch-cpu", marker = "platform_system == 'Windows' or platform_system == 'Linux'" }, ] [[tool.uv.index]] -name = "pytorch-windows" -url = "https://download.pytorch.org/whl/cu128" +name = "pytorch-cpu" +url = "https://download.pytorch.org/whl/cpu" explicit = true