Skip to content

optimizer de-oscillation#25

Draft
hann-wang wants to merge 10 commits into
devfrom
han/weight-deosc
Draft

optimizer de-oscillation#25
hann-wang wants to merge 10 commits into
devfrom
han/weight-deosc

Conversation

@hann-wang

@hann-wang hann-wang commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Method

  • At the start of each interval, store the FP32 master weights as a reference.
  • During the interval, accumulate the movement of both:
    • FP32 master weights
    • FP4 quantized weights
  • At the end of the interval, mark a weight as oscillatory if the FP4 weight moves significantly more than the FP32 master weight.
  • For oscillatory weights, reset the FP32 master weight to the dequantized FP4 value to suppress quantization-induced instability.
deosc

Usage

Set env var to enable de-oscillation:

  • DEOSC_STEP: de-oscillation is not enabled until this step.
  • DEOSC_RATIO: threshold of dist(FP4)/dist(FP32).

The observation interval is currently hard-coded to 200.

@hann-wang hann-wang changed the title weight de-oscillation optimizer de-oscillation Jun 3, 2026
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