[Platform] Deprecate seed_everything (#31659)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2026-01-05 10:34:04 +08:00
committed by GitHub
parent 367856de14
commit bb4337b34c
77 changed files with 219 additions and 171 deletions

View File

@@ -5,7 +5,7 @@ import pytest
import torch
from vllm.model_executor.layers.lightning_attn import linear_decode_forward_triton
from vllm.platforms import current_platform
from vllm.utils.torch_utils import set_random_seed
NUM_HEADS = [4, 8]
HEAD_SIZES = [64]
@@ -124,7 +124,7 @@ def test_linear_decode_forward_triton(
torch.set_default_device("cuda")
torch.manual_seed(42)
torch.cuda.manual_seed_all(42)
current_platform.seed_everything(42)
set_random_seed(42)
base = 0.01
q = base * torch.randn(batch_size, num_heads, 1, head_size, dtype=dtype)
k = base * torch.randn(batch_size, num_heads, 1, head_size, dtype=dtype)
@@ -167,7 +167,7 @@ def test_linear_decode_forward_triton_with_padding(
torch.set_default_device("cuda")
torch.manual_seed(42)
torch.cuda.manual_seed_all(42)
current_platform.seed_everything(42)
set_random_seed(42)
batch_size = 4
base = 0.01
@@ -231,7 +231,7 @@ def test_lightning_attention_reference(
torch.set_default_device("cuda")
torch.manual_seed(42)
torch.cuda.manual_seed_all(42)
current_platform.seed_everything(42)
set_random_seed(42)
base = 0.01
q = base * torch.randn(batch_size, num_heads, seq_len, head_size, dtype=dtype)