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
jerrrrry
infinicore
Commits
6df3f51f
Commit
6df3f51f
authored
Apr 08, 2025
by
Zimin Li
Browse files
issue/127: remove the testing-purpose mix-precision implementation of swiglu in swiglu_cuda.cuh
parent
a283a8fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
19 deletions
+0
-19
src/infiniop/ops/swiglu/cuda/swiglu_cuda_internal.cuh
src/infiniop/ops/swiglu/cuda/swiglu_cuda_internal.cuh
+0
-19
No files found.
src/infiniop/ops/swiglu/cuda/swiglu_cuda_internal.cuh
View file @
6df3f51f
...
@@ -34,25 +34,6 @@ public:
...
@@ -34,25 +34,6 @@ public:
return
gate
*
sigmoid
(
gate
)
*
up
;
return
gate
*
sigmoid
(
gate
)
*
up
;
}
}
}
}
template
<
typename
Tc
,
typename
Ta
,
typename
Tb
>
__device__
__forceinline__
Tc
operator
()(
const
Ta
&
up
,
const
Tb
&
gate
)
const
{
if
constexpr
(
std
::
is_same_v
<
Ta
,
half2
>
)
{
return
__hmul2
(
__hmul2
(
gate
,
sigmoid
(
gate
)),
up
);
}
else
if
constexpr
(
std
::
is_same_v
<
Ta
,
half
>
&&
std
::
is_same_v
<
Tb
,
float
>
)
{
if
constexpr
(
std
::
is_same_v
<
Tc
,
half
>
)
{
return
__float2half
(
__fmul_rd
(
__fmul_rd
(
gate
,
sigmoid
(
gate
)),
__half2float
(
up
)));
}
else
{
return
__fmul_rd
(
__fmul_rd
(
gate
,
sigmoid
(
gate
)),
__half2float
(
up
));
}
}
else
if
constexpr
(
std
::
is_same_v
<
Ta
,
half
>
)
{
return
__hmul
(
__hmul
(
gate
,
sigmoid
(
gate
)),
up
);
}
else
if
constexpr
(
std
::
is_same_v
<
Ta
,
float
>
)
{
return
__fmul_rd
(
__fmul_rd
(
gate
,
sigmoid
(
gate
)),
up
);
}
else
{
return
gate
*
sigmoid
(
gate
)
*
up
;
}
}
}
SwiGLUOp
;
}
SwiGLUOp
;
}
// namespace op::swiglu::cuda
}
// namespace op::swiglu::cuda
...
...
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