Skip to content

quantizer: reject non-finite source tensors - #741

Open
exochard wants to merge 1 commit into
antirez:mainfrom
exochard:fix/quantizer-nonfinite-tensors
Open

quantizer: reject non-finite source tensors#741
exochard wants to merge 1 commit into
antirez:mainfrom
exochard:fix/quantizer-nonfinite-tensors

Conversation

@exochard

@exochard exochard commented Aug 7, 2026

Copy link
Copy Markdown

Problem

The DeepSeek quantizer converts source tensors to F32 before applying the selected quantization scheme. Non-finite source values can otherwise be encoded into a GGUF and only surface much later as corrupted routing or activations.

Change

Validate every converted regular HF tensor and every converted routed-expert tensor before imatrix lookup and quantization. On the first NaN or Inf, fail with the source tensor name and element index.

Validation

The quantizer tool builds cleanly with no compiler warnings:

make -C gguf-tools -B

git diff --check is clean. This change is independent of the CUDA runtime and can be reviewed or merged separately from the router and SSD-streaming changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant