Skip to content

[LLM] Report skipped quantization layers and enable 8da8w - #22092

Open
JacobSzwejbka wants to merge 2 commits into
mainfrom
fix-22044-quantization-reporting
Open

[LLM] Report skipped quantization layers and enable 8da8w#22092
JacobSzwejbka wants to merge 2 commits into
mainfrom
fix-22044-quantization-reporting

Conversation

@JacobSzwejbka

@JacobSzwejbka JacobSzwejbka commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #22044

  • report how many non-LoRA linear layers 8da4w/8da8w quantization processes and skips
  • warn when a layer is skipped because its input width is not divisible by the requested group size
  • allow the already-supported 8da8w path through LLM config validation
  • share the qmode option list with the legacy CLI validator to keep both entry points consistent

Test plan

  • python -m pytest examples/models/llama/config/test_llm_config.py -q
  • python -m pytest examples/models/llama/source_transformation/test_quantize.py -q
    • exercises actual 8da8w TorchAO quantization, inference, and torch.export.export
    • verifies the skipped-linear warning for an incompatible group size
  • manually confirmed the exported 8da8w graph contains int8 dequantization and produces finite output

@pytorch-bot

pytorch-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22092

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit fecee84 with merge base 9a2d135 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 24, 2026
@JacobSzwejbka JacobSzwejbka added the release notes: quantization Changes to quantization label Aug 24, 2026
output = exported.module()(*inputs)

self.assertEqual(output.shape, (2, 16))
self.assertTrue(torch.isfinite(output).all())

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.

Nit: check against eager?

if verbose:
print("quantized model:", model)
return model
elif qmode in ("8da4w", "8da8w"):

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.

I guess this was already wired and working OK with XNNPACK?

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: quantization Changes to quantization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8da4w silently skips layers that do not divide the group size, and 8da8w is implemented but rejected by config validation

2 participants