Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/unit/train/models/test_nemotron_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_nemotron_h_mamba_moe_only():
if isinstance(layer, NemotronHAttentionLayer):
layer.forward = lambda hidden_states, **kwargs: hidden_states

torch.manual_seed(42)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global RNG state leaks across tests

Medium Severity

torch.manual_seed(42) mutates the process-wide RNG state and this test does not restore it. That makes later tests inherit a changed random stream, creating order-dependent behavior and potential flakiness outside test_nemotron_h_mamba_moe_only.

Fix in CursorFix in Web

with torch.device("cuda"), default_dtype(torch.float32):
input_ids = torch.randint(0, 256, (1, 32))
position_ids = torch.arange(0, 32).unsqueeze(0)
Expand Down
Loading