[P0] Fixing LoReFT rotation layer hot loading problem (#114) #123
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.
Descriptions:
As reported in #114, LoReFT experiments with GLUE seem to be not reproducing the results. In fact, the evaluation results are far off. We suspect that model loading from the best checkpoint is not working. Evidence is given:
Thanks to @m-dev12, the issue seems to be that the loaded rotation layer weights are incorrect. The rotation layer is saved as low-rank matrix to save disk space; when loading it back, we overwrite corresponding columns of the rotation weight matrix. It seems like, it does not overwrite.
To resolve this, we modify the loading function inside the intervention to make sure it is properly loaded.