Distill megatron - test Draft WIP#352
Closed
younesbelkada wants to merge 175 commits intobigscience-workshop:mainfrom
Closed
Distill megatron - test Draft WIP#352younesbelkada wants to merge 175 commits intobigscience-workshop:mainfrom
younesbelkada wants to merge 175 commits intobigscience-workshop:mainfrom
Conversation
…n-DeepSpeed into bigscience-workshop-main
This reverts commit b986a83.
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.
An attempt to perform knowledge distillation using Megatron-DeepSpeed
disclaimer: this is a super ugly version of the code, the PR is here to compare the difference between the original code and this modified version - for now I don't plan to merge this PR
Updates on 28.09.2022
This version is very ugly, I had to add an argument
student_on all megatron modules since the arguments are directly retrieved from the global variable. The other solution could be to have each class re-written with the suffixStudent- egGPTModelStudentPipe. I preferred the first solution to have a quick working implementation.The forward and backward pass seems to pass for the student model - for now I am not computing the teacher's logits..
Two solutions for that
1 - In
distill_train_step- add a step where we retrieve the teacher's logits. In this case would we need to change thedeepspeed.PipelineEngineinternals?2- Store the embedding layer of the teacher model inside the student model and gather the last hidden states of the teacher model. Once this is gathered apply the forward pass with the embedding layer of the teacher model to get the logits. (cc @thomasw21 as discussed offline)
main TODOs