Skip to content

Commit be8da13

Browse files
committed
try setting seeds before each run
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
1 parent 7b4e562 commit be8da13

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

recipes/esm2_native_te_mfsdp/test_train.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
from train_mfsdp import main as main_mfsdp
2929

3030

31-
random.seed(42)
32-
torch.manual_seed(42)
33-
if torch.cuda.is_available():
34-
torch.cuda.manual_seed_all(42)
31+
@pytest.fixture(autouse=True)
32+
def set_seed():
33+
random.seed(42)
34+
torch.manual_seed(42)
35+
if torch.cuda.is_available():
36+
torch.cuda.manual_seed_all(42)
3537

3638

3739
requires_multi_gpu = pytest.mark.skipif(

0 commit comments

Comments
 (0)