Summary
apr rosetta convert fails when converting GGUF to SafeTensors format due to NaN values detected in tensor data during conversion.
Reproduction
apr rosetta convert \
~/.cache/pacha/models/e910cab26ae116eb.gguf \
/tmp/test.safetensors
Error Output
=== Rosetta Stone Conversion ===
Source: /home/noah/.cache/apr-models/qwen2-5-coder-0-5b-instruct/gguf/model.gguf
Target: /home/noah/.cache/apr-models/qwen2-5-coder-0-5b-instruct/safetensors/model.safetensors
--- Source Inspection ---
Format: GGUF
File Size: 491400064 bytes
Tensors: 291
Parameters: 630167424
Architecture: qwen2
Quantization: 0
Converting...
[GH-185] Embedding 151387 BPE merge rules into APR metadata
error: Validation failed: Conversion failed: Invalid model format: PMAT-187:
Tensor 'blk.0.attn_k.weight' contains 108 NaN values (data corruption detected).
Toyota Way: Stop the line - do not pass defects downstream.
Analysis
The NaN values appear during conversion, suggesting one of:
- Dequantization bug - Q4_K_M or other quantized format produces NaN during float conversion
- Source corruption - Original GGUF has bad data (unlikely - GGUF→APR works)
- SafeTensors path bug - Something specific to the SafeTensors writer path
Note: GGUF→APR conversion succeeds for the same source file, which suggests the bug is specific to the SafeTensors conversion path.
Impact
Environment
apr 0.2.12
Model: Qwen/Qwen2.5-Coder-0.5B-Instruct (from pacha cache)
Source: GGUF (491MB, 291 tensors, qwen2 arch)
Expected Behavior
If source GGUF is valid (which it appears to be since APR conversion works), SafeTensors conversion should also succeed.
Summary
apr rosetta convertfails when converting GGUF to SafeTensors format due to NaN values detected in tensor data during conversion.Reproduction
apr rosetta convert \ ~/.cache/pacha/models/e910cab26ae116eb.gguf \ /tmp/test.safetensorsError Output
Analysis
The NaN values appear during conversion, suggesting one of:
Note: GGUF→APR conversion succeeds for the same source file, which suggests the bug is specific to the SafeTensors conversion path.
Impact
Environment
Expected Behavior
If source GGUF is valid (which it appears to be since APR conversion works), SafeTensors conversion should also succeed.