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
3cdfe1f3
Unverified
Commit
3cdfe1f3
authored
Aug 28, 2024
by
bnellnm
Committed by
GitHub
Aug 28, 2024
Browse files
[Bugfix] Make torch registration of punica ops optional (#7970)
parent
fdd9daaf
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
21 deletions
+37
-21
vllm/lora/ops/bgmv_expand.py
vllm/lora/ops/bgmv_expand.py
+6
-3
vllm/lora/ops/bgmv_expand_slice.py
vllm/lora/ops/bgmv_expand_slice.py
+6
-3
vllm/lora/ops/bgmv_shrink.py
vllm/lora/ops/bgmv_shrink.py
+6
-3
vllm/lora/ops/sgmv_expand.py
vllm/lora/ops/sgmv_expand.py
+6
-3
vllm/lora/ops/sgmv_expand_slice.py
vllm/lora/ops/sgmv_expand_slice.py
+6
-3
vllm/lora/ops/sgmv_shrink.py
vllm/lora/ops/sgmv_shrink.py
+6
-3
vllm/lora/punica.py
vllm/lora/punica.py
+1
-3
No files found.
vllm/lora/ops/bgmv_expand.py
View file @
3cdfe1f3
...
@@ -160,6 +160,9 @@ def _bgmv_expand(
...
@@ -160,6 +160,9 @@ def _bgmv_expand(
return
return
bgmv_expand
=
torch
.
library
.
custom_op
(
"lora::bgmv_expand"
,
try
:
bgmv_expand
=
torch
.
library
.
custom_op
(
"lora::bgmv_expand"
,
_bgmv_expand
,
_bgmv_expand
,
mutates_args
=
[
"output_tensor"
])
mutates_args
=
[
"output_tensor"
])
except
AttributeError
:
bgmv_expand
=
_bgmv_expand
vllm/lora/ops/bgmv_expand_slice.py
View file @
3cdfe1f3
...
@@ -173,6 +173,9 @@ def _bgmv_expand_slice(
...
@@ -173,6 +173,9 @@ def _bgmv_expand_slice(
return
return
bgmv_expand_slice
=
torch
.
library
.
custom_op
(
"lora::bgmv_expand_slice"
,
try
:
bgmv_expand_slice
=
torch
.
library
.
custom_op
(
"lora::bgmv_expand_slice"
,
_bgmv_expand_slice
,
_bgmv_expand_slice
,
mutates_args
=
[
"output_tensor"
])
mutates_args
=
[
"output_tensor"
])
except
AttributeError
:
bgmv_expand_slice
=
_bgmv_expand_slice
vllm/lora/ops/bgmv_shrink.py
View file @
3cdfe1f3
...
@@ -142,6 +142,9 @@ def _bgmv_shrink(
...
@@ -142,6 +142,9 @@ def _bgmv_shrink(
return
return
bgmv_shrink
=
torch
.
library
.
custom_op
(
"lora::bgmv_shrink"
,
try
:
bgmv_shrink
=
torch
.
library
.
custom_op
(
"lora::bgmv_shrink"
,
_bgmv_shrink
,
_bgmv_shrink
,
mutates_args
=
[
"output_tensor"
])
mutates_args
=
[
"output_tensor"
])
except
AttributeError
:
bgmv_shrink
=
_bgmv_shrink
vllm/lora/ops/sgmv_expand.py
View file @
3cdfe1f3
...
@@ -192,6 +192,9 @@ def _sgmv_expand(
...
@@ -192,6 +192,9 @@ def _sgmv_expand(
return
return
sgmv_expand
=
torch
.
library
.
custom_op
(
"lora::sgmv_expand"
,
try
:
sgmv_expand
=
torch
.
library
.
custom_op
(
"lora::sgmv_expand"
,
_sgmv_expand
,
_sgmv_expand
,
mutates_args
=
[
"output_tensor"
])
mutates_args
=
[
"output_tensor"
])
except
AttributeError
:
sgmv_expand
=
_sgmv_expand
vllm/lora/ops/sgmv_expand_slice.py
View file @
3cdfe1f3
...
@@ -205,6 +205,9 @@ def _sgmv_expand_slice(
...
@@ -205,6 +205,9 @@ def _sgmv_expand_slice(
return
return
sgmv_expand_slice
=
torch
.
library
.
custom_op
(
"lora::sgmv_expand_slice"
,
try
:
sgmv_expand_slice
=
torch
.
library
.
custom_op
(
"lora::sgmv_expand_slice"
,
_sgmv_expand_slice
,
_sgmv_expand_slice
,
mutates_args
=
[
"output_tensor"
])
mutates_args
=
[
"output_tensor"
])
except
AttributeError
:
sgmv_expand_slice
=
_sgmv_expand_slice
vllm/lora/ops/sgmv_shrink.py
View file @
3cdfe1f3
...
@@ -189,6 +189,9 @@ def _sgmv_shrink(
...
@@ -189,6 +189,9 @@ def _sgmv_shrink(
return
return
sgmv_shrink
=
torch
.
library
.
custom_op
(
"lora::sgmv_shrink"
,
try
:
sgmv_shrink
=
torch
.
library
.
custom_op
(
"lora::sgmv_shrink"
,
_sgmv_shrink
,
_sgmv_shrink
,
mutates_args
=
[
"output_tensor"
])
mutates_args
=
[
"output_tensor"
])
except
AttributeError
:
sgmv_shrink
=
_sgmv_shrink
vllm/lora/punica.py
View file @
3cdfe1f3
...
@@ -10,10 +10,8 @@ from typing import TYPE_CHECKING, Callable, List, Optional, Tuple, Union
...
@@ -10,10 +10,8 @@ from typing import TYPE_CHECKING, Callable, List, Optional, Tuple, Union
import
torch
import
torch
from
vllm.triton_utils
import
HAS_TRITON
from
vllm.triton_utils
import
HAS_TRITON
from
vllm.utils
import
is_xpu
# FIXME: xpu path doesn't support torch.library.custom_op
if
HAS_TRITON
:
if
HAS_TRITON
and
not
is_xpu
():
from
vllm.lora.ops.bgmv_expand
import
bgmv_expand
from
vllm.lora.ops.bgmv_expand
import
bgmv_expand
from
vllm.lora.ops.bgmv_expand_slice
import
bgmv_expand_slice
from
vllm.lora.ops.bgmv_expand_slice
import
bgmv_expand_slice
from
vllm.lora.ops.bgmv_shrink
import
bgmv_shrink
from
vllm.lora.ops.bgmv_shrink
import
bgmv_shrink
...
...
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