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(vllm): initializes dictionary entry prior to usage #959

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

CollectiveUnicorn
Copy link
Contributor

@CollectiveUnicorn CollectiveUnicorn commented Aug 28, 2024

Description

Fixes exception occurring when the dictionary entry has not been instantiated before being referenced.

Exception:

│ leapfrogai-model Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                    │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/asyncio/events.py", line 80, in _run                                                                                                                                                                                                                                                   │
│ leapfrogai-model     self._context.run(self._callback, *self._args)                                                                                                                                                                                                                                                                                                    │
│ leapfrogai-model   File "/home/leapfrogai/.venv/lib/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 38, in _raise_exception_on_finish                                                                                                                                                                                                                  │
│ leapfrogai-model     task.result()                                                                                                                                                                                                                                                                                                                                     │
│ leapfrogai-model   File "/home/leapfrogai/.venv/lib/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 508, in run_engine_loop                                                                                                                                                                                                                            │
│ leapfrogai-model     await asyncio.sleep(0)                                                                                                                                                                                                                                                                                                                            │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/asyncio/tasks.py", line 640, in sleep                                                                                                                                                                                                                                                  │
│ leapfrogai-model     await __sleep0()                                                                                                                                                                                                                                                                                                                                  │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/asyncio/tasks.py", line 634, in __sleep0                                                                                                                                                                                                                                               │
│ leapfrogai-model     yield                                                                                                                                                                                                                                                                                                                                             │
│ leapfrogai-model asyncio.exceptions.CancelledError                                                                                                                                                                                                                                                                                                                     │
│ leapfrogai-model Exception in thread Thread-2 (run):                                                                                                                                                                                                                                                                                                                   │
│ leapfrogai-model Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                    │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/threading.py", line 1045, in _bootstrap_inner                                                                                                                                                                                                                                          │
│ leapfrogai-model     self.run()                                                                                                                                                                                                                                                                                                                                        │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/threading.py", line 982, in run                                                                                                                                                                                                                                                        │
│ leapfrogai-model     self._target(*self._args, **self._kwargs)                                                                                                                                                                                                                                                                                                         │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/asyncio/runners.py", line 190, in run                                                                                                                                                                                                                                                  │
│ leapfrogai-model     return runner.run(main)                                                                                                                                                                                                                                                                                                                           │
│ leapfrogai-model            ^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                           │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/asyncio/runners.py", line 118, in run                                                                                                                                                                                                                                                  │
│ leapfrogai-model     return self._loop.run_until_complete(task)                                                                                                                                                                                                                                                                                                        │
│ leapfrogai-model            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                        │
│ leapfrogai-model   File "/home/leapfrogai/.pyenv/versions/3.11.6/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete                                                                                                                                                                                                                               │
│ leapfrogai-model     return future.result()                                                                                                                                                                                                                                                                                                                            │
│ leapfrogai-model            ^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                            │
│ leapfrogai-model   File "/home/leapfrogai/src/main.py", line 184, in iterate_outputs                                                                                                                                                                                                                                                                                   │
│ leapfrogai-model     f"Generated {num_tokens_by_id[request_id]} tokens in {time.time() - t0_by_id[request_id]:.2f}s"                                                                                                                                                                                                                                                   │
│ leapfrogai-model                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                         │
│ leapfrogai-model KeyError: 'e6271f2482fb48a181a2ee79c871b3df'

BREAKING CHANGES

CHANGES

  • Prevents vllm from reaching a finished state without first initializing the token count and text delta.

Related Issue

Fixes #

Relates to #

Checklist before merging

@CollectiveUnicorn CollectiveUnicorn requested a review from a team as a code owner August 28, 2024 18:01
Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for leapfrogai-docs canceled.

Name Link
🔨 Latest commit 462ae30
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/66cf65e009fafc00081c4d18

@CollectiveUnicorn CollectiveUnicorn changed the title Initializes dictionary entry prior to usage fix(vllm): initializes dictionary entry prior to usage Aug 28, 2024
@CollectiveUnicorn CollectiveUnicorn added the bug Something isn't working label Aug 28, 2024
@CollectiveUnicorn CollectiveUnicorn self-assigned this Aug 28, 2024
@CollectiveUnicorn CollectiveUnicorn merged commit d0e09cf into main Aug 28, 2024
20 of 29 checks passed
@CollectiveUnicorn CollectiveUnicorn deleted the vllm-cache-miss-bug branch August 28, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants