Pull requests / #3228
#3228 [Other] setup: install the FP4-Local converter's packages before a prepare
open · @Yunado · 0 comments · View on GitHub
Setup & installNVIDIA / CUDAWindowsLinux
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.
Related on this site
Quick links to related pages.