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

Update test_train_spmd_linear_model.py to show clear loss value #8481

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

ManfeiBai
Copy link
Collaborator

@ManfeiBai ManfeiBai commented Dec 11, 2024

linear model return one dimension value for each input will cause loss not clear, we notice all 0 in loss regression;

so increase return value dimension for used torch.nn.CrossEntropyLoss() to figure out

local passed log: https://gist.github.com/ManfeiBai/df6362c9a76890847127374e60fd6846

@ManfeiBai ManfeiBai marked this pull request as ready for review December 11, 2024 17:43
Copy link
Collaborator

@tengyifei tengyifei left a comment

Choose a reason for hiding this comment

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

Can we add an assertion on line 124 that checks loss is not 0?

@ManfeiBai
Copy link
Collaborator Author

Can we add an assertion on line 124 that checks loss is not 0?

Thanks, nice catch, updated with assertion

@ManfeiBai ManfeiBai requested a review from tengyifei December 11, 2024 21:32
@ManfeiBai ManfeiBai merged commit c05de86 into master Dec 11, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants