[Bugfix] Fix triton import with local TritonPlaceholder (#17446)

Signed-off-by: Mengqing Cao <cmq0113@163.com>
This commit is contained in:
Mengqing Cao
2025-05-06 17:53:09 +08:00
committed by GitHub
parent 05e1f96419
commit f9bc5a0693
30 changed files with 165 additions and 75 deletions
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
import torch
import triton
import triton.language as tl
from vllm.triton_utils import tl, triton
def blocksparse_flash_attn_varlen_fwd(
@@ -8,7 +8,8 @@ from functools import lru_cache
import numpy as np
import torch
import triton
from vllm.triton_utils import triton
class csr_matrix:
@@ -7,11 +7,10 @@
# - Thomas Parnell <tpa@zurich.ibm.com>
import torch
import triton
import triton.language as tl
from vllm import _custom_ops as ops
from vllm.platforms.rocm import use_rocm_custom_paged_attention
from vllm.triton_utils import tl, triton
from .prefix_prefill import context_attention_fwd
+1 -2
View File
@@ -4,10 +4,9 @@
# https://github.com/ModelTC/lightllm/blob/main/lightllm/models/llama/triton_kernel/context_flashattention_nopad.py
import torch
import triton
import triton.language as tl
from vllm.platforms import current_platform
from vllm.triton_utils import tl, triton
# Static kernels parameters
BASE_BLOCK = 128 if current_platform.has_device_capability(80) else 64
@@ -30,10 +30,8 @@ It supports page size >= 1.
import logging
import triton
import triton.language as tl
from vllm.platforms import current_platform
from vllm.triton_utils import tl, triton
is_hip_ = current_platform.is_rocm()
+1 -2
View File
@@ -25,11 +25,10 @@ Currently only the forward kernel is supported, and contains these features:
from typing import Optional
import torch
import triton
import triton.language as tl
from vllm import _custom_ops as ops
from vllm.platforms import current_platform
from vllm.triton_utils import tl, triton
SUPPORTED_LAYOUTS = ['thd', 'bhsd', 'bshd']
@@ -2,8 +2,8 @@
from typing import Optional
import torch
import triton
import triton.language as tl
from vllm.triton_utils import tl, triton
# Implements section 2.2 of https://www.arxiv.org/pdf/2501.01005