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
ColossalAI
Commits
5ecef13c
Commit
5ecef13c
authored
Apr 01, 2022
by
Yuer867
Committed by
binmakeswell
Apr 06, 2022
Browse files
fix format (#611)
parent
d3d5bedc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
colossalai/kernel/cuda_native/csrc/kernels/include/context.h
colossalai/kernel/cuda_native/csrc/kernels/include/context.h
+2
-2
colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h
...el/cuda_native/csrc/kernels/include/cross_entropy_layer.h
+3
-4
No files found.
colossalai/kernel/cuda_native/csrc/kernels/include/context.h
View file @
5ecef13c
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include "cuda_util.h"
#include "cuda_util.h"
class
Context
{
class
Context
{
public:
public:
Context
()
:
_stream
(
nullptr
)
{
Context
()
:
_stream
(
nullptr
)
{
CHECK_GPU_ERROR
(
cublasCreate
(
&
_cublasHandle
));
CHECK_GPU_ERROR
(
cublasCreate
(
&
_cublasHandle
));
}
}
...
@@ -30,7 +30,7 @@ class Context {
...
@@ -30,7 +30,7 @@ class Context {
cublasHandle_t
get_cublashandle
()
{
return
_cublasHandle
;
}
cublasHandle_t
get_cublashandle
()
{
return
_cublasHandle
;
}
private:
private:
cudaStream_t
_stream
;
cudaStream_t
_stream
;
cublasHandle_t
_cublasHandle
;
cublasHandle_t
_cublasHandle
;
};
};
colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h
View file @
5ecef13c
...
@@ -8,9 +8,8 @@
...
@@ -8,9 +8,8 @@
#include "cuda_util.h"
#include "cuda_util.h"
template
<
typename
T
>
template
<
typename
T
>
class
CrossEntropyLayer
{
class
CrossEntropyLayer
{
public:
public:
CrossEntropyLayer
(
float
epsilon
,
int
padding_idx
,
int
max_batch_tokens
);
CrossEntropyLayer
(
float
epsilon
,
int
padding_idx
,
int
max_batch_tokens
);
virtual
~
CrossEntropyLayer
();
virtual
~
CrossEntropyLayer
();
...
@@ -23,7 +22,7 @@ class CrossEntropyLayer {
...
@@ -23,7 +22,7 @@ class CrossEntropyLayer {
void
set_cur_batch_shape
(
int
batch_size
,
int
seq_len
,
int
vocab_size
);
void
set_cur_batch_shape
(
int
batch_size
,
int
seq_len
,
int
vocab_size
);
private:
private:
void
allocate_mem_buffer
()
{
void
allocate_mem_buffer
()
{
// allocate local gpu memory
// allocate local gpu memory
_loss_buffer
=
cuda_malloc
<
float
>
(
_max_batch_tokens
*
2
);
_loss_buffer
=
cuda_malloc
<
float
>
(
_max_batch_tokens
*
2
);
...
...
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