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

dependency version check & fix ignore_eos logic #1099

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

grimoire
Copy link
Collaborator

@grimoire grimoire commented Feb 1, 2024

add version check

  • torch [2.0.0, 2.1.2]
  • triton [2.1.0, 2.2.0)
  • transformers [4.33.0, 4.37.1]
  • peft [0.7.1]

fix ignore_eos, model eos and stop words would be moved to bad words when ignore_eos is True.
Tested on chat (with manually set ignore_eos=True), benchmark_pytorch_throughput

stop_words = gen_config.stop_words or []
bad_words = gen_config.bad_words or []
if gen_config.ignore_eos:
bad_words += stop_words
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to clear stop_words? I mean if a word is both a bad_word and a stop_word, what is the expected behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if bad_words:
bad_words = list(set(bad_words))
bad_words_bias = new_scores.new_zeros(new_scores.size(1))
bad_words_bias[bad_words] = filter_value
new_scores += bad_words_bias[None]

bad words would be unique before sampling.

@lvhan028
Copy link
Collaborator

lvhan028 commented Feb 5, 2024

The following tests passed:

  1. lmdeploy chat torch /workspace/models-142/models/internlm2-chat-7b/
  2. lmdeploy serve api_server /workspace/models-142/models/internlm2-chat-7b/ --server-port 33337
  3. profile_throughput.py

@lvhan028 lvhan028 merged commit c332efa into InternLM:main Feb 5, 2024
4 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

3 participants