Skip to content

[Mixtral] Fix loss + nits#28115

Merged
ArthurZucker merged 16 commits into
mainfrom
nit-mixtral
Dec 19, 2023
Merged

[Mixtral] Fix loss + nits#28115
ArthurZucker merged 16 commits into
mainfrom
nit-mixtral

Conversation

@ArthurZucker

@ArthurZucker ArthurZucker commented Dec 18, 2023

Copy link
Copy Markdown
Collaborator

What does this PR do?

Properly compute the loss. Pushes for a uniform distribution.

fixes #28021
Fixes #28093

@ArthurZucker ArthurZucker changed the title [ConfigMixtral] default to not use windowed attention [Mixtral] FIx loss + nits Dec 18, 2023
@ArthurZucker ArthurZucker changed the title [Mixtral] FIx loss + nits [Mixtral] Fix loss + nits Dec 18, 2023

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much, the changes look great, I left one open question about the modeling file

Comment thread src/transformers/tokenization_utils_fast.py Outdated
tie_word_embeddings=False,
rope_theta=1e6,
sliding_window=4096,
sliding_window=None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we completely remove all logic with respect to sliding_window in modeling mixtral?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not BC

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So no we can't

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can maybe deprecate the arg through a deprecation cycle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, let's keep it for performance BC for users that have pushed a mixtral model with sliding window

@ArthurZucker ArthurZucker marked this pull request as ready for review December 19, 2023 09:19

@LysandreJik LysandreJik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the offline explanation, LGTM

Comment thread tests/models/mixtral/test_modeling_mixtral.py Outdated

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! let's 🚢 it

@teknium1

Copy link
Copy Markdown

What does this PR do?

Properly compute the loss. Pushes for a uniform distribution.

fixes #28021 Fixes #28093

What were the side effects of the issue? Did it actually degrade training runs

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.

load_balancing_loss in mixtral model Incorrect router probability calculation

4 participants