add seed in CPU UTs to avoid flaky failure (#7333)
This commit is contained in:
@@ -8,6 +8,8 @@ from utils import SiluAndMul, precision
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestActivation(CustomTestCase):
|
class TestActivation(CustomTestCase):
|
||||||
M = [128, 129, 257]
|
M = [128, 129, 257]
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ from torch.nn.functional import scaled_dot_product_attention
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestDecodeAttention(CustomTestCase):
|
class TestDecodeAttention(CustomTestCase):
|
||||||
def _run_sdpa_forward_decode(
|
def _run_sdpa_forward_decode(
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ from torch.nn.functional import scaled_dot_product_attention
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestExtendAttention(CustomTestCase):
|
class TestExtendAttention(CustomTestCase):
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ from utils import (
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class Mod(nn.Module):
|
class Mod(nn.Module):
|
||||||
def __init__(self, input_channel, output_channel, has_bias):
|
def __init__(self, input_channel, output_channel, has_bias):
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ from utils import precision
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestMLA(CustomTestCase):
|
class TestMLA(CustomTestCase):
|
||||||
def _run_sdpa_forward_decode(
|
def _run_sdpa_forward_decode(
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import torch
|
|||||||
|
|
||||||
kernel = torch.ops.sgl_kernel
|
kernel = torch.ops.sgl_kernel
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
from utils import (
|
from utils import (
|
||||||
BLOCK_K,
|
BLOCK_K,
|
||||||
BLOCK_N,
|
BLOCK_N,
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ from utils import make_non_contiguous, precision
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestNorm(CustomTestCase):
|
class TestNorm(CustomTestCase):
|
||||||
M = [4096, 1024]
|
M = [4096, 1024]
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ from sglang.srt.layers.rotary_embedding import (
|
|||||||
)
|
)
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestROPE(CustomTestCase):
|
class TestROPE(CustomTestCase):
|
||||||
def test_deepseek_v2_rope(self):
|
def test_deepseek_v2_rope(self):
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ from utils import (
|
|||||||
|
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
class TestSharedExpert(CustomTestCase):
|
class TestSharedExpert(CustomTestCase):
|
||||||
M = [2, 121]
|
M = [2, 121]
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ from sglang.srt.layers.moe.topk import grouped_topk_gpu as native_grouped_topk
|
|||||||
from sglang.srt.models.llama4 import Llama4MoE
|
from sglang.srt.models.llama4 import Llama4MoE
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
torch.manual_seed(0)
|
||||||
|
|
||||||
|
|
||||||
# This is used by the Deepseek-V2 model
|
# This is used by the Deepseek-V2 model
|
||||||
class TestGroupedTopK(CustomTestCase):
|
class TestGroupedTopK(CustomTestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user