mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-07-15 06:54:52 +00:00
* add context attn unpadded triton kernel * test compatibility * kv cache copy (testing) * fix k/v cache copy * fix kv cache copy and test * fix boundary of block ptrs * add support for GQA/MQA and testing * fix import statement --------- Co-authored-by: Round Heng <yuanhengzhao@Rounds-MacBook-Pro.local>
22 lines
585 B
Python
22 lines
585 B
Python
try:
|
|
import triton
|
|
|
|
HAS_TRITON = True
|
|
except ImportError:
|
|
HAS_TRITON = False
|
|
print("Triton is not installed. Please install Triton to use Triton kernels.")
|
|
|
|
# There may exist import error even if we have triton installed.
|
|
if HAS_TRITON:
|
|
from .context_attn_unpad import context_attention_unpadded
|
|
from .fused_layernorm import layer_norm
|
|
from .gptq_triton import gptq_fused_linear_triton
|
|
from .softmax import softmax
|
|
|
|
__all__ = [
|
|
"context_attention_unpadded",
|
|
"softmax",
|
|
"layer_norm",
|
|
"gptq_fused_linear_triton",
|
|
]
|