Skip to content

Remove INT8 per-channel re-encoding from MatMulNBitsToQDQ - #2772

Merged
Jambay Kinley (jambayk) merged 2 commits into
mainfrom
nbudnarain/preserve-matmulnbits-int4
Oct 28, 2026
Merged

Jambay Kinley (jambayk) merged 2 commits into
mainfrom
nbudnarain/preserve-matmulnbits-int4

Conversation

@neilmsft

@neilmsft neilmsft commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Removes the optional use_int8_per_channel re-encoding path from
MatMulNBitsToQDQ, retaining conversion that preserves the original
quantized weights instead of requantizing them to INT8.

Includes regression coverage for blockwise and per-channel weight
preservation, plus a guard that leaves nodes with unsupported
floating-point zero points unchanged.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 22:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change removing optional INT8 re-encoding while retaining weight-preserving conversion.

No open issues 🎉

What changed in this PR

This PR removes optional INT8 per-channel re-encoding from Olive’s MatMulNBitsToQDQ pass, retaining conversion that preserves the original quantized weights.

Changes:

  • Removes the use_int8_per_channel option and its re-encoding helper.
  • Leaves nodes with floating-point zero points unchanged and logs a warning.
  • Replaces re-encoding tests with regression coverage for weight preservation and floating-point zero-point handling.
File Description
test/​passes/​onnx/​test_mnb_to_qdq.py Tests blockwise and per-channel weight preservation, plus skipping unsupported zero points.
olive/​passes/​onnx/​mnb_to_qdq.py Removes INT8 re-encoding and guards against floating-point zero-point conversion.

Review effort: Balanced

@jambayk
Jambay Kinley (jambayk) merged commit 8d8469a into main Oct 28, 2026
12 checks passed
@jambayk
Jambay Kinley (jambayk) deleted the nbudnarain/preserve-matmulnbits-int4 branch October 28, 2026 02:54
Jambay Kinley (jambayk) pushed a commit that referenced this pull request Oct 30, 2026
## Describe your changes

Add optional MatMulNBits activation-computation accuracy overrides to
Olive's Mobius export path.

- Reuse the existing `--int4_accuracy_level` capture CLI option for both
Model Builder and Mobius, moving it outside the Model Builder-only
argument group.
- Forward the shared CLI option to MobiusBuilder's
`matmul_nbits_accuracy_level` setting.
- Accept integer values 0–4. Omitted/null pass settings preserve Mobius
defaults; explicit 0 is forwarded.
- Apply the Mobius override regardless of MatMulNBits weight bit width,
including 8-bit operators. Weight quantization and GatherBlockQuantized
are unchanged.
- Add validation and regression tests for defaults, explicit values,
invalid inputs, and exporter selection.

This PR contains accuracy-override changes only. Post-export LM-head
reblocking has been removed; the recipe now configures the LM head's
group size during quantization. INT4-preserving QDQ conversion changes
remain separate in #2772.

### Validation

- 97 focused Olive CLI/MobiusBuilder tests passed.
- 3 recipe integration tests passed.
- Fresh Gemma 4 E2B recipe preparation completed: quantization, Mobius
capture, QNN compilation, and weight-preservation audits.
- Laptop text and image QNN HTP smoke tests passed with vision enabled
and no model overrides.

The fresh E2E run used per-channel INT4 decoder quantization with an
8-bit/group128 LM-head override. These are functional smoke tests, not
repeated benchmarks or a comprehensive model-quality evaluation.

### Release note

Mobius capture now supports the shared `--int4_accuracy_level` option,
including overrides for 8-bit MatMulNBits operators despite the option's
historical name.

---------

Signed-off-by: neilmsft <neilmsft@hotmail.com>
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.

3 participants