Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
c954f21a
Unverified
Commit
c954f21a
authored
Dec 19, 2024
by
youkaichao
Committed by
GitHub
Dec 19, 2024
Browse files
[misc] add early error message for custom ops (#11355)
Signed-off-by:
youkaichao
<
youkaichao@gmail.com
>
parent
86c2d8fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
vllm/utils.py
vllm/utils.py
+11
-1
No files found.
vllm/utils.py
View file @
c954f21a
...
...
@@ -1577,8 +1577,18 @@ def direct_register_custom_op(
library object. If you want to bind the operator to a different library,
make sure the library object is alive when the operator is used.
"""
if
is_in_doc_build
()
or
not
supports_custom_op
()
:
if
is_in_doc_build
():
return
if
not
supports_custom_op
():
assert
not
current_platform
.
is_cuda_alike
(),
(
"cuda platform needs torch>=2.4 to support custom op, "
"chances are you are using an old version of pytorch "
"or a custom build of pytorch. It is recommended to "
"use vLLM in a fresh new environment and let it install "
"the required dependencies."
)
return
import
torch.library
if
hasattr
(
torch
.
library
,
"infer_schema"
):
schema_str
=
torch
.
library
.
infer_schema
(
op_func
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment