Skip to content

Commit c1acd6d

Browse files
authored
[Refactor] Change the way of import triton (#20774)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
1 parent 3b3b778 commit c1acd6d

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

tests/kernels/moe/test_batched_moe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import pytest
88
import torch
9-
import triton.language as tl
109

1110
from tests.kernels.moe.utils import (batched_moe,
1211
make_quantized_test_activations,
@@ -18,6 +17,7 @@
1817
invoke_moe_batched_triton_kernel)
1918
from vllm.model_executor.layers.fused_moe.fused_moe import fused_topk
2019
from vllm.platforms import current_platform
20+
from vllm.triton_utils import tl
2121

2222
MNK_FACTORS = [
2323
(1, 128, 128),

vllm/attention/ops/triton_unified_attention.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
# - Thomas Parnell <tpa@zurich.ibm.com>
99

1010
import torch
11-
import triton
12-
import triton.language as tl
1311

1412
from vllm.logger import init_logger
13+
from vllm.triton_utils import tl, triton
1514

1615
logger = init_logger(__name__)
1716

vllm/lora/ops/triton_ops/lora_expand_op.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
"""
99

1010
import torch
11-
import triton
12-
import triton.language as tl
1311

1412
from vllm.lora.ops.triton_ops.kernel_utils import do_expand_kernel
1513
from vllm.lora.ops.triton_ops.utils import _get_lora_b_ptr
1614
from vllm.platforms import current_platform
15+
from vllm.triton_utils import tl, triton
1716
from vllm.utils import direct_register_custom_op
1817

1918

vllm/lora/ops/triton_ops/lora_shrink_op.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
"""
99

1010
import torch
11-
import triton
12-
import triton.language as tl
1311

1412
from vllm.lora.ops.triton_ops.kernel_utils import do_shrink_kernel
1513
from vllm.lora.ops.triton_ops.utils import _get_lora_a_ptr
1614
from vllm.platforms import current_platform
15+
from vllm.triton_utils import tl, triton
1716
from vllm.utils import direct_register_custom_op
1817

1918

vllm/model_executor/layers/fused_moe/fused_batched_moe.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from typing import Optional
55

66
import torch
7-
import triton
8-
import triton.language as tl
97

108
import vllm.model_executor.layers.fused_moe.modular_kernel as mk
119
from vllm.model_executor.layers.fused_moe.config import FusedMoEQuantConfig
@@ -18,6 +16,7 @@
1816
normalize_scales_shape)
1917
from vllm.model_executor.layers.quantization.utils.quant_utils import (
2018
group_broadcast)
19+
from vllm.triton_utils import tl, triton
2120

2221

2322
@triton.jit

0 commit comments

Comments
 (0)