update pre-commit config (#18860)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
"""Attention layer with Dual chunk flash attention and sparse attention.
|
||||
"""
|
||||
"""Attention layer with Dual chunk flash attention and sparse attention."""
|
||||
|
||||
import functools
|
||||
import logging
|
||||
import math
|
||||
|
||||
@@ -670,9 +670,9 @@ class KimiLinearAttnBackend(MambaAttnBackendBase):
|
||||
**kwargs,
|
||||
):
|
||||
assert isinstance(mixed_qkv, Tuple)
|
||||
(q_proj_states, k_proj_states, v_proj_states) = mixed_qkv
|
||||
(q_conv_weights, k_conv_weights, v_conv_weights) = layer.conv_weights
|
||||
(q_conv_bias, k_conv_bias, v_conv_bias) = layer.bias
|
||||
q_proj_states, k_proj_states, v_proj_states = mixed_qkv
|
||||
q_conv_weights, k_conv_weights, v_conv_weights = layer.conv_weights
|
||||
q_conv_bias, k_conv_bias, v_conv_bias = layer.bias
|
||||
|
||||
layer_cache = self.req_to_token_pool.mamba2_layer_cache(layer.layer_id)
|
||||
q_conv_state, k_conv_state, v_conv_state = layer_cache.conv
|
||||
@@ -744,9 +744,9 @@ class KimiLinearAttnBackend(MambaAttnBackendBase):
|
||||
)
|
||||
|
||||
assert isinstance(mixed_qkv, Tuple)
|
||||
(q_proj_states, k_proj_states, v_proj_states) = mixed_qkv
|
||||
(q_conv_weights, k_conv_weights, v_conv_weights) = layer.conv_weights
|
||||
(q_conv_bias, k_conv_bias, v_conv_bias) = layer.bias
|
||||
q_proj_states, k_proj_states, v_proj_states = mixed_qkv
|
||||
q_conv_weights, k_conv_weights, v_conv_weights = layer.conv_weights
|
||||
q_conv_bias, k_conv_bias, v_conv_bias = layer.bias
|
||||
|
||||
query_start_loc = self.forward_metadata.query_start_loc
|
||||
cache_indices = self.forward_metadata.mamba_cache_indices
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"""
|
||||
Copyright (c) Ant Financial Service Group and its affiliates.
|
||||
"""
|
||||
|
||||
# Copied from https://code.alipay.com/pia/PainlessInferenceAcceleration/blob/v0.0.6/flood/flood/ops/seg_la.py
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
@@ -38,7 +38,7 @@ def prefill_attention_wave(
|
||||
output_shape = (shape.total_seq_len, shape.num_query_heads, shape.head_size_kv)
|
||||
# Run the wave kernel.
|
||||
mfma_variant = (MMAType.F32_16x16x16_F16, MMAType.F32_16x16x16_F16)
|
||||
(prefill, hyperparams) = get_prefill_attention_kernel(
|
||||
prefill, hyperparams = get_prefill_attention_kernel(
|
||||
shape,
|
||||
mfma_variant,
|
||||
q.shape,
|
||||
|
||||
@@ -376,7 +376,7 @@ class LogitsProcessor(nn.Module):
|
||||
|
||||
logprobs_result = self.process_input_logprobs(input_logits, logits_metadata)
|
||||
else:
|
||||
(logprobs_result, sampled_logits) = self.process_input_logprobs_by_chunk(
|
||||
logprobs_result, sampled_logits = self.process_input_logprobs_by_chunk(
|
||||
pruned_states,
|
||||
sample_indices,
|
||||
input_logprob_indices,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
"""Cutlass W4A8 MoE kernel."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
|
||||
@@ -63,11 +63,9 @@ class ModelSlimMoEMethod(FusedMoEMethodBase):
|
||||
logger.info_once("Using ModelSlimW8A8Int8MoE")
|
||||
return ModelSlimW8A8Int8MoE(quant_config)
|
||||
else:
|
||||
logger.warning(
|
||||
f"Unsupported FusedMoe modelslim scheme: \
|
||||
logger.warning(f"Unsupported FusedMoe modelslim scheme: \
|
||||
{quant_config.quant_description.get(prefix_in_quant_config.strip())} \
|
||||
in layer: {prefix}"
|
||||
)
|
||||
in layer: {prefix}")
|
||||
return None
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Radix attention."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Radix linear attention."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional, Tuple, Union
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Adapted from https://raw.githubusercontent.com/vllm-project/vllm/refs/tags/v0.6.6.post1/vllm/model_executor/layers/rotary_embedding.py
|
||||
"""Rotary Positional Embeddings."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import itertools
|
||||
@@ -2896,7 +2897,7 @@ class DualChunkRotaryEmbedding(MultiPlatformOp):
|
||||
self.local_size = local_size
|
||||
self.dtype = dtype
|
||||
self.device = torch.device(f"cuda:{torch.cuda.current_device()}")
|
||||
(q_cache, qc_cache, k_cache, qc_no_clamp_cache, q_inter_cache) = (
|
||||
q_cache, qc_cache, k_cache, qc_no_clamp_cache, q_inter_cache = (
|
||||
self._compute_cos_sin_cache()
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user