Pull requests / #3474
#3474 [Other] setup: FP4-Local conversion no longer dies at step 6 on Python 3.15 (torch pin 2.9.1 -> 2.14.1)
open · draft · @beplee · 0 comments · View on GitHub
BenchmarksSetup & installAMD / HIPNVIDIA / CUDAModels & quantsSecurityWindowsLinux
Description
## Problem and result
A Linux source install at v0.2.1.1 (`9ae93f7b`; `requirements-nvfp4-local.txt` byte-identical to v0.2.1, added by `1994f3ac`) choosing **Qwen3.8-Flash-Next (NVFP4) → NVFP4-QAD** dies at step 6 of `./setup.sh` before the conversion starts: setup's own converter-package install cannot resolve the torch pin.
```text
> .venv/bin/python -m pip install --quiet --disable-pip-version-check --extra-index-url https://download.pytorch.org/whl/cpu torch==2.9.1 transformers==4.57.6 safetensors==0.7.0
ERROR: Could not find a version that satisfies the requirement torch==2.9.1 (from versions: 2.13.0+cpu, 2.14.0+cpu, 2.14.1+cpu)
ERROR: No matching distribution found for torch==2.9.1
[X] command failed (exit 1): python
Setup stopped. Fix the item above and run it again - everything already done is kept and skipped.
```
The desktop app's error for this model sends users to this same source-install path ("install them from the source download … ./setup.sh on Linux"), so an app user following that advice gets the same error. With the pin raised, `./setup.sh` finishes on this PC: pip installs `torch 2.14.1+cpu` (`transformers 4.57.6` and `safetensors 0.7.0` unchanged), `tools/nvfp4_local_pack.py prepare` converts the whole 102 GB checkpoint (`ple-nvfp4.gguf` 320001536 rows × 90 B from 128 shards, `dense.gguf` 1079 tensors / 6.0 GB, `experts.bin` 48 layers / 63.28 GiB, MTP draft 29 tensors in `mtp/rt`), the engine loads, setup's tuning runs (1491 prompt tok/s, up to 77.1 tok/s decode at the best PCIe share), and the model serves.
## Related discussion
- Issue #3227: https://github.com/Niko1221/Strata/issues/3227 . Converter packages missing at step 6; closed by @Niko1221, the mechanism landed in v0.2.1 via `1994f3ac`. The shipped pins came from a Windows dev PC.
- PR #3228: https://github.com/Niko1221/Strata/pull/3228 . Still open (@Yunado). Its branch head is `29514b2f` (2026-10-19); its report tested at `e88ee39d` on Windows 11 / Python 3.12. That branch carries its own copy of this file pinning torch 2.14.1 alongside `transformers 5.20.2` / `safetensors 0.8.0`, so torch 2.14.1 is the version that PR already validated and picked. This PR changes only the landed copy on `main`, one pin, the current trio kept. If maintainers prefer to land #3228, this PR can be closed in its favour.
- Searched issues and PRs, all states (`requirements-nvfp4-local`, `torch`, `2.14.1`): no other proposal for this bump.
- No scope agreement needed per CONTRIBUTING (focused fix); none on file.
## Approach
The pinned torch 2.9.1 has no cp315 build on the PyTorch CPU index. That index (fetched 2026-10-20) lists 2.9.1 for cp310–cp314 only, and a Python 3.15 venv sees exactly `2.13.0+cpu / 2.14.0+cpu / 2.14.1+cpu`, which matches the candidate list in the error. torch 2.14.1 carries 41 unique wheels there: 33 `+cpu` builds for cp310–cp315 across manylinux_2_28 x86_64/aarch64, win_amd64, win_arm64 and linux_s390x, plus 8 macOS arm64 wheels (`macosx_14_0_arm64`, which carry no `+cpu`).
The bump is not a clean superset. 2.14.1 drops the free-threaded cp313t builds that 2.9.1 had (manylinux x86_64/aarch64, win_amd64), and the macOS floor moves from macosx_11_0 to macosx_14_0. Neither matters for this file in practice: it installs only on the FP4-Local prepare path, and FP4-Local needs an NVIDIA card, which Macs do not have. Windows is a separate case. `setup.py:2877` passes no extra index there, so Windows pip resolves from PyPI, and PyPI has no torch cp315 wheel for any version. Windows on Python 3.15 stays broken whichever pin this file uses, so that is out of scope here (PyPI torch 2.14.1 win_amd64 covers cp310–cp314 plus cp314t, and it has no cp313t either).
One dependency line changes (`torch==2.9.1` → `torch==2.14.1`), plus two comment lines recording why. The change keeps the repo's exact-pin style: no ranges, no per-platform conditions. `setup.py` needs no change. It also leaves alone the `transformers==4.57.6` / `safetensors==0.7.0` pins, every model other than FP4-Local (`ensure_nvfp4_local_packages()` runs only on a prepare that actually runs, `setup.py:8205`), and all engine and serving code.
## Validation
Environment for every row: Strata @ `9ae93f7b` (v0.2.1.1), Omarchy Linux (Arch-based) x86_64, kernel 7.2.8-9-omarchy; `.venv` Python 3.15.0 (Clang 22.1.3); RTX 5080 + RTX 5060 Ti in a layer split; 94 GB RAM; Ryzen 7 7800X3D; PCIe 5.0 x16; model `nvidia/Qwen3.8-Flash-Next-FP4-Local` (NVFP4-QAD), 256K context, KV cache 8-bit, images on (CPU encoder).
**Passed:**
- Reproduction, run 2026-10-20 in the same venv, resolution only (`--dry-run`, installs nothing):
`python -m pip install --disable-pip-version-check --extra-index-url https://download.pytorch.org/whl/cpu --dry-run torch==2.9.1 transformers==4.57.6 safetensors==0.7.0`
→ `ERROR: Could not find a version that satisfies the requirement torch==2.9.1 (from versions: 2.13.0+cpu, 2.14.0+cpu, 2.14.1+cpu)` / `ERROR: No matching distribution found for torch==2.9.1` (output attached: `repro-pip-dryrun-torch-2.9.1.txt`). The reporter's original `./setup.sh` step-6 failure screenshot shows the same two ERROR lines (attached: `setup-step6-failure-crop.png`; the full terminal shot with local paths is kept by the reporter and available on request).
- Fixed run, attached log (`setup-step6-py315-full-run-sanitized.log` — this is the run after the one-line pin change; steps 1–5 kept/skipped by setup's own marks): the same pip line with `torch==2.14.1` installs, a read-only `pip show` in that venv reads `torch 2.14.1+cpu` / `transformers 4.57.6` / `safetensors 0.7.0` (block attached below; the install itself ran `--quiet`, so the version strings are not in the setup log); prepare completes every step (artifacts above), steps 7+ run, the engine loads, tuning completes, and the model serves.
- Wheel-index check: the CPU-index and PyPI matrices above, fetched 2026-10-20 (candidate lists, cp313t drop, macOS floor, PyPI's missing cp315).
**Failed:** none observed from this change. One pre-existing warning unrelated to the pin: with the pinned `transformers 4.57.6`, `hf-to-gguf` logs `The checkpoint … has model type 'qwen4_exp' but Transformers does not recognize this architecture`, falls back to loading `config.json`, and the export completes. Not touched here; a transformers bump is a separate decision.
**Not run:** Windows and macOS execution (Linux machine only). PyPI Windows wheels ≤ cp314 and Linux cp310–cp314 with the new pin: listed in the index, not installed here. A from-scratch `.venv` reinstall: the fix was exercised in the same venv that failed, which is the exact path #3227 opened. The Windows evidence from #3228 covers torch 2.14.1 on Windows 11 / Python 3.12, but that trio differs (`transformers 5.20.2` / `safetensors 0.8.0`) and its author also marks the from-scratch e2e install as not run. That is their claim, not my measurement.
## Limits
- Windows on Python 3.15 stays broken with any pin until PyPI ships a cp315 torch wheel. That part is upstream's to fix; this PR fixes the CPU-index path.
- The new pin drops free-threaded cp313t and needs macOS 14 or newer for macOS wheels. Both are unreachable paths for this NVIDIA-only model.
- The pin tracks a conversion environment, same as before. Future bumps need the same care the other requirements files take.
- Kept as draft per CONTRIBUTING until the Windows and Linux ≤ 3.14 rows above are run in someone's environment, or a maintainer waives them; targeted runs are welcome in this thread. The claimed scope (Linux, Python 3.15, FP4-Local prepare) was executed end to end.
**Attachments:** repro `pip --dry-run` output: [repro-pip-dryrun-torch-2.9.1.txt](https://gist.githubusercontent.com/beplee/ac5ac53272c0f649bb9357b3b3039a8e/raw/f28839483ae148de60685e1690e93c707e916ed9/repro-pip-dryrun-torch-2.9.1.txt) · full fixed run, private paths → `~`: [setup-step6-py315-full-run-sanitized.log](https://gist.githubusercontent.com/beplee/ac5ac53272c0f649bb9357b3b3039a8e/raw/155bb4c7fe83152ac4c4154b0d0db23814368f95/setup-step6-py315-full-run-sanitized.log) · post-fix `pip show` block: [pip-show-after-fix.txt](https://gist.githubusercontent.com/beplee/ac5ac53272c0f649bb9357b3b3039a8e/raw/5e4473d2009c72c52d8960e338d31a279c193f27/pip-show-after-fix.txt) · reporter's original step-6 ERROR block:

Related on this site
Quick links to related pages.