mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5098] [Other] nvfp4_convert: spool converted tensors to a temporary file #5308
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5308
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5098
Author: @Tsury
Created: 11/3/2026
Status: 🔄 Open
Base:
main← Head:fix-nvfp4-convert-temp-file📝 Commits (1)
6357ee0nvfp4_convert: spool converted tensors to a temporary file📊 Changes
2 files changed (+12 additions, -1 deletions)
View changed files
📝
docs/NVFP4.md(+3 -0)📝
tools/nvfp4_convert.py(+9 -1)📄 Description
Problem and result
On v0.2.10 (
ffa80d73),tools/nvfp4_convert.pyneeds about as much RAM as the output GGUF. llama.cpp's converter repacks the NVFP4 experts eagerly, and its GGUF writer keeps every added tensor in memory until it writes the file. For Qwen3.8-Flash-Next that is about 76 GB. On a 64 GB machine the conversion swapped and slowed to about one tensor per 2 minutes. On a host with a 24 GB memory limit it was killed by the OOM killer after layer 16.After this change, the converter passes llama.cpp's own
--use-temp-file. Each tensor is spooled to a temporary file as it is added, so RAM stays at about one layer. The temporary file goes next to--outfileunlessTMPDIRis set, because the system temp folder is often a small RAM disk.docs/NVFP4.mdstates the RAM and disk need.Validation
On
ffa80d73+ this change, Linux, Python 3.14, llama.cpp at the commit setup pins:tools/nvfp4_convert.pyon d0xin Swift-1.5 NVFP4-FP8PLE-Rank2-Abliterated (a Qwen3.8-Flash-Next ModelOpt NVFP4 checkpoint) finished in 1567 s. Peak anonymous memory was 2.8 GB. Without the change, the same run was OOM-killed at 24 GB after layer 16.tools/nvfp4_verify.pyon the result: the experts match the checkpoint bit for bit.tools/nvfp4_verify_gguf.py: the GGUF passes.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.