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

transformer_engine: Control backward FP8 metadata synchronization (v1.6 onwards) #379

Merged
merged 7 commits into from May 13, 2024

Conversation

kshitij12345
Copy link
Collaborator

@kshitij12345 kshitij12345 commented May 8, 2024

Fixes: #368

Failure in above issue happens because we don't always correctly reorder the inputs to the te_linear in distributed setting.

This PR takes a different approach and instead inserts a sync operation in the backward trace which makes us agnostic to the previous constraint.

Details of the approach can be found at : NOTE: Backward FP8 metadata sync in transformer_engineex.py.

NOTE: Once v1.6 is released, I am planning to drop the support for older versions and clean-up the code.

@kshitij12345 kshitij12345 changed the title [WIP] transformer_engine: Control backward FP8 metadata synchronization (v1.6 onwards) transformer_engine: Control backward FP8 metadata synchronization (v1.6 onwards) May 13, 2024
@kshitij12345 kshitij12345 marked this pull request as ready for review May 13, 2024 08:47
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

LGTM

thunder/tests/distributed/test_ddp.py Outdated Show resolved Hide resolved
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
@kshitij12345 kshitij12345 enabled auto-merge (squash) May 13, 2024 11:13
@kshitij12345 kshitij12345 merged commit 08fc560 into Lightning-AI:main May 13, 2024
37 checks passed
@kshitij12345 kshitij12345 deleted the te-fp8-sync-op branch May 13, 2024 12:59
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.

transformer_engine: Fails with Pythia-14m in distributed
3 participants