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

dehardcode test string #8865

Merged
merged 9 commits into from
May 3, 2024
Merged

Conversation

JimmyZhang12
Copy link
Collaborator

What does this PR do ?

By default to_word_list_format uses '<extra_id_1>' as its test string to map a string to its tokens, but using '<extra_id_1>' may not map correctly, so add option to specifiy the test string.

Collection: [Note which collection this PR will affect]

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 

Jenkins CI

To run Jenkins, a NeMo User with write access must comment jenkins on the PR.

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)

Signed-off-by: Jimmy Zhang <jiemingz@nvidia.com>
Copy link
Collaborator

@odelalleau odelalleau left a comment

Choose a reason for hiding this comment

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

Just a minor request to update the comment.

Besides this lgtm, but I just want to point out that using <extra_id_1> as stop word with the Llama2 tokenizer is a bad idea since as you mentioned it may be tokenized in various ways when merged with what comes before. When using the text generation from NeMo at least we fall back to the (slower) string matching (here), but with TRT-LLM I don't know if such a string matching exists (?) => one solution could be to postprocess the output to be sure we stop on the first stop word (this has nothing to do with this PR though -- just mentioning it in case this would be relevant to your work)

nemo/export/trt_llm/nemo_utils.py Show resolved Hide resolved
Signed-off-by: JimmyZhang12 <67203904+JimmyZhang12@users.noreply.github.com>
Copy link
Collaborator

@oyilmaz-nvidia oyilmaz-nvidia left a comment

Choose a reason for hiding this comment

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

LGTM.

@JimmyZhang12
Copy link
Collaborator Author

Can this be merged @oyilmaz-nvidia ?

Copy link
Collaborator

@oyilmaz-nvidia oyilmaz-nvidia 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!

@oyilmaz-nvidia
Copy link
Collaborator

jenkins

@oyilmaz-nvidia oyilmaz-nvidia merged commit 57c55f3 into NVIDIA:main May 3, 2024
130 checks passed
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