[inference]fix import bug and delete down useless init (#4830)

* fix import bug and release useless init

* fix

* fix

* fix
This commit is contained in:
Jianghai
2023-10-04 09:18:45 +08:00
committed by GitHub
parent 573f270537
commit 013a4bedf0
9 changed files with 121 additions and 154 deletions

View File

@@ -3,6 +3,12 @@ try:
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_attention import bloom_context_attn_fwd, llama_context_attn_fwd
from .copy_kv_cache_dest import copy_kv_cache_to_dest
from .fused_layernorm import layer_norm
@@ -23,7 +29,3 @@ try:
"token_attention_fwd",
"gptq_fused_linear_triton",
]
except ImportError:
HAS_TRITON = False
print("Triton is not installed. Please install Triton to use Triton kernels.")