Skip to content

Commit 128fd21

Browse files
authored
[BENCH] Fix out of bound memory access errors when bias is used (#6736)
Different experts do not share the same bias
1 parent 084bc47 commit 128fd21

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bench/bench/bench_mlp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def bench_mlp(batch, dim1, dim2, n_expts_tot, n_expts_act, x_dtype, w_dtype, TP,
111111
w2 = torch.randn((n_expts_tot // EP, dim2 // TP // 2, dim1), device=dev)
112112
# biases
113113
bg = torch.randn((n_expts_tot, ), device=dev)
114-
b1 = torch.randn((dim2 // TP, ), device=dev)
115-
b2 = torch.randn((dim1, ), device=dev)
114+
b1 = torch.randn((n_expts_tot // EP, dim2 // TP), device=dev)
115+
b2 = torch.randn((n_expts_tot // EP, dim1), device=dev)
116116

117117
# -- numerics --
118118
optg = dict()

0 commit comments

Comments
 (0)