forked from hpcaitech/ColossalAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[setup] support pre-build and jit-build of cuda kernels (hpcaitech#2374)
* [setup] support pre-build and jit-build of cuda kernels * polish code * polish code * polish code * polish code * polish code * polish code
- Loading branch information
1 parent
12c8bf3
commit 40d376c
Showing
36 changed files
with
418 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,7 @@ | ||
from .cuda_native import FusedScaleMaskSoftmax, LayerNorm, MultiHeadAttention | ||
|
||
try: | ||
from colossalai._C import fused_optim | ||
except: | ||
from colossalai.kernel.op_builder.fused_optim import FusedOptimBuilder | ||
fused_optim = FusedOptimBuilder().load() | ||
|
||
try: | ||
from colossalai._C import cpu_optim | ||
except ImportError: | ||
from colossalai.kernel.op_builder import CPUAdamBuilder | ||
cpu_optim = CPUAdamBuilder().load() | ||
|
||
try: | ||
from colossalai._C import multihead_attention | ||
except ImportError: | ||
from colossalai.kernel.op_builder import MultiHeadAttnBuilder | ||
multihead_attention = MultiHeadAttnBuilder().load() | ||
|
||
try: | ||
from colossalai._C import scaled_upper_triang_masked_softmax | ||
except ImportError: | ||
from colossalai.kernel.op_builder import ScaledSoftmaxBuilder | ||
scaled_upper_triang_masked_softmax = ScaledSoftmaxBuilder().load() | ||
|
||
try: | ||
from colossalai._C import moe | ||
except ImportError: | ||
from colossalai.kernel.op_builder import MOEBuilder | ||
moe = MOEBuilder().load() | ||
|
||
__all__ = [ | ||
"fused_optim", | ||
"cpu_optim", | ||
"multihead_attention", | ||
"moe", | ||
"LayerNorm", | ||
"FusedScaleMaskSoftmax", | ||
"MultiHeadAttention", | ||
"scaled_upper_triang_masked_softmax", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.