| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | from typing import TYPE_CHECKING |
| 4 | |
| 5 | from vllm.triton_utils.importing import ( |
| 6 | HAS_TRITON, |
| 7 | TritonLanguagePlaceholder, |
| 8 | TritonPlaceholder, |
| 9 | ) |
| 10 | |
| 11 | if TYPE_CHECKING or HAS_TRITON: |
| 12 | import triton |
| 13 | import triton.language as tl |
| 14 | import triton.language.extra.libdevice as tldevice |
| 15 | from triton.experimental import gluon |
| 16 | from triton.experimental.gluon import language as gl |
| 17 | from triton.language.core import _aggregate as aggregate # noqa: E501 |
| 18 | else: |
| 19 | triton = TritonPlaceholder() |
| 20 | tl = TritonLanguagePlaceholder() |
| 21 | tldevice = TritonLanguagePlaceholder() |
| 22 | gluon = TritonLanguagePlaceholder() |
| 23 | gl = TritonLanguagePlaceholder() |
| 24 | aggregate = TritonLanguagePlaceholder() |
| 25 | |
| 26 | from vllm.triton_utils.tensor_descriptor import use_tensor_descriptor |
| 27 | |
| 28 | LOG2E = 1.4426950408889634 |
| 29 | LOGE2 = 0.6931471805599453 |
| 30 | |
| 31 | __all__ = [ |
| 32 | "HAS_TRITON", |
| 33 | "triton", |
| 34 | "tl", |
| 35 | "tldevice", |
| 36 | "LOG2E", |
| 37 | "LOGE2", |
| 38 | "gluon", |
| 39 | "gl", |
| 40 | "aggregate", |
| 41 | "use_tensor_descriptor", |
| 42 | ] |