-
-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phi2 rewrite #1058
Phi2 rewrite #1058
Conversation
Looks good to me. I would remove the code you commented out. You can come back to the PR if you need to look up what changed. Also, what are the possibilities of using sample packing with Phi2? |
@casper-hansen will clean up the commented out code As far as sample packing, it should be pretty straightforward. I started working on a fix for the previous implementation #877 but I may simply start over. You had mentioned last year figuring out a way to manage sample packing across all the architectures in a more manageable way. I'm happy to take a stab at it if you have a prrof of concept or anything. |
I had a branch going but didn't get to test and further implement it as I got busy with other stuff. The concept is to have one implementation that can be managed more easily managed in one module. https://github.com/OpenAccess-AI-Collective/axolotl/tree/refactor-flash-attention |
@@ -843,7 +844,14 @@ def build_collator(self, training_args: AxolotlTrainingArguments, **kwargs): | |||
if self.cfg.model_config_type == "mamba": | |||
return MambaDataCollator(tokenizer=self.tokenizer) | |||
|
|||
return BatchSamplerDataCollatorForSeq2Seq( | |||
if training_args.sample_packing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend maybe consolidate the class?
data_collator = BatchSamplerDataCollatorForSeq2Seq if training_args.sample_packing else DataCollatorForSeq2Seq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, looks good on a single 4090 https://api.wandb.ai/links/oaaic/51qvcv4z |
Hi, do I need to change any configuration options or just use the default ones w/ Phi 2? |
disable most of the upcasting to float32 in favor of bfloat16