remove get_metadata_cls (#4087)

remove get_metadata_cls. It's only used for V0 engine and has been removed from vLLM already.

- vLLM version: v0.11.0
- vLLM main:
83f478bb19

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2025-11-19 14:58:17 +08:00
committed by GitHub
parent 1cdf9ffa73
commit 2938bd5ad2
10 changed files with 4 additions and 52 deletions

View File

@@ -7,8 +7,7 @@ from tests.ut.base import TestBase
from vllm_ascend.attention.attention_v1 import (AscendAttentionBackend, from vllm_ascend.attention.attention_v1 import (AscendAttentionBackend,
AscendAttentionBackendImpl, AscendAttentionBackendImpl,
AscendAttentionMetadataBuilder, AscendAttentionMetadataBuilder,
AscendAttentionState, AscendAttentionState)
AscendMetadata)
from vllm_ascend.attention.utils import AscendCommonAttentionMetadata from vllm_ascend.attention.utils import AscendCommonAttentionMetadata
@@ -21,10 +20,6 @@ class TestAscendAttentionBackend(TestBase):
self.assertEqual(AscendAttentionBackend.get_impl_cls(), self.assertEqual(AscendAttentionBackend.get_impl_cls(),
AscendAttentionBackendImpl) AscendAttentionBackendImpl)
def test_get_metadata_cls(self):
self.assertEqual(AscendAttentionBackend.get_metadata_cls(),
AscendMetadata)
def test_get_builder_cls(self): def test_get_builder_cls(self):
self.assertEqual(AscendAttentionBackend.get_builder_cls(), self.assertEqual(AscendAttentionBackend.get_builder_cls(),
AscendAttentionMetadataBuilder) AscendAttentionMetadataBuilder)

View File

@@ -18,10 +18,6 @@ class TestAscendMLABackend(TestBase):
def test_get_name(self): def test_get_name(self):
self.assertEqual(AscendMLABackend.get_name(), "ASCEND_MLA") self.assertEqual(AscendMLABackend.get_name(), "ASCEND_MLA")
def test_get_metadata_cls(self):
self.assertEqual(AscendMLABackend.get_metadata_cls(),
AscendMLAMetadata)
def test_get_builder_cls(self): def test_get_builder_cls(self):
self.assertEqual(AscendMLABackend.get_builder_cls(), self.assertEqual(AscendMLABackend.get_builder_cls(),
AscendMLAMetadataBuilder) AscendMLAMetadataBuilder)

View File

@@ -15,10 +15,6 @@ class TestAscendSFABackend(TestBase):
def test_get_name(self): def test_get_name(self):
self.assertEqual(AscendSFABackend.get_name(), "ASCEND_SFA") self.assertEqual(AscendSFABackend.get_name(), "ASCEND_SFA")
def test_get_metadata_cls(self):
self.assertEqual(AscendSFABackend.get_metadata_cls(),
AscendSFAMetadata)
def test_get_builder_cls(self): def test_get_builder_cls(self):
self.assertEqual(AscendSFABackend.get_builder_cls(), self.assertEqual(AscendSFABackend.get_builder_cls(),
AscendSFAMetadataBuilder) AscendSFAMetadataBuilder)

View File

@@ -21,10 +21,6 @@ class TestAscendMLATorchairBackend(TestBase):
self.assertEqual(AscendMLATorchairBackend.get_name(), self.assertEqual(AscendMLATorchairBackend.get_name(),
"ASCEND_MLA_TORCHAIR") "ASCEND_MLA_TORCHAIR")
def test_get_metadata_cls(self):
self.assertEqual(AscendMLATorchairBackend.get_metadata_cls(),
AscendMLATorchairMetadata)
def test_get_builder_cls(self): def test_get_builder_cls(self):
self.assertEqual(AscendMLATorchairBackend.get_builder_cls(), self.assertEqual(AscendMLATorchairBackend.get_builder_cls(),
AscendMLATorchairMetadataBuilder) AscendMLATorchairMetadataBuilder)

View File

@@ -75,10 +75,6 @@ class AscendAttentionBackend(AttentionBackend):
def get_impl_cls() -> Type["AscendAttentionBackendImpl"]: def get_impl_cls() -> Type["AscendAttentionBackendImpl"]:
return AscendAttentionBackendImpl return AscendAttentionBackendImpl
@staticmethod
def get_metadata_cls() -> Type["AscendMetadata"]:
return AscendMetadata
@staticmethod @staticmethod
def get_builder_cls() -> type["AscendAttentionMetadataBuilder"]: def get_builder_cls() -> type["AscendAttentionMetadataBuilder"]:
return AscendAttentionMetadataBuilder return AscendAttentionMetadataBuilder

View File

@@ -7,9 +7,7 @@ import torch
import torch.distributed as dist import torch.distributed as dist
import torch_npu import torch_npu
from torch import nn from torch import nn
from vllm.attention.backends.abstract import (AttentionBackend, from vllm.attention.backends.abstract import AttentionBackend, MLAAttentionImpl
AttentionMetadata,
MLAAttentionImpl)
from vllm.config import VllmConfig, get_current_vllm_config from vllm.config import VllmConfig, get_current_vllm_config
from vllm.distributed import (get_dcp_group, from vllm.distributed import (get_dcp_group,
get_decode_context_model_parallel_rank, get_decode_context_model_parallel_rank,
@@ -69,10 +67,6 @@ class AscendMLABackend(AttentionBackend):
def get_name() -> str: def get_name() -> str:
return "ASCEND_MLA" return "ASCEND_MLA"
@staticmethod
def get_metadata_cls() -> type["AttentionMetadata"]:
return AscendMLAMetadata
@staticmethod @staticmethod
def get_builder_cls(): def get_builder_cls():
return AscendMLAMetadataBuilder return AscendMLAMetadataBuilder

View File

@@ -4,9 +4,7 @@ from typing import TYPE_CHECKING, ClassVar, Optional, Tuple, Type, TypeVar
import torch import torch
import torch_npu import torch_npu
from torch import nn from torch import nn
from vllm.attention.backends.abstract import (AttentionBackend, from vllm.attention.backends.abstract import AttentionBackend, MLAAttentionImpl
AttentionMetadata,
MLAAttentionImpl)
from vllm.config import VllmConfig from vllm.config import VllmConfig
from vllm.distributed import get_tensor_model_parallel_world_size from vllm.distributed import get_tensor_model_parallel_world_size
from vllm.model_executor.layers.linear import (LinearBase, from vllm.model_executor.layers.linear import (LinearBase,
@@ -35,10 +33,6 @@ class AscendSFABackend(AttentionBackend):
def get_name() -> str: def get_name() -> str:
return "ASCEND_SFA" return "ASCEND_SFA"
@staticmethod
def get_metadata_cls() -> type["AttentionMetadata"]:
return AscendSFAMetadata
@staticmethod @staticmethod
def get_builder_cls(): def get_builder_cls():
return AscendSFAMetadataBuilder return AscendSFAMetadataBuilder

View File

@@ -55,10 +55,6 @@ class AscendAttentionTorchairBackend(AscendAttentionBackend):
def get_impl_cls() -> Type["AscendAttentionTorchairBackendImpl"]: def get_impl_cls() -> Type["AscendAttentionTorchairBackendImpl"]:
return AscendAttentionTorchairBackendImpl return AscendAttentionTorchairBackendImpl
@staticmethod
def get_metadata_cls() -> Type["AscendTorchairMetadata"]:
return AscendTorchairMetadata
@staticmethod @staticmethod
def get_builder_cls() -> type["AscendAttentionTorchairMetadataBuilder"]: def get_builder_cls() -> type["AscendAttentionTorchairMetadataBuilder"]:
return AscendAttentionTorchairMetadataBuilder return AscendAttentionTorchairMetadataBuilder

View File

@@ -6,7 +6,6 @@ import torch
import torch.nn as nn import torch.nn as nn
import torch_npu import torch_npu
from vllm.attention.backends.abstract import (AttentionBackend, AttentionLayer, from vllm.attention.backends.abstract import (AttentionBackend, AttentionLayer,
AttentionMetadata,
MLAAttentionImpl) MLAAttentionImpl)
from vllm.attention.backends.utils import PAD_SLOT_ID from vllm.attention.backends.utils import PAD_SLOT_ID
from vllm.config import VllmConfig, get_current_vllm_config from vllm.config import VllmConfig, get_current_vllm_config
@@ -43,10 +42,6 @@ class AscendMLATorchairBackend(AttentionBackend):
def get_name() -> str: def get_name() -> str:
return "ASCEND_MLA_TORCHAIR" return "ASCEND_MLA_TORCHAIR"
@staticmethod
def get_metadata_cls() -> type["AttentionMetadata"]:
return AscendMLATorchairMetadata
@staticmethod @staticmethod
def get_builder_cls(): def get_builder_cls():
return AscendMLATorchairMetadataBuilder return AscendMLATorchairMetadataBuilder

View File

@@ -6,9 +6,7 @@ import torch
import torch.nn as nn import torch.nn as nn
import torch.nn.functional as F import torch.nn.functional as F
import torch_npu import torch_npu
from vllm.attention.backends.abstract import (AttentionBackend, from vllm.attention.backends.abstract import AttentionBackend, MLAAttentionImpl
AttentionMetadata,
MLAAttentionImpl)
from vllm.attention.backends.utils import PAD_SLOT_ID from vllm.attention.backends.utils import PAD_SLOT_ID
from vllm.config import VllmConfig, get_current_vllm_config from vllm.config import VllmConfig, get_current_vllm_config
from vllm.distributed import get_tensor_model_parallel_world_size, get_tp_group from vllm.distributed import get_tensor_model_parallel_world_size, get_tp_group
@@ -43,10 +41,6 @@ class AscendSFATorchairBackend(AttentionBackend):
def get_name() -> str: def get_name() -> str:
return "ASCEND_SFA_TORCHAIR" return "ASCEND_SFA_TORCHAIR"
@staticmethod
def get_metadata_cls() -> type["AttentionMetadata"]:
return AscendSFATorchairMetadata
@staticmethod @staticmethod
def get_builder_cls(): def get_builder_cls():
return AscendSFATorchairMetadataBuilder return AscendSFATorchairMetadataBuilder