[Refactor] Move fla to third party (#48500)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-07-16 19:22:36 +01:00
committed by GitHub
parent 251f7e478e
commit 626c90b2d5
42 changed files with 87 additions and 62 deletions
@@ -7,7 +7,7 @@ matching the eager triton kernel output."""
import pytest
import torch
from vllm.model_executor.layers.fla.ops.kda import FusedRMSNormGated
from vllm.third_party.flash_linear_attention.ops.kda import FusedRMSNormGated
from vllm.utils.torch_utils import set_random_seed
DTYPES = [torch.bfloat16]
@@ -53,11 +53,6 @@ from tests.v1.attention.utils import ( # noqa: E402
create_vllm_config,
)
from vllm.config import set_current_vllm_config # noqa: E402
from vllm.model_executor.layers.fla.ops.index import ( # noqa: E402
prepare_chunk_indices,
prepare_chunk_offsets,
)
from vllm.model_executor.layers.fla.ops.utils import FLA_CHUNK_SIZE # noqa: E402
from vllm.model_executor.layers.mamba.gdn import qwen_gdn_linear_attn # noqa: E402
from vllm.model_executor.layers.mamba.gdn.qwen_gdn_linear_attn import ( # noqa: E402
ChunkGatedDeltaRule,
@@ -66,6 +61,13 @@ from vllm.model_executor.layers.mamba.gdn.qwen_gdn_linear_attn import ( # noqa:
from vllm.model_executor.layers.mamba.mamba_utils import ( # noqa: E402
MambaStateShapeCalculator,
)
from vllm.third_party.flash_linear_attention.ops.index import ( # noqa: E402
prepare_chunk_indices,
prepare_chunk_offsets,
)
from vllm.third_party.flash_linear_attention.ops.utils import ( # noqa: E402
FLA_CHUNK_SIZE,
)
from vllm.v1.attention.backends.gdn_attn import ( # noqa: E402
GDNAttentionMetadataBuilder,
)
@@ -17,17 +17,17 @@ if not (
allow_module_level=True,
)
from vllm.model_executor.layers.fla.ops import ( # noqa: E402
chunk_gated_delta_rule,
)
from vllm.model_executor.layers.fla.ops.index import ( # noqa: E402
prepare_chunk_indices,
prepare_chunk_offsets,
)
from vllm.model_executor.layers.mamba.ops.gdn_chunk_cutedsl import ( # noqa: E402
chunk_gated_delta_rule_cutedsl,
prepare_metadata_cutedsl,
)
from vllm.third_party.flash_linear_attention.ops import ( # noqa: E402
chunk_gated_delta_rule,
)
from vllm.third_party.flash_linear_attention.ops.index import ( # noqa: E402
prepare_chunk_indices,
prepare_chunk_offsets,
)
@pytest.mark.parametrize("num_seqs", [1, 5, 257])
+1 -1
View File
@@ -5,7 +5,7 @@ import pytest
import torch
import torch.nn.functional as F
from vllm.model_executor.layers.fla.ops.layernorm_guard import (
from vllm.third_party.flash_linear_attention.ops.layernorm_guard import (
layer_norm_fwd,
layernorm_fn,
rms_norm_ref,
+1 -1
View File
@@ -10,7 +10,7 @@ import pytest
import torch
import torch.nn.functional as F
from vllm.model_executor.layers.fla.ops.fused_gdn_prefill_post_conv import (
from vllm.third_party.flash_linear_attention.ops.fused_gdn_prefill_post_conv import (
fused_post_conv_prep,
)
@@ -4,7 +4,7 @@
import pytest
import torch
from vllm.model_executor.layers.fla.ops import (
from vllm.third_party.flash_linear_attention.ops import (
fused_recurrent_gated_delta_rule,
fused_recurrent_gated_delta_rule_packed_decode,
)
@@ -5,11 +5,11 @@ import pytest
import torch
import torch.nn.functional as F
from vllm.model_executor.layers.fla.ops import (
from vllm.platforms import current_platform
from vllm.third_party.flash_linear_attention.ops import (
fused_recurrent_gated_delta_rule,
fused_sigmoid_gating_delta_rule_update,
)
from vllm.platforms import current_platform
from vllm.utils.torch_utils import set_random_seed
DEVICE = current_platform.device_type
+2 -2
View File
@@ -10,12 +10,12 @@ import pytest
import torch
import torch.nn.functional as F
from vllm.model_executor.layers.fla.ops.kda import (
from vllm.third_party.flash_linear_attention.ops.kda import (
chunk_kda,
chunk_kda_with_fused_gate,
fused_kda_gate,
)
from vllm.model_executor.layers.fla.ops.l2norm import l2norm_fwd
from vllm.third_party.flash_linear_attention.ops.l2norm import l2norm_fwd
DEVICE = "cuda"