Skip to content

Commit a356a71

Browse files
committed
[FlagGems Operator Development Competition] Optimize roll
1 parent bf52906 commit a356a71

4 files changed

Lines changed: 543 additions & 65 deletions

File tree

benchmark/core_shapes.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ log10_out:
6363
- [1024, 65536]
6464
shape_desc: "(B), M, N"
6565

66+
roll:
67+
shapes:
68+
- [1024]
69+
- [256, 256]
70+
- [32, 64, 64]
71+
- [64, 128, 128]
72+
- [8, 16, 128, 128]
73+
shape_desc: "layout roll representative shapes"
74+
6675
softmax_backward:
6776
shapes:
6877
- [1048576] # 1024 * 1024

benchmark/test_generic_pointwise_perf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ def flip_input_fn(shape, cur_dtype, device):
2323

2424
def roll_input_fn(shape, cur_dtype, device):
2525
inp = generate_tensor_input(shape, cur_dtype, device)
26+
yield inp, {"shifts": 257}
2627
if len(shape) > 1:
28+
yield inp, {"shifts": 7, "dims": 0}
29+
yield inp, {"shifts": 13, "dims": len(shape) - 1}
2730
yield inp, {"shifts": (1, 2), "dims": (0, 1)}
2831
else:
2932
yield inp, {"shifts": 1, "dims": 0}

0 commit comments

Comments
 (0)