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

Setting num-gpus to 0 causes a division by 0 error #83

Open
maxdebayser opened this issue Aug 6, 2024 · 1 comment
Open

Setting num-gpus to 0 causes a division by 0 error #83

maxdebayser opened this issue Aug 6, 2024 · 1 comment
Labels
kind/bug Something isn't working

Comments

@maxdebayser
Copy link
Contributor

This is a very low-priority bug, I'm just taking notes here for the backlog.

If you try to run python -m vllm_tgis_adapter --num-gpus 0 --device cpu it will cause this error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/mbayser/IBMProjects/FoundationModels/inference/vllm-tgis-adapter/build/__editable__.vllm_tgis_adapter-0.0.0-py3-none-any/vllm_tgis_adapter/__main__.py", line 59, in <module>
    engine = AsyncLLMEngine.from_engine_args(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mbayser/IBMProjects/FoundationModels/inference/vllm/build/__editable__.vllm-0.5.4+cpu-cp311-cp311-linux_x86_64/vllm/engine/async_llm_engine.py", line 462, in from_engine_args
    engine_config = engine_args.create_engine_config()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mbayser/IBMProjects/FoundationModels/inference/vllm/build/__editable__.vllm-0.5.4+cpu-cp311-cp311-linux_x86_64/vllm/engine/arg_utils.py", line 865, in create_engine_config
    return EngineConfig(
           ^^^^^^^^^^^^^
  File "<string>", line 15, in __init__
  File "/home/mbayser/IBMProjects/FoundationModels/inference/vllm/build/__editable__.vllm-0.5.4+cpu-cp311-cp311-linux_x86_64/vllm/config.py", line 1644, in __post_init__
    self.model_config.verify_with_parallel_config(self.parallel_config)
  File "/home/mbayser/IBMProjects/FoundationModels/inference/vllm/build/__editable__.vllm-0.5.4+cpu-cp311-cp311-linux_x86_64/vllm/config.py", line 273, in verify_with_parallel_config
    if total_num_attention_heads % tensor_parallel_size != 0:
       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: integer modulo by zero

num-gpus should be ignored completely if device is cpu. But even in the device is gpu there should be a validation error instead of a zero division error.

@maxdebayser maxdebayser added the kind/bug Something isn't working label Aug 6, 2024
@dtrifiro
Copy link
Contributor

dtrifiro commented Aug 8, 2024

This looks like an upstream issue tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants