From bdc98bf5060db48f5844fa35f9ffe1608710ba51 Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Thu, 30 Jul 2026 14:34:08 -0500 Subject: [PATCH] [CI] Initialize fused gated RMSNorm weights (#50377) Signed-off-by: Andreas Karatzas --- tests/kernels/core/test_fused_rms_norm_gated.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/kernels/core/test_fused_rms_norm_gated.py b/tests/kernels/core/test_fused_rms_norm_gated.py index cccec939e3..f411f563ac 100644 --- a/tests/kernels/core/test_fused_rms_norm_gated.py +++ b/tests/kernels/core/test_fused_rms_norm_gated.py @@ -49,6 +49,11 @@ def test_compiled_vs_eager( device=device, dtype=dtype, ) + # Model parameters use torch.empty because checkpoint loading overwrites + # them. Initialize the standalone test module so allocator contents cannot + # introduce NaNs and make this comparison flaky. + if module.weight is not None: + module.weight.uniform_(-1, 1) x = torch.randn(num_tokens, hidden_size, dtype=dtype, device=device) g = torch.randn(num_tokens, hidden_size, dtype=dtype, device=device) @@ -94,6 +99,8 @@ def test_compiled_vs_eager_multidim( device=device, dtype=dtype, ) + if module.weight is not None: + module.weight.uniform_(-1, 1) x = torch.randn(*shape, dtype=dtype, device=device) g = torch.randn(*shape, dtype=dtype, device=device)