Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
4bd18ec0
Unverified
Commit
4bd18ec0
authored
Feb 26, 2024
by
Woosuk Kwon
Committed by
GitHub
Feb 26, 2024
Browse files
[Minor] Fix type annotation in fused moe (#3045)
parent
2410e320
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/model_executor/layers/fused_moe/fused_moe.py
vllm/model_executor/layers/fused_moe/fused_moe.py
+4
-3
No files found.
vllm/model_executor/layers/fused_moe/fused_moe.py
View file @
4bd18ec0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
functools
import
functools
import
json
import
json
import
os
import
os
from
typing
import
Any
,
Dict
,
Optional
from
typing
import
Any
,
Dict
,
Optional
,
Tuple
import
torch
import
torch
import
triton
import
triton
...
@@ -137,7 +137,7 @@ def fused_moe_kernel(
...
@@ -137,7 +137,7 @@ def fused_moe_kernel(
def
moe_align_block_size
(
def
moe_align_block_size
(
topk_ids
:
torch
.
Tensor
,
block_size
:
int
,
topk_ids
:
torch
.
Tensor
,
block_size
:
int
,
num_experts
:
int
)
->
(
torch
.
Tensor
,
torch
.
Tensor
,
torch
.
Tensor
)
:
num_experts
:
int
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
,
torch
.
Tensor
]
:
"""
"""
Aligns the token distribution across experts to be compatible with block size for matrix multiplication.
Aligns the token distribution across experts to be compatible with block size for matrix multiplication.
...
@@ -185,7 +185,8 @@ def invoke_fused_moe_kernel(A: torch.Tensor, B: torch.Tensor, C: torch.Tensor,
...
@@ -185,7 +185,8 @@ def invoke_fused_moe_kernel(A: torch.Tensor, B: torch.Tensor, C: torch.Tensor,
sorted_token_ids
:
torch
.
Tensor
,
sorted_token_ids
:
torch
.
Tensor
,
expert_ids
:
torch
.
Tensor
,
expert_ids
:
torch
.
Tensor
,
num_tokens_post_padded
:
torch
.
Tensor
,
num_tokens_post_padded
:
torch
.
Tensor
,
mul_routed_weight
:
bool
,
top_k
:
int
,
config
:
dict
):
mul_routed_weight
:
bool
,
top_k
:
int
,
config
:
Dict
[
str
,
Any
])
->
None
:
assert
topk_weights
.
stride
(
1
)
==
1
assert
topk_weights
.
stride
(
1
)
==
1
assert
sorted_token_ids
.
stride
(
0
)
==
1
assert
sorted_token_ids
.
stride
(
0
)
==
1
...
...
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