Skip to content

feat: add Q8_0 block quantization for SmolVLA weight loading - #1

Open
crustopher-lgtm wants to merge 1 commit into
AIWintermuteAI:mainfrom
crustopher-lgtm:feat/q8_0-weight-quantization
Open

feat: add Q8_0 block quantization for SmolVLA weight loading#1
crustopher-lgtm wants to merge 1 commit into
AIWintermuteAI:mainfrom
crustopher-lgtm:feat/q8_0-weight-quantization

Conversation

@crustopher-lgtm

Copy link
Copy Markdown

Summary

Adds Q8_0 block quantization support to SmolVLA weight loading. Weights can now be stored as int8 quantized matrices (fp16 scale + 32 int8 values per block), reducing memory by 42.5% with 3.56x speedup and R²=0.9995 output correlation vs BF16 baseline.

Changes

  • **** — Added struct (matching GGML layout), / helpers, dtype support in and
  • **** — 7 unit tests for roundtrip accuracy (random, constant, zeros, small values, large range, negatives, symmetry)
  • **** — CTest registration for the new test

Usage

Set env var VLA_WEIGHT_DTYPE=q8_0 before loading the model. Default remains BF16.

Verification

  • All 7 unit tests pass (RMSE <1%, all thresholds met)
  • Full Docker CPU build succeeds with tests enabled
  • Benchmarked: 109s → 31s (3.56x), 42.5% memory reduction

- Add vla_block_q8_0 struct matching GGML block_q8_0 layout (fp16 scale + 32 int8)
- Add quantize_row_q8_0 / dequantize_row_q8_0 helpers
- Add 'q8_0' dtype support in resolve_weight_dtype() and backend_set_from_f32()
- Add 7 unit tests for Q8_0 roundtrip accuracy (random, constant, zeros,
  small values, large range, negatives, symmetry)
- Register test_q8_quant with CTest via CMakeLists.txt
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