Skip to content

fix(checkpoint): drop entries of nested tuned modules from the loaded state_dict - #44

Draft
lslusarczyk wants to merge 1 commit into
intel:mainfrom
lslusarczyk:fix/checkpoint-consume-nested-tuned-keys
Draft

lslusarczyk wants to merge 1 commit into
intel:mainfrom
lslusarczyk:fix/checkpoint-consume-nested-tuned-keys

Conversation

@lslusarczyk

Copy link
Copy Markdown
Contributor

load now removes every tuned module entry from the state_dict before 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_dict per module.

The new test tunes linear1 only and checks that only linear2 keys remain.
It fails on main with a leftover linear1. entry.

… 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

No deployments
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