2023-09-18 01:44:27 +00:00
|
|
|
try:
|
|
|
|
import triton
|
2023-09-19 06:20:26 +00:00
|
|
|
|
2023-09-18 01:44:27 +00:00
|
|
|
HAS_TRITON = True
|
2023-10-04 01:18:45 +00:00
|
|
|
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:
|
2024-01-03 06:41:35 +00:00
|
|
|
from .context_attn_unpad import context_attention_unpadded
|
2023-09-18 01:44:27 +00:00
|
|
|
from .fused_layernorm import layer_norm
|
2023-09-22 03:02:50 +00:00
|
|
|
from .gptq_triton import gptq_fused_linear_triton
|
2023-09-18 01:44:27 +00:00
|
|
|
from .softmax import softmax
|
|
|
|
|
|
|
|
__all__ = [
|
2024-01-03 06:41:35 +00:00
|
|
|
"context_attention_unpadded",
|
2023-09-19 06:20:26 +00:00
|
|
|
"softmax",
|
|
|
|
"layer_norm",
|
2023-09-22 03:02:50 +00:00
|
|
|
"gptq_fused_linear_triton",
|
2023-09-18 01:44:27 +00:00
|
|
|
]
|