[RL] Remove the w13 weight_scale and input_scale for UnquantizedEPMoE… #6308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…Method
Motivation
When doing RL training, we may release all the parameters with
/release_memory_occupation
to free the memory occupied by the inference engine, which will also released all theinput_scale
s andweight_scale
s.Modifications
The origin
w13_weight_scale
inUnquantizedEPMoEMethod
does not support reloading (as the shape should be(num_experts_per_partition, 2)
). And I found that for theUnquantizedEPMoEMethod
, we don't need to instantiatew13_weight_scale
andw13_input_scale
, so removing them could be a better solution than allocating twice the origin memory.And note that we do need to reload the
w2_input_scale
, because if we set that toNone
, it will be initialized totorch.ones
duringEpMoE.forward_normal
. So I need to change the condition in_load_fp8_scale
to allow loadingw2_input_scale
from a random value to 1.Thank you for your time on reviewing this PR :)
Checklist