Repository navigation
fix(checkpoint): drop entries of nested tuned modules from the loaded state_dict - #44
Draft
lslusarczyk wants to merge 1 commit into
Draft
lslusarczyk wants to merge 1 commit into
lslusarczyk wants to merge 1 commit into
Conversation
… state_dict `load` handed each child a filtered copy of the state_dict. The entry of a nested tuned module was removed from that copy only. It stayed in the state_dict that `load_state_dict(strict=False)` receives, which ignored it. The `if state_dict` skip for a fully tuned module never applied below the top level. Children now share the same state_dict, which also drops one copy per module. Signed-off-by: Łukasz Ślusarczyk <lukasz.slusarczyk@intel.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
loadnow removes every tuned module entry from thestate_dictbefore it loads the remaining weights.Each child got a filtered copy of the
state_dict.A nested tuned module removed its entry from that copy only.
The entry reached
load_state_dict(strict=False), which ignored it.The skip for a fully tuned module never applied below the top level.
Children now share one
state_dict.Lookup is by full key, so the filter changed nothing else.
This also drops one copy of the
state_dictper module.The new test tunes
linear1only and checks that onlylinear2keys remain.It fails on
mainwith a leftoverlinear1.entry.