Skip to content

update loss utilities to take stage #1077

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

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

H-Huang
Copy link
Member

@H-Huang H-Huang commented Apr 22, 2024

Hit some errors where the non-last stage is trying to get the loss or updating internal losses, so these changes fix that.

Stack from ghstack (oldest at bottom):

[ghstack-poisoned]
H-Huang added a commit that referenced this pull request Apr 22, 2024
ghstack-source-id: 3b39366678901416cd57e2d82c21f91c41a640c0
Pull Request resolved: #1077
@H-Huang H-Huang requested a review from kwen2501 April 22, 2024 15:34
Copy link
Contributor

@kwen2501 kwen2501 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the error.
The requirement for quite a few arguments is why I didn't pack those lines into a function :)
But LGTM in general. Left one comment.

Comment on lines +63 to +67
# if stages not a list turn into a list
if not isinstance(stages, list):
stages = [stages]
contains_last_stage = any([stage.is_last for stage in stages])

Copy link
Contributor

@kwen2501 kwen2501 Apr 22, 2024

Choose a reason for hiding this comment

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

Because of this, maybe consider having two versions of this utility? One for single-stage schedules, the other for multi.

@H-Huang H-Huang merged commit 874ffbd into gh/H-Huang/2/base Apr 22, 2024
6 checks passed
H-Huang added a commit that referenced this pull request Apr 22, 2024
ghstack-source-id: 3b39366678901416cd57e2d82c21f91c41a640c0
Pull Request resolved: #1077
@H-Huang H-Huang deleted the gh/H-Huang/2/head branch April 22, 2024 19:48
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