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
ox696c
ktransformers
Commits
ca9695b4
Unverified
Commit
ca9695b4
authored
Apr 03, 2025
by
Atream
Committed by
GitHub
Apr 03, 2025
Browse files
Merge pull request #1033 from kvcache-ai/Atream-patch-1
Update modeling_deepseek_v3.py
parents
016d11e6
e36ddc36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
ktransformers/models/modeling_deepseek_v3.py
ktransformers/models/modeling_deepseek_v3.py
+1
-1
No files found.
ktransformers/models/modeling_deepseek_v3.py
View file @
ca9695b4
...
@@ -436,7 +436,7 @@ class MoEGate(nn.Module):
...
@@ -436,7 +436,7 @@ class MoEGate(nn.Module):
### select top-k experts
### select top-k experts
if
self
.
topk_method
==
"noaux_tc"
:
if
self
.
topk_method
==
"noaux_tc"
:
assert
not
self
.
training
#
assert not self.training
scores_for_choice
=
scores
.
view
(
bsz
*
seq_len
,
-
1
)
+
self
.
e_score_correction_bias
.
unsqueeze
(
0
)
scores_for_choice
=
scores
.
view
(
bsz
*
seq_len
,
-
1
)
+
self
.
e_score_correction_bias
.
unsqueeze
(
0
)
group_scores
=
(
group_scores
=
(
scores_for_choice
.
view
(
bsz
*
seq_len
,
self
.
n_group
,
-
1
).
topk
(
2
,
dim
=-
1
)[
0
].
sum
(
dim
=
-
1
)
scores_for_choice
.
view
(
bsz
*
seq_len
,
self
.
n_group
,
-
1
).
topk
(
2
,
dim
=-
1
)[
0
].
sum
(
dim
=
-
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