"docs/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "15eb77bc4cf2ccb40781cb630b9a734b43cffcb8"
Unverified Commit 9179ea15 authored by Chunyuan WU's avatar Chunyuan WU Committed by GitHub
Browse files

add seed in CPU UTs to avoid flaky failure (#7333)

parent 20a503c7
...@@ -8,6 +8,8 @@ from utils import SiluAndMul, precision ...@@ -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 ...@@ -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 ...@@ -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 ( ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ( ...@@ -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 ( ...@@ -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 ...@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment