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 trainer.validate example for GPT #6794

Merged
merged 3 commits into from
Jun 6, 2023
Merged

Add trainer.validate example for GPT #6794

merged 3 commits into from
Jun 6, 2023

Conversation

ericharper
Copy link
Collaborator

@ericharper ericharper commented Jun 2, 2023

What does this PR do ?

Enables an example of calling trainer.validate with GPT.

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 Jun 2, 2023
Signed-off-by: ericharper <[email protected]>
@ericharper ericharper requested a review from titu1994 June 2, 2023 05:01
titu1994
titu1994 previously approved these changes Jun 2, 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.

Looks great but should probably be double checked by someone

trainer=trainer,
override_config_path=pretrained_cfg,
save_restore_connector=save_restore_connector,
map_location=f'cuda:{trainer.local_rank}', # map_location is needed for converted models
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't use this usually, is it needed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only for converted checkpoints

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right I do inference with converted checkpoint and had no issues. Oh well if it doesn't hurt then it's ok

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'll test this again to see if we do need it

Copy link
Collaborator

Choose a reason for hiding this comment

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

lets merge this in for current release and we can remove the map location if we don't need it later - doesn't hurt keeping it there for now

@ericharper ericharper requested a review from aklife97 June 2, 2023 05:02
@ericharper ericharper marked this pull request as draft June 5, 2023 04:59
@arendu arendu self-requested a review June 6, 2023 06:01
@arendu
Copy link
Collaborator

arendu commented Jun 6, 2023

Does this script allow you to make the GPTModel score a dataset supplied via args? That would be very useful.

@ericharper ericharper marked this pull request as ready for review June 6, 2023 17:56
Copy link
Collaborator

@aklife97 aklife97 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aklife97 aklife97 merged commit 45144f5 into r1.19.0 Jun 6, 2023
9 checks passed
@aklife97 aklife97 deleted the gpt_validate_script branch June 6, 2023 18:00
github-actions bot pushed a commit that referenced this pull request Jun 6, 2023
* add trainer.validate example

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

* clean up white space

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

* add mbs and gbs to the config

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

---------

Signed-off-by: ericharper <[email protected]>
ericharper added a commit that referenced this pull request Jun 18, 2023
* add trainer.validate example



* clean up white space



* add mbs and gbs to the config



---------

Signed-off-by: ericharper <[email protected]>
Co-authored-by: Eric Harper <[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

4 participants