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

fix dim issue of next_token_logits in sample, or else logits_processo… #301

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

sywangyi
Copy link
Collaborator

…r has issue if repetition_penalty is used

Fixes # (issue)
it will core dump if set following in text generation example
generation_config.do_sample=True
generation_config.repetition_penalty=0.75

coredump trace like
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/work/chatbot/inference/generate.py", line 529, in generate_output
return model.generate(
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/work/optimum-habana/optimum/habana/transformers/generation/utils.py", line 627, in generate
return self.sample(
File "/work/optimum-habana/optimum/habana/transformers/generation/utils.py", line 1531, in sample
streamer.put(next_tokens.cpu())
RuntimeError: [Rank:0] FATAL ERROR :: MODULE:PT_BRIDGE syn compile encountered : Graph compile failed. 26 compile time 55892013 ns

@sywangyi
Copy link
Collaborator Author

@regisss @yao-matrix please have a review.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 19, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

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

LGTM!
Some tests failed because this PR comes from a fork, it's not related to this PR, merging.

@regisss regisss merged commit 9ad7180 into huggingface:main Jul 19, 2023
@regisss
Copy link
Collaborator

regisss commented Jul 19, 2023

@sywangyi You should have received an invitation to join the collaborators of this repo. That way you'll be able to push branches directly here and the whole CI will be enabled in your PRs 🙂

…r has issue if repetition_penalty is used

Signed-off-by: Wang, Yi <[email protected]>
@sywangyi
Copy link
Collaborator Author

@sywangyi You should have received an invitation to join the collaborators of this repo. That way you'll be able to push branches directly here and the whole CI will be enabled in your PRs 🙂

thanks a lot

@sywangyi sywangyi deleted the do_sample branch July 19, 2023 13:51
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