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
668ec4ef
"vllm/vscode:/vscode.git/clone" did not exist on "2aedb72b217f8961823bbcac488c03b31f8273db"
Commit
668ec4ef
authored
Aug 21, 2024
by
zhuwenwen
Browse files
Update refactoring operation
parent
8a325c18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
28 deletions
+28
-28
vllm/attention/ops/paged_attn.py
vllm/attention/ops/paged_attn.py
+22
-22
vllm/model_executor/layers/activation.py
vllm/model_executor/layers/activation.py
+1
-1
vllm/model_executor/layers/layernorm.py
vllm/model_executor/layers/layernorm.py
+5
-5
No files found.
vllm/attention/ops/paged_attn.py
View file @
668ec4ef
...
...
@@ -193,28 +193,28 @@ class PagedAttention:
if
envs
.
VLLM_USE_OPT_OP
:
ops
.
paged_attention_v2_opt
(
output
,
exp_sums
,
max_logits
,
tmp_output
,
query
,
key_cache
,
value_cache
,
num_kv_heads
,
scale
,
block_tables
,
seq_lens
,
block_size
,
max_seq_len
,
alibi_slopes
,
kv_cache_dtype
,
kv_scale
,
tp_rank
,
blocksparse_local_blocks
,
blocksparse_vert_stride
,
blocksparse_block_size
,
blocksparse_head_sliding_step
,
)
output
,
exp_sums
,
max_logits
,
tmp_output
,
query
,
key_cache
,
value_cache
,
num_kv_heads
,
scale
,
block_tables
,
seq_lens
,
block_size
,
max_seq_len
,
alibi_slopes
,
kv_cache_dtype
,
kv_scale
,
tp_rank
,
blocksparse_local_blocks
,
blocksparse_vert_stride
,
blocksparse_block_size
,
blocksparse_head_sliding_step
,
)
else
:
ops
.
paged_attention_v2
(
output
,
...
...
vllm/model_executor/layers/activation.py
View file @
668ec4ef
...
...
@@ -36,7 +36,7 @@ class SiluAndMul(CustomOp):
output_shape
=
(
x
.
shape
[:
-
1
]
+
(
d
,
))
out
=
torch
.
empty
(
output_shape
,
dtype
=
x
.
dtype
,
device
=
x
.
device
)
if
envs
.
VLLM_USE_OPT_OP
:
ops
.
silu_and_mul
(
out
,
x
)
ops
.
silu_and_mul
_opt
(
out
,
x
)
else
:
ops
.
silu_and_mul
(
out
,
x
)
return
out
...
...
vllm/model_executor/layers/layernorm.py
View file @
668ec4ef
...
...
@@ -70,11 +70,11 @@ class RMSNorm(CustomOp):
out
=
torch
.
empty_like
(
x
)
if
envs
.
VLLM_USE_OPT_OP
:
ops
.
rms_norm_opt
(
out
,
x
,
self
.
weight
.
data
,
self
.
variance_epsilon
,
)
out
,
x
,
self
.
weight
.
data
,
self
.
variance_epsilon
,
)
else
:
ops
.
rms_norm
(
out
,
...
...
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