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

[shortfin] Unhelpful error when specifying too many devices #1090

Open
Alex-Vasile opened this issue Mar 14, 2025 · 0 comments
Open

[shortfin] Unhelpful error when specifying too many devices #1090

Alex-Vasile opened this issue Mar 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@Alex-Vasile
Copy link
Contributor

When running a sharded model through shortfin, the error messages associated with incorrectly specifying devices are unhelpful.

For example, if running a model sharded over 2 devices, but shortfin is invoked with --device=hip --device_ids 0 1 2 3 4, then shortfin will provide the following error:

ERROR:shortfin_apps.llm.components.service:Fatal error in prefetch invocation
Traceback (most recent call last):
  File "/shark-ai/shortfin/python/shortfin_apps/llm/components/service.py", line 414, in run
    (logits,) = await fn(*args, fiber=self.fiber)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: shortfin_iree-src/runtime/src/iree/base/allocator.c:21: INVALID_ARGUMENT; allocator has no control routine
[2025-03-14 08:44:26.866] [error] [service.py:439] Fatal error in prefetch invocation
Traceback (most recent call last):
  File "/shark-ai/shortfin/python/shortfin_apps/llm/components/service.py", line 414, in run
    (logits,) = await fn(*args, fiber=self.fiber)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: shortfin_iree-src/runtime/src/iree/base/allocator.c:21: INVALID_ARGUMENT; allocator has no control routine
/shark-ai/shortfin/src/shortfin/support/iree_helpers.h:315: UNKNOWN; Unhandled exception: Traceback (most recent call last):
  File "/shark-ai/shortfin/python/shortfin_apps/llm/components/generate.py", line 83, in run
RuntimeError: Async exception on <Worker 'default-inference'>): argmax(): incompatible function arguments. The following argument types are supported:
    1. argmax(input: _shortfin_default.lib.array.device_array, axis: int = -1, out: _shortfin_default.lib.array.device_array | None = None, *, keepdims: bool = False, device_visible: bool = False) -> _shortfin_default.lib.array.device_array

Invoked with types: NoneType

It's not obvious from this error that the issue is with specifying too many devices. If too few devices are specified the error is very actionable. As is the error if we specify more devices than there are on the host.

@Alex-Vasile Alex-Vasile added the enhancement New feature or request label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant