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

[Frontend] add tok/s speed metric to llm class when using tqdm #4400

Merged
merged 8 commits into from
May 9, 2024
Merged

[Frontend] add tok/s speed metric to llm class when using tqdm #4400

merged 8 commits into from
May 9, 2024

Conversation

MahmoudAshraf97
Copy link
Contributor

@MahmoudAshraf97 MahmoudAshraf97 commented Apr 26, 2024

This PR adds a speed metric to the progress bar when using tqdm


PR Checklist (Click to Expand)

Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.

PR Title and Classification

Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:

  • [Bugfix] for bug fixes.
  • [CI/Build] for build or continuous integration improvements.
  • [Doc] for documentation fixes and improvements.
  • [Model] for adding a new model or improving an existing model. Model name should appear in the title.
  • [Frontend] For changes on the vLLM frontend (e.g., OpenAI API server, LLM class, etc.)
  • [Kernel] for changes affecting CUDA kernels or other compute kernels.
  • [Core] for changes in the core vLLM logic (e.g., LLMEngine, AsyncLLMEngine, Scheduler, etc.)
  • [Hardware][Vendor] for hardware-specific changes. Vendor name should appear in the prefix (e.g., [Hardware][AMD]).
  • [Misc] for PRs that do not fit the above categories. Please use this sparingly.

Note: If the PR spans more than one category, please include all relevant prefixes.

Code Quality

The PR need to meet the following code quality standards:

  • We adhere to Google Python style guide and Google C++ style guide.
  • Pass all linter checks. Please use format.sh to format your code.
  • The code need to be well-documented to ensure future contributors can easily understand the code.
  • Include sufficient tests to ensure the project to stay correct and robust. This includes both unit tests and integration tests.
  • Please add documentation to docs/source/ if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.

Notes for Large Changes

Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with rfc-required and might not go through the PR.

What to Expect for the Reviews

The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:

  • After the PR is submitted, the PR will be assigned to a reviewer. Every reviewer will pick up the PRs based on their expertise and availability.
  • After the PR is assigned, the reviewer will provide status update every 2-3 days. If the PR is not reviewed within 7 days, please feel free to ping the reviewer or the vLLM team.
  • After the review, the reviewer will put an action-required label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.
  • Please respond to all comments within a reasonable time frame. If a comment isn't clear or you disagree with a suggestion, feel free to ask for clarification or discuss the suggestion.

Thank You

Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!

vllm/entrypoints/llm.py Outdated Show resolved Hide resolved
@MahmoudAshraf97 MahmoudAshraf97 requested a review from mgoin April 30, 2024 15:11
@DamianB-BitFlipper
Copy link

This contribution would be much appreciated!

@MahmoudAshraf97
Copy link
Contributor Author

@mgoin Sorry to bother you, I guess the failures in the CI aren't related to my change

vllm/entrypoints/llm.py Outdated Show resolved Hide resolved
vllm/entrypoints/llm.py Outdated Show resolved Hide resolved
@MahmoudAshraf97 MahmoudAshraf97 requested a review from simon-mo May 7, 2024 10:33
@simon-mo
Copy link
Collaborator

simon-mo commented May 8, 2024

This is erroring in CI

https://buildkite.com/vllm/ci/builds/6751#018f529b-4a51-431a-b1d0-0a4daeb8d49f/319-360

35%|███▌      | 7/20 [00:04<00:08,  1.55it/s]--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1100, in emit
    msg = self.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
  File "/usr/local/lib/python3.10/dist-packages/vllm/logger.py", line 24, in format
    msg = logging.Formatter.format(self, record)
  File "/usr/lib/python3.10/logging/__init__.py", line 678, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.10/logging/__init__.py", line 368, in getMessage
    msg = msg % self.args
ValueError: unsupported format character ',' (0x2c) at index 159
Call stack:
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.10/dist-packages/vllm/entrypoints/openai/api_server.py", line 169, in <module>
    uvicorn.run(app,
  File "/usr/local/lib/python3.10/dist-packages/uvicorn/main.py", line 575, in run
    server.run()
  File "/usr/local/lib/python3.10/dist-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/dist-packages/vllm/engine/async_llm_engine.py", line 470, in engine_step
    request_outputs = await self.engine.step_async()
  File "/usr/local/lib/python3.10/dist-packages/vllm/engine/async_llm_engine.py", line 226, in step_async
    self.stat_logger.log(self._get_stats(scheduler_outputs))
  File "/usr/local/lib/python3.10/dist-packages/vllm/engine/metrics.py", line 229, in log
    logger.info(
Message: 'Avg prompt throughput: %.1f tokens/s, Avg generation throughput: %.1f tokens/s, Running: %d reqs, Swapped: %d reqs, Pending: %d reqs, GPU KV cache usage: %.1f%, CPU KV cache usage: %.1f%'
Arguments: (154.2963163763204, 213.39696198061793, 13, 0, 0, 23.515151515151512, 0.0)

@MahmoudAshraf97
Copy link
Contributor Author

@simon-mo I don't think this is related to my PR, it was fixed in #4396
I synced my fork and hopefully it will pass the CI

@simon-mo simon-mo enabled auto-merge (squash) May 8, 2024 17:25
@simon-mo
Copy link
Collaborator

simon-mo commented May 9, 2024




Processed prompts: 100%\|██████████\| 1000/1000 [01:02<00:00, 16.10it/s, Generation Speed: 4122.04 toks/s]
 

LGTM!

@simon-mo simon-mo disabled auto-merge May 9, 2024 05:02
@simon-mo simon-mo merged commit 16bc0a0 into vllm-project:main May 9, 2024
51 of 55 checks passed
z103cb pushed a commit to z103cb/opendatahub_vllm that referenced this pull request May 9, 2024
robertgshaw2-redhat pushed a commit to neuralmagic/nm-vllm that referenced this pull request May 19, 2024
dtrifiro pushed a commit to dtrifiro/vllm that referenced this pull request May 21, 2024
Temirulan pushed a commit to Temirulan/vllm-whisper that referenced this pull request Sep 6, 2024
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.

4 participants