Skip to content

[8/8] feat: add INT4 fake QAT for MoE grouped linear - #9

Merged
yueming-yuan merged 1 commit into
miles-mainfrom
feat/int4-fake-qat
Feb 19, 2026
Merged

[8/8] feat: add INT4 fake QAT for MoE grouped linear#9
yueming-yuan merged 1 commit into
miles-mainfrom
feat/int4-fake-qat

Conversation

@yueming-yuan

Copy link
Copy Markdown
  • Add _FakeInt4QuantizationSTE autograd function with STE backward
  • Add fake_int4_quantization_ste helper preserving main_grad
  • Override TEGroupedLinear._get_weight_tensors for fake QAT
  • Controlled via env vars: OPEN_TRAINING_INT4_FAKE_QAT_FLAG, OPEN_TRAINING_INT4_GROUP_SIZE

Add fake INT4 QAT support for TEGroupedLinear (MoE expert weights).
When OPEN_TRAINING_INT4_FAKE_QAT_FLAG=1, weights are quantized to
INT4 and dequantized with STE (Straight-Through Estimator) during
forward pass. Group size controlled via OPEN_TRAINING_INT4_GROUP_SIZE.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yueming-yuan yueming-yuan changed the title feat: add INT4 fake QAT for MoE grouped linear [8/8] feat: add INT4 fake QAT for MoE grouped linear Feb 19, 2026

@fzyzcjy fzyzcjy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM after offline sync (adding all of them is equiv to .patch)

@yueming-yuan
yueming-yuan merged commit 16ade1c into miles-main Feb 19, 2026
1 check passed
guapisolo pushed a commit that referenced this pull request Feb 26, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
guapisolo pushed a commit that referenced this pull request Mar 2, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.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.

2 participants