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 pipeline support to eval methods #3684

Merged
merged 14 commits into from
Feb 17, 2022
Merged

Add pipeline support to eval methods #3684

merged 14 commits into from
Feb 17, 2022

Conversation

ericharper
Copy link
Collaborator

What does this PR do ?

Updates .complete and .compute_logprobs to work with pipeline parallelism.

Collection: [NLP]

Changelog

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

Usage

python megatron_gpt_eval.py \
--model_file /raid/nemo_files/gpt_126m_tf32_pp2_tp1/megatron_gpt.nemo \
--prompt "Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men" \
--tensor_model_parallel_size 1 \
--pipeline_model_parallel_size 2 \
--tokens_to_generate 64 \
--stop_after_sentence False --precision 32

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)

@lgtm-com
Copy link

lgtm-com bot commented Feb 15, 2022

This pull request introduces 3 alerts and fixes 2 when merging ad23ab8 into b466ebc - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

Signed-off-by: ericharper <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2022

This pull request introduces 3 alerts and fixes 2 when merging ae1b9d4 into b5012d0 - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

Signed-off-by: ericharper <[email protected]>
@ericharper ericharper marked this pull request as ready for review February 16, 2022 20:31
@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2022

This pull request introduces 4 alerts and fixes 2 when merging 1aee4e4 into 8ffc92e - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 2 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2022

This pull request introduces 4 alerts and fixes 2 when merging 0206a4a into 37fe5b4 - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 2 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

Copy link
Member

@okuchaiev okuchaiev left a comment

Choose a reason for hiding this comment

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

LGTM

@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2022

This pull request introduces 2 alerts and fixes 2 when merging ebed265 into a8f29af - view on LGTM.com

new alerts:

  • 2 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Feb 17, 2022

This pull request introduces 2 alerts and fixes 2 when merging 44ec294 into 49183b7 - view on LGTM.com

new alerts:

  • 2 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

@@ -194,6 +194,8 @@ def pad_collate(batch):
print("***************************")
print(response)
print("***************************")
if args.prompt and not args.compute_logprobs:
print(f'Prompt: {args.prompt}\n\nResponse: {response[0][0][0]}')
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow thats a pretty nested list. Maybe we can make it more structured?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, but not in this PR

@lgtm-com
Copy link

lgtm-com bot commented Feb 17, 2022

This pull request introduces 2 alerts and fixes 2 when merging d26665a into 6dd4263 - view on LGTM.com

new alerts:

  • 2 for Variable defined multiple times

fixed alerts:

  • 2 for Unused local variable

@ericharper ericharper merged commit 31cf580 into main Feb 17, 2022
@ericharper ericharper deleted the gpt_pipeline_eval branch February 17, 2022 18:32
fayejf pushed a commit that referenced this pull request Mar 2, 2022
* update complete method for pipeline

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

* broadcast tokens

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

* print args.prompt and response

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

* print response

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

* update compute_logprobs

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

* style

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

* remove imports

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants