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

Doing the loss reduction in foundry instead of in the loss functions. #1079

Merged

Conversation

ShashankMosaicML
Copy link
Contributor

@ShashankMosaicML ShashankMosaicML commented Apr 1, 2024

This PR gives us more flexibility to reduce losses in foundry in custom ways.

We see that the changes do not affect the MFU or the convergence for 125M and 7B models.

Screenshot 2024-04-01 at 4 58 49 PM Screenshot 2024-04-02 at 9 17 43 AM

Memory consumption is also similar:

Screenshot 2024-04-02 at 9 21 09 AM Screenshot 2024-04-02 at 9 21 38 AM

@ShashankMosaicML ShashankMosaicML marked this pull request as ready for review April 1, 2024 23:40
@ShashankMosaicML ShashankMosaicML requested review from vchiley and dakinggg and removed request for vchiley April 1, 2024 23:40
@ShashankMosaicML ShashankMosaicML enabled auto-merge (squash) April 2, 2024 16:51
@ShashankMosaicML ShashankMosaicML merged commit 632cb73 into mosaicml:main Apr 2, 2024
9 checks passed
dakinggg added a commit to dakinggg/llm-foundry that referenced this pull request Apr 4, 2024
…mosaicml#1079)

* setting loss_fn reduction to None

* fixing a unit test

* add error message

* adding test to check reduction

* adding test to check reduction

* Update llmfoundry/models/mpt/modeling_mpt.py

Co-authored-by: Vitaliy Chiley <6439018+vchiley@users.noreply.github.com>

* preserving batch dimension of targets

* minor change

---------

Co-authored-by: Vitaliy Chiley <6439018+vchiley@users.noreply.github.com>
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
KuuCi pushed a commit that referenced this pull request Apr 18, 2024
…#1079)

* setting loss_fn reduction to None

* fixing a unit test

* add error message

* adding test to check reduction

* adding test to check reduction

* Update llmfoundry/models/mpt/modeling_mpt.py

Co-authored-by: Vitaliy Chiley <6439018+vchiley@users.noreply.github.com>

* preserving batch dimension of targets

* minor change

---------

Co-authored-by: Vitaliy Chiley <6439018+vchiley@users.noreply.github.com>
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
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.

None yet

3 participants