Repository navigation
fix(training): install CUDA PyTorch for training on Windows and show package downloads - #105
Merged
Merged
Conversation
…package downloads On Windows the training environment took PyTorch from PyPI, whose Windows wheel is CPU only, so NVIDIA machines trained on the CPU. PyTorch now comes first from the CUDA wheel indexes the driver runs, newest first, taking the first that carries the version the trainer pins (cu128 stops at 2.11). Linux and macOS keep PyPI, whose wheels already fit. The source is recorded on the environment; an older Windows environment on an NVIDIA machine is installed again and the replaced one deleted. The download is followed from pip or uv output: the training checklist and the 看图拆区域 install show the package being fetched, its size, how far (pip) and how many are done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Issue #8 has two parts. On Windows with an NVIDIA card the app installed the CPU build of PyTorch, and dependency downloads only said "downloading", with no progress.
PyTorch build. Runtimes and KohakuGBC already took PyTorch from the CUDA wheel index. The local training environment did not:
installTrainerRuntimeranpip install -e <trainer>from PyPI, whose Windows wheel is CPU only. Now:torchIndexes(main/services/trainers.ts) decides where it comes from:torch>=2.13,<2.15, and cu128 stops at 2.11, while cu126 and cu130 carry 2.13–2.14.1.versionUnavailable), not on network errors.TrainerRuntimeInfo.torchIndex).nvidia-smidoesn't answer, or fails for a reason other than being missing, nothing is replaced. A CUDA build is never downgraded, since it also runs on the CPU.Download progress.
installPackages(main/services/packageInstall.ts) runs pip or uv and follows their output with a pure parser (main/lib/packageProgress.ts).--progress-bar raw; uv prints no percentage off a terminal), how many packages are done, and when installing starts.readiness.prepare.packagesfeeds the trainer row of the first-use checklist. It shows also while the base model downloads alongside, is sent at most once a second without dropping the last update, and is cleared as soon as the environment ends.GbcSetupProgress.downloadfeeds its row in 设置 › 功能.Wording is
packageProgressTextinlib/format.ts, for example "正在下载 torch · 2.7 GB · 已下载 3 个包".How it was verified
pnpm lint(0 errors; the warnings were already there),pnpm format:check,pnpm typecheck,pnpm test:unit: 3845 passed.test/main/lib/packageProgress.test.tsruns on lines recorded from pip 26 and uv 0.9.test/main/services/trainers.test.tscovers index choice per platform, driver and setting, when an environment counts as current, and network error vs missing version.pnpm build && pnpm test:e2e: 448 passed.training.e2e.ts: the trainer row shows the package download, witharia-valuenow42, while the base model downloads, then the install stage.gbc.e2e.ts: 安装 shows the download in its row.pnpm test:install: not applicable.docs/reference/training.md(theenvironmentstep) anddocs/reference/architecture.md(GBC install).Platforms affected
Notes for the reviewer
resolveTorchIndex(cu128) for its unpinned torch, which works today. If its[torch]extra ever needs torch above 2.11, it should move to the same candidate list.