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
OpenDAS
Lmdeploy
Commits
d5a89465
"vscode:/vscode.git/clone" did not exist on "078eaaf3ffdff0d503e032640a221ccaecd5e158"
Unverified
Commit
d5a89465
authored
Dec 11, 2023
by
Li Zhang
Committed by
GitHub
Dec 11, 2023
Browse files
set smem size for repetition penalty kernel (#818)
parent
a54b16a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/turbomind/kernels/sampling_penalty_kernels.cu
src/turbomind/kernels/sampling_penalty_kernels.cu
+6
-0
No files found.
src/turbomind/kernels/sampling_penalty_kernels.cu
View file @
d5a89465
...
...
@@ -446,10 +446,16 @@ void invokeBatchApplyRepetitionPenalty(T* logits,
dim3
grid
(
local_batch_size
);
size_t
smem_size
=
step
*
(
sizeof
(
float
)
+
sizeof
(
int
));
if
(
penalty_type
==
RepetitionPenaltyType
::
Additive
)
{
check_cuda_error
(
cudaFuncSetAttribute
(
batchApplyRepetitionPenalty
<
T
,
RepetitionPenaltyType
::
Additive
>
,
cudaFuncAttributeMaxDynamicSharedMemorySize
,
smem_size
));
batchApplyRepetitionPenalty
<
T
,
RepetitionPenaltyType
::
Additive
><<<
grid
,
block
,
smem_size
,
stream
>>>
(
logits
,
penalties
,
output_ids
,
batch_size
,
vocab_size
,
input_lengths
,
max_input_length
,
step
);
}
else
if
(
penalty_type
==
RepetitionPenaltyType
::
Multiplicative
)
{
check_cuda_error
(
cudaFuncSetAttribute
(
batchApplyRepetitionPenalty
<
T
,
RepetitionPenaltyType
::
Multiplicative
>
,
cudaFuncAttributeMaxDynamicSharedMemorySize
,
smem_size
));
batchApplyRepetitionPenalty
<
T
,
RepetitionPenaltyType
::
Multiplicative
><<<
grid
,
block
,
smem_size
,
stream
>>>
(
logits
,
penalties
,
output_ids
,
batch_size
,
vocab_size
,
input_lengths
,
max_input_length
,
step
);
}
...
...
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