[Refactor] Remove dead code multiple places (#61843)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
@@ -359,13 +359,6 @@ class ExpertMapManager:
|
||||
return True
|
||||
return self._expert_map[global_id] != -1
|
||||
|
||||
def get_local_expert_ids(self) -> list[int]:
|
||||
"""Get list of global IDs for experts on this rank."""
|
||||
if self._expert_map is None:
|
||||
return list(range(self.global_num_experts))
|
||||
|
||||
return torch.where(self._expert_map != -1)[0].tolist()
|
||||
|
||||
def update(
|
||||
self,
|
||||
moe_parallel_config: FusedMoEParallelConfig,
|
||||
|
||||
@@ -12,35 +12,6 @@ from vllm.triton_utils import tl, triton
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def block_dequant(
|
||||
x_q_block: torch.Tensor,
|
||||
x_s: torch.Tensor,
|
||||
block_size: list[int],
|
||||
) -> torch.Tensor:
|
||||
"""This function conducts block-wise dequantization.
|
||||
The inputs are block-wise quantization tensor `x_q_block`,
|
||||
block-wise quantization scale and the block size.
|
||||
The outputs are dequantized tensor.
|
||||
"""
|
||||
block_n, block_k = block_size[0], block_size[1]
|
||||
n, k = x_q_block.shape
|
||||
n_tiles = (n + block_n - 1) // block_n
|
||||
k_tiles = (k + block_k - 1) // block_k
|
||||
assert n_tiles == x_s.shape[0]
|
||||
assert k_tiles == x_s.shape[1]
|
||||
|
||||
x_dq_block = x_q_block.to(torch.float32)
|
||||
|
||||
for i in range(k_tiles):
|
||||
for j in range(n_tiles):
|
||||
x_dq_block[
|
||||
j * block_n : min((j + 1) * block_n, n),
|
||||
i * block_k : min((i + 1) * block_k, k),
|
||||
] *= x_s[j][i]
|
||||
|
||||
return x_dq_block
|
||||
|
||||
|
||||
if current_platform.is_rocm():
|
||||
|
||||
@triton.jit
|
||||
|
||||
Reference in New Issue
Block a user