[PR #3228] [CLOSED] [Other] setup: install the FP4-Local converter's packages before a prepare #4509

Closed
opened 2026-11-07 15:36:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3228
Author: @Yunado
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: fix/nvfp4-local-converter-deps


📝 Commits (1)

  • 29514b2 setup: install the FP4-Local converter's packages before a prepare

📊 Changes

3 files changed (+19 additions, -1 deletions)

View changed files

➕ requirements-nvfp4-local.txt (+7 -0)
📝 setup.py (+4 -0)
📝 tools/nvfp4_local_pack.py (+8 -1)

📄 Description

Fixes #3227

The problem and the result. A fresh source install that picks NVIDIA's FP4-Local model dies at step 6 of SETUP with ModuleNotFoundError: No module named 'transformers', after ~20 minutes of the 102 GB checkpoint has already been read by the PLE step: nvfp4_local_pack.py prepare imports llama.cpp's converter, which needs torch, transformers and safetensors, but setup.py's package step only installs the eight runtime packages of requirements.txt. With this change the same setup completes without the user ever opening a terminal: the packages are installed through the existing pip_install (same pinned-requirements, stamp-skip behavior as requirements-build.txt) immediately before a prepare that actually runs, and the tool run by hand now names the missing package and points at the requirements file instead of a raw traceback.

The approach. Three files, mirroring the BUILD_REQUIREMENTS precedent:

  • requirements-nvfp4-local.txt (new): the three packages pinned to the versions this PC converted with (torch 2.14.1, transformers 5.20.2, safetensors 0.8.0).
  • setup.py: pip_install(requirement_lines(NVFP4_LOCAL_REQUIREMENTS) ...) inside the prepared and not prepared_done branch, so a prepared pack, a ready-made model and every other model never touch the venv.
  • tools/nvfp4_local_pack.py: the lazy converter import catches ModuleNotFoundError for exactly those three names and exits with the fix-it command; any other missing module propagates unchanged.

Validation.

  • passed: py_compile on both edited files; both branches of the tool message checked by importing the module with an injected stub that raises ModuleNotFoundError for transformers (human-readable SystemExit) and for an unrelated name (propagates); the whole setup suite tools/test_setup_*.py, 51 of 54 files OK on this PC.
  • failed (pre-existing, not from this change): test_setup_download.py, test_setup_engine_hash.py and test_setup_golden.py fail identically on the untouched checkout of the same revision on this host (they assert against a pristine temp tree; this clone has a real engine\ install), confirmed by a stash baseline run.
  • not run: a from-scratch .venv end-to-end FP4-Local install on a clean machine (this PC's pack is built and serving). The original crash of #3227 is the exact scenario this opens up; the packages it installs are the ones that completed the conversion here.

Limits. The pins follow today's conversion environment; a future torch/transformers bump needs the same care the other requirements files take. On Linux pip's default torch wheel carries CUDA libraries (~2 GB); the conversion itself runs on the CPU. No engine or serving code is touched; the default path (any model other than FP4-Local) is byte-identical.

Environment: tested at e88ee39d (v0.2.0-beta-12), Windows 11 Pro, Python 3.12.0 venv, RTX 5090 + RTX 3070, 96 GB RAM.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3228 **Author:** [@Yunado](https://github.com/Yunado) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/nvfp4-local-converter-deps` --- ### 📝 Commits (1) - [`29514b2`](https://github.com/Niko1221/Strata/commit/29514b2f6c53bf28ec66d8e39779d5be08be04d1) setup: install the FP4-Local converter's packages before a prepare ### 📊 Changes **3 files changed** (+19 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `requirements-nvfp4-local.txt` (+7 -0) 📝 `setup.py` (+4 -0) 📝 `tools/nvfp4_local_pack.py` (+8 -1) </details> ### 📄 Description Fixes #3227 **The problem and the result.** A fresh source install that picks NVIDIA's FP4-Local model dies at step 6 of SETUP with `ModuleNotFoundError: No module named 'transformers'`, after ~20 minutes of the 102 GB checkpoint has already been read by the PLE step: `nvfp4_local_pack.py prepare` imports llama.cpp's converter, which needs torch, transformers and safetensors, but setup.py's package step only installs the eight runtime packages of requirements.txt. With this change the same setup completes without the user ever opening a terminal: the packages are installed through the existing `pip_install` (same pinned-requirements, stamp-skip behavior as requirements-build.txt) immediately before a prepare that actually runs, and the tool run by hand now names the missing package and points at the requirements file instead of a raw traceback. **The approach.** Three files, mirroring the `BUILD_REQUIREMENTS` precedent: - `requirements-nvfp4-local.txt` (new): the three packages pinned to the versions this PC converted with (torch 2.14.1, transformers 5.20.2, safetensors 0.8.0). - `setup.py`: `pip_install(requirement_lines(NVFP4_LOCAL_REQUIREMENTS) ...)` inside the `prepared and not prepared_done` branch, so a prepared pack, a ready-made model and every other model never touch the venv. - `tools/nvfp4_local_pack.py`: the lazy converter import catches `ModuleNotFoundError` for exactly those three names and exits with the fix-it command; any other missing module propagates unchanged. **Validation.** - passed: `py_compile` on both edited files; both branches of the tool message checked by importing the module with an injected stub that raises `ModuleNotFoundError` for `transformers` (human-readable SystemExit) and for an unrelated name (propagates); the whole setup suite `tools/test_setup_*.py`, 51 of 54 files OK on this PC. - failed (pre-existing, not from this change): `test_setup_download.py`, `test_setup_engine_hash.py` and `test_setup_golden.py` fail identically on the untouched checkout of the same revision on this host (they assert against a pristine temp tree; this clone has a real `engine\` install), confirmed by a stash baseline run. - not run: a from-scratch `.venv` end-to-end FP4-Local install on a clean machine (this PC's pack is built and serving). The original crash of #3227 is the exact scenario this opens up; the packages it installs are the ones that completed the conversion here. **Limits.** The pins follow today's conversion environment; a future torch/transformers bump needs the same care the other requirements files take. On Linux pip's default torch wheel carries CUDA libraries (~2 GB); the conversion itself runs on the CPU. No engine or serving code is touched; the default path (any model other than FP4-Local) is byte-identical. **Environment**: tested at e88ee39d (v0.2.0-beta-12), Windows 11 Pro, Python 3.12.0 venv, RTX 5090 + RTX 3070, 96 GB RAM. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:36:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4509
No description provided.