-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Adding support for mcore generate #9566
Conversation
Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com>
…o mcore_generation
Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com>
…o mcore_generation
self.eod = tokenizer.eod | ||
self.vocab_size = tokenizer.vocab_size | ||
|
||
def detokenize(self, tokens): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just add these methods to the TokenizerSpec
in nemo so we don't need this wrapper-class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is very specific to mcore generate, so I didnt want to corrupt the original tokenizer spec class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are also reworking tokenizers later maybe for mcore 0.9 or the next release, where nemo and mcore will use the same tokenizer. At that point will unify the apis
Tested that it works. The output of the old code and the new code are exactlly the same. The old code for tp2pp2 gpt3 43b, takes 15 seconds for generating 100 tokens . The new code takes 8.5 seconds all same settings. The text outputs are exactly the same: [{'sentences': ["Q: How are you?\n\nA: I'm doing well. How are you?", 'Q: How big is the universe?\n\nA: The observable universe is 93 billion light years in diameter.'] NEW CODE : ------------- RESULT FOR PROMPT 1 --------------- ------------- RESULT FOR PROMPT 2 --------------- ------------- RESULT FOR PROMPT 3 --------------- |
Signed-off-by: Shanmugam Ramasamy <111910568+shanmugamr1992@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Noting here that we still need ci tests and docs for this.
* Adding support for mcore generate * Apply isort and black reformatting Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> * adding support * Apply isort and black reformatting Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> * adding support --------- Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> Signed-off-by: Shanmugam Ramasamy <111910568+shanmugamr1992@users.noreply.github.com> Co-authored-by: shanmugamr <shanmugamr@nvidia.com> Co-authored-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> Signed-off-by: Tugrul Konuk <ertkonuk@gmail.com>
* Adding support for mcore generate * Apply isort and black reformatting Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> * adding support * Apply isort and black reformatting Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> * adding support --------- Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> Signed-off-by: Shanmugam Ramasamy <111910568+shanmugamr1992@users.noreply.github.com> Co-authored-by: shanmugamr <shanmugamr@nvidia.com> Co-authored-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> Signed-off-by: tonyjie <jl4257@cornell.edu>
* Adding support for mcore generate * Apply isort and black reformatting Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> * adding support * Apply isort and black reformatting Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> * adding support --------- Signed-off-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> Signed-off-by: Shanmugam Ramasamy <111910568+shanmugamr1992@users.noreply.github.com> Co-authored-by: shanmugamr <shanmugamr@nvidia.com> Co-authored-by: shanmugamr1992 <shanmugamr1992@users.noreply.github.com> Signed-off-by: Hainan Xu <hainanx@nvidia.com>
What does this PR do ?
Supports generating though megatron core
Collection: NLP
Changelog
Before your PR is "Ready for review"
Pre checks:
PR Type:
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