File size: 6,382 Bytes
8cafdb8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d330231
8cafdb8
 
 
 
 
 
 
d330231
 
 
 
 
ab68eb1
d330231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ab68eb1
d330231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8cafdb8
 
 
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
{
  "tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] },
  "cases": [
    {
      "name": "cast-f32-u32-1m",
      "preset": "smoke",
      "vars": { "inputDtype": "float32", "outputDtype": "uint32", "count": 1048576 },
      "attrs": { "to": 12 },
      "inputs": {
        "x": { "shape": [1048576], "dtype": "float32", "dist": "uniform", "seed": 103, "scale": 32, "signed": false }
      },
      "outputs": { "y": { "shape": [1048576], "dtype": "uint32" } },
      "bench": {
        "primary": true,
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f32-u32-1m-plus3",
      "preset": "smoke",
      "vars": { "inputDtype": "float32", "outputDtype": "uint32", "count": 1048579 },
      "attrs": { "to": 12 },
      "inputs": {
        "x": { "shape": [1048579], "dtype": "float32", "dist": "uniform", "seed": 104, "scale": 32, "signed": false }
      },
      "outputs": { "y": { "shape": [1048579], "dtype": "uint32" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f32-u32-16m",
      "preset": "smoke",
      "vars": { "inputDtype": "float32", "outputDtype": "uint32", "count": 16777216 },
      "attrs": { "to": 12 },
      "inputs": {
        "x": { "shape": [16777216], "dtype": "float32", "dist": "uniform", "seed": 108, "scale": 32, "signed": false }
      },
      "outputs": { "y": { "shape": [16777216], "dtype": "uint32" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f32-f16-1m",
      "preset": "smoke",
      "vars": { "inputDtype": "float32", "outputDtype": "float16", "count": 1048576 },
      "attrs": { "to": 10 },
      "inputs": { "x": { "shape": [1048576], "dtype": "float32", "dist": "normal", "seed": 105 } },
      "outputs": { "y": { "shape": [1048576], "dtype": "float16" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f16-f32-1m",
      "preset": "smoke",
      "vars": { "inputDtype": "float16", "outputDtype": "float32", "count": 1048576 },
      "attrs": { "to": 1 },
      "inputs": { "x": { "shape": [1048576], "dtype": "float16", "dist": "normal", "seed": 106 } },
      "outputs": { "y": { "shape": [1048576], "dtype": "float32" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-i8-f32-1m-plus3",
      "preset": "smoke",
      "vars": { "inputDtype": "int8", "outputDtype": "float32", "count": 1048579 },
      "attrs": { "to": 1 },
      "inputs": {
        "x": { "shape": [1048579], "dtype": "int8", "dist": "uniform", "seed": 107, "min": -128, "max": 128 }
      },
      "outputs": { "y": { "shape": [1048579], "dtype": "float32" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-i32-bool-4m-scalar-pathology",
      "preset": "smoke",
      "provenance": {
        "notes": "An aligned 4,194,304-element cast from int32 to bool. The paired float32-to-int32 case uses the same tensor extent."
      },
      "vars": { "inputDtype": "int32", "outputDtype": "bool", "count": 4194304 },
      "attrs": { "to": 9 },
      "inputs": { "x": { "shape": [4194304], "dtype": "int32", "dist": "uniform", "seed": 109, "min": -3, "max": 4 } },
      "outputs": { "y": { "shape": [4194304], "dtype": "bool" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f32-i32-4m-control",
      "preset": "smoke",
      "provenance": {
        "notes": "Same 8 bytes per element as cast-i32-bool-4m-scalar-pathology (f32 in, 4-byte int32 out) on the aligned same_layout_vec4 route."
      },
      "vars": { "inputDtype": "float32", "outputDtype": "int32", "count": 4194304 },
      "attrs": { "to": 6 },
      "inputs": { "x": { "shape": [4194304], "dtype": "float32", "dist": "normal", "seed": 110, "scale": 32 } },
      "outputs": { "y": { "shape": [4194304], "dtype": "int32" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f32-f16-4194305-vec4-tail-pathology",
      "preset": "smoke",
      "provenance": {
        "notes": "One element past a 4,194,304-element aligned cast leaves a one-element tail; the paired 4,194,304-element case checks the aligned boundary."
      },
      "vars": { "inputDtype": "float32", "outputDtype": "float16", "count": 4194305 },
      "attrs": { "to": 10 },
      "inputs": { "x": { "shape": [4194305], "dtype": "float32", "dist": "normal", "seed": 113 } },
      "outputs": { "y": { "shape": [4194305], "dtype": "float16" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    },
    {
      "name": "cast-f32-f16-4194304-control",
      "preset": "smoke",
      "provenance": {
        "notes": "An aligned four-million-element input measures the vec4-only float32-to-float16 path without a scalar tail."
      },
      "vars": { "inputDtype": "float32", "outputDtype": "float16", "count": 4194304 },
      "attrs": { "to": 10 },
      "inputs": { "x": { "shape": [4194304], "dtype": "float32", "dist": "normal", "seed": 114 } },
      "outputs": { "y": { "shape": [4194304], "dtype": "float16" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.count * (dtypeBytes(args.inputDtype) + dtypeBytes(args.outputDtype))" }
        ]
      }
    }
  ]
}