MCPcopy
hub / github.com/hpcaitech/ColossalAI / seed_all

Function seed_all

colossalai/testing/random.py:7–19  ·  view source on GitHub ↗
(seed, cuda_deterministic=False)

Source from the content-addressed store, hash-verified

5
6
7def seed_all(seed, cuda_deterministic=False):
8 random.seed(seed)
9 np.random.seed(seed)
10 torch.manual_seed(seed)
11 if torch.cuda.is_available():
12 torch.cuda.manual_seed(seed)
13 torch.cuda.manual_seed_all(seed)
14 if cuda_deterministic: # slower, more reproducible
15 torch.backends.cudnn.deterministic = True
16 torch.backends.cudnn.benchmark = False
17 else:
18 torch.backends.cudnn.deterministic = False
19 torch.backends.cudnn.benchmark = True

Callers 15

run_dist_lamb_basicFunction · 0.90
run_dist_lamb_fwd_bwdFunction · 0.90
exam_dist_came_baseFunction · 0.90
run_dist_galore_basicFunction · 0.90
run_dist_galore_fwd_bwdFunction · 0.90
test_diffusersFunction · 0.90
test_torch_diffusersFunction · 0.90
examine_ppFunction · 0.90
run_ppFunction · 0.90

Calls 4

seedMethod · 0.45
manual_seedMethod · 0.45
is_availableMethod · 0.45
manual_seed_allMethod · 0.45

Tested by 15

run_dist_lamb_basicFunction · 0.72
run_dist_lamb_fwd_bwdFunction · 0.72
exam_dist_came_baseFunction · 0.72
run_dist_galore_basicFunction · 0.72
run_dist_galore_fwd_bwdFunction · 0.72
test_diffusersFunction · 0.72
test_torch_diffusersFunction · 0.72
examine_ppFunction · 0.72
run_ppFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…