Skip to content

Support opt-in centered signed INT2 weights (zero point -0.5, levels {-1.5, -0.5, 0.5, 1.5} * scale; requires TFLite 2.23+). - #11772

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
litert_pr_1018485021
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
litert_pr_1018485021

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Support opt-in centered signed INT2 weights (zero point -0.5, levels {-1.5, -0.5, 0.5, 1.5} * scale; requires TFLite 2.23+).

  • Add an opt-in centered algorithm param (default False) to MIN_MAX for signed symmetric 2-bit weights, preserving float32 scales (scale = max|w| / 1.5).
  • Accept a -0.5 zero point for signed INT2 in uniform_quantize and broadcast scalar zero points in broadcast_scale_zp_for_blockwise.
  • Serialize weights with fractional zero points as BlockwiseQuantization with block_shape and FLOAT32 scale and zero-point tensors, updating dequant_insert to insert DEQUANTIZE before quantize_tensor.
  • Bump the consumer op versions that block_shape needs (FULLY_CONNECTED 16/17, EMBEDDING_LOOKUP 6, and DEQUANTIZE 10) and reject unsupported built-in consumers.

@copybara-service
copybara-service Bot force-pushed the litert_pr_1018485021 branch 5 times, most recently from 3b011ce to 8c973f7 Compare November 17, 2026 03:42
@copybara-service copybara-service Bot changed the title Add low-level support for centered signed 2-bit (INT2) quantization (zero_point = -0.5) and N-D BlockwiseQuantization FlatBuffer serialization: Support opt-in centered signed INT2 weights (zero point -0.5, levels {-1.5, -0.5, 0.5, 1.5} * scale; requires TFLite 2.23+). Nov 17, 2026
@copybara-service
copybara-service Bot force-pushed the litert_pr_1018485021 branch 6 times, most recently from 1f27c25 to ff2b6e2 Compare November 19, 2026 23:08
…{-1.5, -0.5, 0.5, 1.5} * scale; requires TFLite 2.23+).

- Add an opt-in `centered` algorithm param (default `False`) to MIN_MAX for signed symmetric 2-bit weights, preserving `float32` scales (`scale = max|w| / 1.5`).
- Accept a `-0.5` zero point for signed INT2 in `uniform_quantize` and broadcast scalar zero points in `broadcast_scale_zp_for_blockwise`.
- Serialize weights with fractional zero points as `BlockwiseQuantization` with `block_shape` and `FLOAT32` scale and zero-point tensors, updating `dequant_insert` to insert `DEQUANTIZE` before `quantize_tensor`.
- Bump the consumer op versions that `block_shape` needs (`FULLY_CONNECTED` 16/17, `EMBEDDING_LOOKUP` 6, and `DEQUANTIZE` 10) and reject unsupported built-in consumers.

LiteRT-PiperOrigin-RevId: 1018485021
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