File size: 9,047 Bytes
c1d13ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a831e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1d13ab
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{
  "tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] },
  "cases": [
    {
      "name": "rank3_sequence_window",
      "inputs": {
        "data": { "dtype": "float32", "shape": [1, 128, 768] },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 32 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 96 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [1, 64, 768] } }
    },
    {
      "name": "rank3_end_past_dim",
      "inputs": {
        "data": { "dtype": "float32", "shape": [1, 128, 768] },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 120 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 999 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [1, 8, 768] } }
    },
    {
      "name": "slice-rows-aligned-f32-4096x4096",
      "preset": "smoke",
      "vars": { "outRows": 3584, "cols": 4096 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [4096, 4096], "dist": "normal", "seed": 131, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 256 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 3840 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [3584, 4096] } },
      "bench": { "primary": true, "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * 4 * 2" }] }
    },
    {
      "name": "slice-inner-misaligned-f32-4096x4100",
      "preset": "smoke",
      "vars": { "rows": 4096, "outCols": 4096 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [4096, 4100], "dist": "normal", "seed": 132, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 2 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 4098 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [4096, 4096] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.outCols * 4 * 2" }] }
    },
    {
      "name": "slice-rows-aligned-f16-4096x2048",
      "preset": "edge",
      "vars": { "outRows": 3072, "cols": 2048, "dtype": "float16" },
      "inputs": {
        "data": { "dtype": "float16", "shape": [4096, 2048], "dist": "normal", "seed": 133, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 512 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 3584 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float16", "shape": [3072, 2048] } },
      "bench": {
        "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * dtypeBytes(args.dtype) * 2" }]
      }
    },
    {
      "name": "slice-inner-true-misaligned-f32-4096x4097",
      "preset": "edge",
      "vars": { "rows": 4096, "outCols": 4097 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [8192, 4097], "dist": "normal", "seed": 141, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 2048 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 6144 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [4096, 4097] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.outCols * 4 * 2" }] }
    },
    {
      "name": "slice-no-axes-no-steps-f32-4096x4096",
      "preset": "edge",
      "vars": { "outRows": 3584, "cols": 4096 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [4096, 4096], "dist": "normal", "seed": 142, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 256 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 3840 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [3584, 4096] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * 4 * 2" }] }
    },
    {
      "name": "slice-inner-vec4-unaligned-reverse-f32-4096x4096",
      "preset": "stress",
      "vars": { "rows": 4096, "cols": 4096 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [4096, 4096], "dist": "normal", "seed": 151, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": -1 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": -2147483648 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": -1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [4096, 4096], "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * 4 * 2" }] }
    },
    {
      "name": "slice-rows-aligned-f32-2048x2048",
      "preset": "smoke",
      "vars": { "outRows": 1792, "cols": 2048 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [2048, 2048], "dist": "normal", "seed": 134, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 128 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1920 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [1792, 2048] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * 4 * 2" }] }
    },
    {
      "name": "slice-middle-axis-f32-24x512x197-vit-tokens-pathology",
      "preset": "stress",
      "provenance": {
        "notes": "Sequence-window slice on the middle axis of a rank-3 tensor whose last extent is the ViT-B/16 token count: the inner_vec4 family needs both data and output last extents % 4 == 0 and rank2_single_axis_x4 serves rank 2 only, so 197 drops the copy to generic_metadata with a per-axis divmod address chain. Batch 24 keeps the sliced output above 1M elements. Control: slice-middle-axis-f32-24x512x200-control."
      },
      "vars": { "batch": 24, "outRows": 256, "cols": 197 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [24, 512, 197], "dist": "normal", "seed": 152, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 256 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [24, 256, 197], "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.outRows * args.cols * 4 * 2" }] }
    },
    {
      "name": "slice-middle-axis-f32-24x512x200-control",
      "preset": "stress",
      "provenance": {
        "notes": "Nearest multiple-of-4 last extent for slice-middle-axis-f32-24x512x197-vit-tokens-pathology (1.5% more bytes) on the inner_vec4 route."
      },
      "vars": { "batch": 24, "outRows": 256, "cols": 200 },
      "inputs": {
        "data": { "dtype": "float32", "shape": [24, 512, 200], "dist": "normal", "seed": 153, "scale": 0.5 },
        "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
        "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 256 },
        "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
        "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [24, 256, 200], "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.outRows * args.cols * 4 * 2" }] }
    }
  ]
}