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

Use nullcontext in nl_decoder_engine when timer_manager.current is None #1277

Closed
wants to merge 3 commits into from

Conversation

mgoin
Copy link
Member

@mgoin mgoin commented Sep 25, 2023

There is an error that seems to only happen when generating the second token when streaming=True, but only shows up in specific pipeline setups such as Gradio

Error:

  File "/home/user/.local/lib/python3.10/site-packages/deepsparse/transformers/engines/nl_decoder_engine.py", line 194, in __call__
    with timer.time(f"EXECUTE_ENGINE_SEQ_LEN_{self.sequence_length}"):
AttributeError: 'NoneType' object has no attribute 'time'

This PR simply uses nullcontext to replace the timer if it is None

@mgoin mgoin changed the title [DEBUG] Disable timer for decode Use nullcontext in nl_decoder_engine when self.timer_manager.current is None Sep 30, 2023
@mgoin mgoin marked this pull request as ready for review September 30, 2023 11:53
@mgoin mgoin changed the title Use nullcontext in nl_decoder_engine when self.timer_manager.current is None Use nullcontext in nl_decoder_engine when timer_manager.current is None Sep 30, 2023
@mgoin
Copy link
Member Author

mgoin commented Oct 4, 2023

Resolved by #1294

@mgoin mgoin closed this Oct 4, 2023
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.

None yet

1 participant