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 gradient equivalence test #1066

Merged
merged 2 commits into from
Apr 18, 2024
Merged

Add gradient equivalence test #1066

merged 2 commits into from
Apr 18, 2024

Conversation

kwen2501
Copy link
Contributor

Each stage will check its gradients against a reference model.
The ref model uses a full-batch to run backward.

Copy link
Member

@H-Huang H-Huang left a comment

Choose a reason for hiding this comment

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

Nice!

def test_grad(self):
import random

port = random.randint(29500, 30000)
Copy link
Member

Choose a reason for hiding this comment

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

nit: port 0 instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry what does it mean? I don't think port 0 is a usable port (reserved by OS I think)

)

# Attach to a schedule
ScheduleClass = schedule_map[args.schedule]
Copy link
Member

Choose a reason for hiding this comment

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

cool trick

@kwen2501 kwen2501 merged commit 485f196 into main Apr 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants