Skip to content

feat: add calibrate() to OutlierTurboQuant for data-driven channel split#64

Open
brosequist wants to merge 1 commit intoTheTom:mainfrom
brosequist:feat/outlier-calibrate
Open

feat: add calibrate() to OutlierTurboQuant for data-driven channel split#64
brosequist wants to merge 1 commit intoTheTom:mainfrom
brosequist:feat/outlier-calibrate

Conversation

@brosequist
Copy link
Copy Markdown

Summary

  • Adds OutlierTurboQuant.calibrate(calibration_vectors) for data-driven outlier channel detection.
  • Computes per-channel RMS across the calibration set and marks channels whose RMS exceeds 3× the median as outlier channels, updating the compressor's split in place.
  • Follows the dynamic-threshold approach from the LLM.int8() / SmoothQuant literature.

Test plan

  • pytest tests/test_outlier.py — includes tests for calibrate() updating the channel mask and handling all-inlier / all-outlier edge cases.

🤖 Generated with Claude Code

Previously the outlier/inlier channel split was set at construction time and
never adjusted. calibrate(calibration_vectors) now computes per-channel RMS,
flags channels whose RMS exceeds 3× the median as outliers, and updates the
split on the compressor — matching the dynamic-threshold approach described
in the LLM.int8() and SmoothQuant literature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.

1 participant