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

check for first or last stage #6708

Merged
merged 6 commits into from
May 26, 2023
Merged

check for first or last stage #6708

merged 6 commits into from
May 26, 2023

Conversation

ericharper
Copy link
Collaborator

@ericharper ericharper commented May 23, 2023

What does this PR do ?

Fix bug when inference.compute_logprob=True. Only first and last pipeline stages have a response.

Collection: NLP

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

@github-actions github-actions bot added the NLP label May 23, 2023
@ericharper ericharper requested a review from yidong72 May 23, 2023 17:13
titu1994
titu1994 previously approved these changes May 23, 2023
Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@yidong72 yidong72 left a comment

Choose a reason for hiding this comment

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

Looks good. just one comment.

compute_prob_response['offsets'] = offsets
return compute_prob_response
if (
not parallel_state.model_parallel_is_initialized()
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we need this condition not parallel_state.model_parallel_is_initialized()?
if the model_parallel is not initialized, it will throw an exception at the very beginning right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was just trying to make it robust. This method will only be called after parallel_state is initialized?

Copy link
Collaborator

@yidong72 yidong72 May 23, 2023

Choose a reason for hiding this comment

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

this parallel_state.model_parallel_is_initialized() method will always be true after parallel init.

def model_parallel_is_initialized():
    """Check if model and data parallel groups are initialized."""
    if _TENSOR_MODEL_PARALLEL_GROUP is None or \
        _PIPELINE_MODEL_PARALLEL_GROUP is None or \
        _DATA_PARALLEL_GROUP is None:
        return False
    return True

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I mean will this method ever be used without model parallel init?

Copy link
Collaborator

Choose a reason for hiding this comment

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

no. it is only used with model parallel.

Signed-off-by: ericharper <[email protected]>
Signed-off-by: ericharper <[email protected]>
@ericharper ericharper merged commit e806e11 into r1.19.0 May 26, 2023
9 checks passed
@ericharper ericharper deleted the fix_pipeline_eval branch May 26, 2023 22:41
github-actions bot pushed a commit that referenced this pull request May 26, 2023
* check for first or last stage

Signed-off-by: ericharper <[email protected]>

* remove redundant check

Signed-off-by: ericharper <[email protected]>

* fix typo

Signed-off-by: ericharper <[email protected]>

* add map_location

Signed-off-by: ericharper <[email protected]>

---------

Signed-off-by: ericharper <[email protected]>
ericharper added a commit that referenced this pull request May 27, 2023
* check for first or last stage



* remove redundant check



* fix typo



* add map_location



---------

Signed-off-by: ericharper <[email protected]>
Co-authored-by: Eric Harper <[email protected]>
hsiehjackson pushed a commit to hsiehjackson/NeMo that referenced this pull request Jun 2, 2023
* check for first or last stage



* remove redundant check



* fix typo



* add map_location



---------

Signed-off-by: ericharper <[email protected]>
Co-authored-by: Eric Harper <[email protected]>
Signed-off-by: hsiehjackson <[email protected]>
yaoyu-33 pushed a commit that referenced this pull request Oct 16, 2023
* check for first or last stage

Signed-off-by: ericharper <[email protected]>

* remove redundant check

Signed-off-by: ericharper <[email protected]>

* fix typo

Signed-off-by: ericharper <[email protected]>

* add map_location

Signed-off-by: ericharper <[email protected]>

---------

Signed-off-by: ericharper <[email protected]>
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.

None yet

3 participants