Skip to content
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

Add support for drop_last=False #96

Open
odelalleau opened this issue Feb 1, 2024 · 4 comments
Open

Add support for drop_last=False #96

odelalleau opened this issue Feb 1, 2024 · 4 comments

Comments

@odelalleau
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

The current code generally doesn't support drop_last=False.

Describe the solution you'd like

Proper support for drop_last=False. This could be done in two phases:

  1. Support it for validation only
  2. Support it for training as well
@trias702
Copy link
Collaborator

trias702 commented Feb 1, 2024

I see that the current SFT code essentially has drop_last=False for validation. But in a DP setting, how can that work, you won't have equal shards on each DP?

@odelalleau
Copy link
Collaborator Author

I see that the current SFT code essentially has drop_last=False for validation. But in a DP setting, how can that work, you won't have equal shards on each DP?

Yeah, you may need to pad with dummy samples whose loss would be masked out.

@trias702
Copy link
Collaborator

trias702 commented Feb 1, 2024

I see that the current SFT code essentially has drop_last=False for validation. But in a DP setting, how can that work, you won't have equal shards on each DP?

Yeah, you may need to pad with dummy samples whose loss would be masked out.

That sounds like a fairly complex solution which could be cumbersome to maintain. I think the easier, and generally acceptable fix here is to just make all validation use drop_last=True in Aligner. We already do that for DPO and RM.

@odelalleau
Copy link
Collaborator Author

odelalleau commented Feb 1, 2024

But there may be cases where people don't want to drop samples. For instance if you're reporting metrics over an "official" validation set on a common benchmark.

Edit: but I agree the main priority is to avoid crashing by default, so if our current SFT code actually uses drop_last=False by default and crashes because of that, we should instead make it use drop_last=True.

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

No branches or pull requests

2 participants