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
DeepEP
Commits
d4f34978
Commit
d4f34978
authored
Jul 02, 2025
by
Chenggang Zhao
Browse files
Improve layout kernel performance
parent
01f49071
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
csrc/kernels/layout.cu
csrc/kernels/layout.cu
+2
-2
No files found.
csrc/kernels/layout.cu
View file @
d4f34978
...
@@ -121,9 +121,9 @@ void get_dispatch_layout(const int64_t* topk_idx,
...
@@ -121,9 +121,9 @@ void get_dispatch_layout(const int64_t* topk_idx,
int
*
num_tokens_per_expert
,
bool
*
is_token_in_rank
,
int
*
num_tokens_per_expert
,
bool
*
is_token_in_rank
,
int
num_tokens
,
int
num_topk
,
int
num_ranks
,
int
num_experts
,
int
num_tokens
,
int
num_topk
,
int
num_ranks
,
int
num_experts
,
cudaStream_t
stream
)
{
cudaStream_t
stream
)
{
constexpr
int
kNumThreads
=
256
,
kNumExpertsPerSM
=
32
,
kNumRanksPerSM
=
8
;
constexpr
int
kNumThreads
=
256
,
kNumExpertsPerSM
=
4
,
kNumRanksPerSM
=
8
;
int
num_sms
=
((
num_experts
+
kNumExpertsPerSM
-
1
)
/
kNumExpertsPerSM
)
+
(
num_ranks
+
kNumRanksPerSM
-
1
)
/
kNumRanksPerSM
;
int
num_sms
=
((
num_experts
+
kNumExpertsPerSM
-
1
)
/
kNumExpertsPerSM
)
+
(
num_ranks
+
kNumRanksPerSM
-
1
)
/
kNumRanksPerSM
;
EP_STATIC_ASSERT
(
kNum
Expert
sPerSM
%
NUM_MAX_NVL_PEERS
==
0
,
"Invalid number of
expert
s per SM"
);
EP_STATIC_ASSERT
(
kNum
Rank
sPerSM
%
NUM_MAX_NVL_PEERS
==
0
,
"Invalid number of
rank
s per SM"
);
SETUP_LAUNCH_CONFIG
(
num_sms
,
kNumThreads
,
stream
);
SETUP_LAUNCH_CONFIG
(
num_sms
,
kNumThreads
,
stream
);
LAUNCH_KERNEL
(
&
cfg
,
(
get_dispatch_layout
<
kNumThreads
,
kNumExpertsPerSM
,
kNumRanksPerSM
>
),
LAUNCH_KERNEL
(
&
cfg
,
(
get_dispatch_layout
<
kNumThreads
,
kNumExpertsPerSM
,
kNumRanksPerSM
>
),
...
...
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