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
Megatron-LM
Commits
da77a836
Commit
da77a836
authored
Oct 08, 2021
by
Jared Casper
Browse files
Merge branch 'main' into api_change
parents
397714f5
b31e1296
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
megatron/fused_kernels/layer_norm_cuda_kernel.cu
megatron/fused_kernels/layer_norm_cuda_kernel.cu
+1
-1
megatron/model/transformer.py
megatron/model/transformer.py
+8
-4
megatron/text_generation_server.py
megatron/text_generation_server.py
+4
-3
No files found.
megatron/fused_kernels/layer_norm_cuda_kernel.cu
View file @
da77a836
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "ATen/ATen.h"
#include "ATen/ATen.h"
#include "ATen/AccumulateType.h"
#include "ATen/AccumulateType.h"
#include "ATen/cuda/CUDAContext.h"
#include "ATen/cuda/CUDAContext.h"
#include
<THC/THC
DeviceUtils.cuh
>
#include
"ATen/cuda/
DeviceUtils.cuh
"
#include <cuda.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime.h>
...
...
megatron/model/transformer.py
View file @
da77a836
...
@@ -392,14 +392,18 @@ def get_bias_dropout_add(training):
...
@@ -392,14 +392,18 @@ def get_bias_dropout_add(training):
@
torch
.
jit
.
script
@
torch
.
jit
.
script
def
bias_dropout_add_fused_train
(
x
,
bias
,
residual
,
prob
):
def
bias_dropout_add_fused_train
(
x
:
torch
.
Tensor
,
# type: (Tensor, Tensor, Tensor, float) -> Tensor
bias
:
torch
.
Tensor
,
residual
:
torch
.
Tensor
,
prob
:
float
)
->
torch
.
Tensor
:
return
bias_dropout_add
(
x
,
bias
,
residual
,
prob
,
True
)
return
bias_dropout_add
(
x
,
bias
,
residual
,
prob
,
True
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
def
bias_dropout_add_fused_inference
(
x
,
bias
,
residual
,
prob
):
def
bias_dropout_add_fused_inference
(
x
:
torch
.
Tensor
,
# type: (Tensor, Tensor, Tensor, float) -> Tensor
bias
:
torch
.
Tensor
,
residual
:
torch
.
Tensor
,
prob
:
float
)
->
torch
.
Tensor
:
return
bias_dropout_add
(
x
,
bias
,
residual
,
prob
,
False
)
return
bias_dropout_add
(
x
,
bias
,
residual
,
prob
,
False
)
...
...
megatron/text_generation_server.py
View file @
da77a836
...
@@ -70,9 +70,10 @@ class MegatronGenerate(Resource):
...
@@ -70,9 +70,10 @@ class MegatronGenerate(Resource):
temperature
=
args
.
temperature
temperature
=
args
.
temperature
if
"temperature"
in
request
.
get_json
():
if
"temperature"
in
request
.
get_json
():
temperature
=
request
.
get_json
()[
"temperature"
]
temperature
=
request
.
get_json
()[
"temperature"
]
if
not
isinstance
(
temperature
,
float
)
or
not
\
if
not
(
type
(
temperature
)
==
int
or
type
(
temperature
)
==
float
):
0.0
<
temperature
<=
100.0
:
return
"temperature must be a positive number less than or equal to 100.0"
return
"temperature must be a positive float less than or equal to 100.0"
if
not
(
0.0
<
temperature
<=
100.0
):
return
"temperature must be a positive number less than or equal to 100.0"
top_k
=
args
.
top_k
top_k
=
args
.
top_k
if
"top_k"
in
request
.
get_json
():
if
"top_k"
in
request
.
get_json
():
...
...
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