webgpu-bench 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +4 -4
  2. package/dist/benchmarks/common.d.ts +6 -8
  3. package/dist/benchmarks/common.d.ts.map +1 -1
  4. package/dist/benchmarks/common.js +0 -8
  5. package/dist/benchmarks/common.js.map +1 -1
  6. package/dist/benchmarks/flopsCommon.d.ts +0 -9
  7. package/dist/benchmarks/flopsCommon.d.ts.map +1 -1
  8. package/dist/benchmarks/flopsCommon.js +1 -5
  9. package/dist/benchmarks/flopsCommon.js.map +1 -1
  10. package/dist/benchmarks/flopsConvert.d.ts +7 -6
  11. package/dist/benchmarks/flopsConvert.d.ts.map +1 -1
  12. package/dist/benchmarks/flopsConvert.js +10 -30
  13. package/dist/benchmarks/flopsConvert.js.map +1 -1
  14. package/dist/benchmarks/flopsF16.d.ts +1 -1
  15. package/dist/benchmarks/flopsF16.d.ts.map +1 -1
  16. package/dist/benchmarks/flopsF16.js +3 -11
  17. package/dist/benchmarks/flopsF16.js.map +1 -1
  18. package/dist/benchmarks/flopsF32.d.ts +1 -1
  19. package/dist/benchmarks/flopsF32.d.ts.map +1 -1
  20. package/dist/benchmarks/flopsF32.js +3 -11
  21. package/dist/benchmarks/flopsF32.js.map +1 -1
  22. package/dist/benchmarks/flopsI8.d.ts +2 -2
  23. package/dist/benchmarks/flopsI8.d.ts.map +1 -1
  24. package/dist/benchmarks/flopsI8.js +6 -25
  25. package/dist/benchmarks/flopsI8.js.map +1 -1
  26. package/dist/benchmarks/flopsMath.d.ts.map +1 -1
  27. package/dist/benchmarks/flopsMath.js +0 -16
  28. package/dist/benchmarks/flopsMath.js.map +1 -1
  29. package/dist/benchmarks/streamBandwidth.d.ts +6 -5
  30. package/dist/benchmarks/streamBandwidth.d.ts.map +1 -1
  31. package/dist/benchmarks/streamBandwidth.js +30 -21
  32. package/dist/benchmarks/streamBandwidth.js.map +1 -1
  33. package/dist/catalog.d.ts +18 -7
  34. package/dist/catalog.d.ts.map +1 -1
  35. package/dist/catalog.js +235 -32
  36. package/dist/catalog.js.map +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/shaders/flopsF16Vec4.d.ts +5 -4
  41. package/dist/shaders/flopsF16Vec4.d.ts.map +1 -1
  42. package/dist/shaders/flopsF16Vec4.js +46 -6
  43. package/dist/shaders/flopsF16Vec4.js.map +1 -1
  44. package/dist/shaders/flopsF32Div.d.ts +6 -3
  45. package/dist/shaders/flopsF32Div.d.ts.map +1 -1
  46. package/dist/shaders/flopsF32Div.js +37 -34
  47. package/dist/shaders/flopsF32Div.js.map +1 -1
  48. package/dist/shaders/flopsF32F16Convert.d.ts +3 -3
  49. package/dist/shaders/flopsF32F16Convert.js +3 -3
  50. package/dist/shaders/flopsF32Vec4.d.ts +8 -6
  51. package/dist/shaders/flopsF32Vec4.d.ts.map +1 -1
  52. package/dist/shaders/flopsF32Vec4.js +49 -8
  53. package/dist/shaders/flopsF32Vec4.js.map +1 -1
  54. package/dist/shaders/flopsI32Div.d.ts +5 -3
  55. package/dist/shaders/flopsI32Div.d.ts.map +1 -1
  56. package/dist/shaders/flopsI32Div.js +37 -35
  57. package/dist/shaders/flopsI32Div.js.map +1 -1
  58. package/dist/shaders/flopsI32F32Convert.d.ts +2 -2
  59. package/dist/shaders/flopsI32F32Convert.js +2 -2
  60. package/dist/shaders/flopsI8Dp4a.d.ts +8 -5
  61. package/dist/shaders/flopsI8Dp4a.d.ts.map +1 -1
  62. package/dist/shaders/flopsI8Dp4a.js +40 -9
  63. package/dist/shaders/flopsI8Dp4a.js.map +1 -1
  64. package/dist/shaders/flopsI8Vec4.d.ts +4 -4
  65. package/dist/shaders/flopsI8Vec4.d.ts.map +1 -1
  66. package/dist/shaders/flopsI8Vec4.js +45 -6
  67. package/dist/shaders/flopsI8Vec4.js.map +1 -1
  68. package/dist/shaders/flopsU32PackUnpack.d.ts +10 -8
  69. package/dist/shaders/flopsU32PackUnpack.d.ts.map +1 -1
  70. package/dist/shaders/flopsU32PackUnpack.js +49 -23
  71. package/dist/shaders/flopsU32PackUnpack.js.map +1 -1
  72. package/dist/shaders/streamRead.d.ts +9 -7
  73. package/dist/shaders/streamRead.d.ts.map +1 -1
  74. package/dist/shaders/streamRead.js +15 -17
  75. package/dist/shaders/streamRead.js.map +1 -1
  76. package/dist/shaders/streamWrite.d.ts +4 -5
  77. package/dist/shaders/streamWrite.d.ts.map +1 -1
  78. package/dist/shaders/streamWrite.js +10 -15
  79. package/dist/shaders/streamWrite.js.map +1 -1
  80. package/dist/suite.d.ts.map +1 -1
  81. package/dist/suite.js +2 -7
  82. package/dist/suite.js.map +1 -1
  83. package/dist/types.d.ts +5 -6
  84. package/dist/types.d.ts.map +1 -1
  85. package/package.json +1 -1
@@ -6,7 +6,6 @@ import { flopsF32RsqrtWgsl } from "../shaders/flopsF32Rsqrt.js";
6
6
  import { flopsF32PowWgsl } from "../shaders/flopsF32Pow.js";
7
7
  import { flopsF32SincosWgsl } from "../shaders/flopsF32Sincos.js";
8
8
  import { flopsF32LogWgsl } from "../shaders/flopsF32Log.js";
9
- import { OPS_METRIC } from "./common.js";
10
9
  /**
11
10
  * "Real" ALU ops beyond multiply-add: division and the transcendentals
12
11
  * (sqrt, pow, sin/cos, log) that 3D math leans on constantly (normalize,
@@ -21,8 +20,6 @@ import { OPS_METRIC } from "./common.js";
21
20
  export function prepareFlopsF32Div(ctx, harness = {}) {
22
21
  return prepareFlopsBenchmark(ctx, {
23
22
  id: 'flops-f32-div',
24
- label: 'fp32 div FLOPS',
25
- description: 'Eight independent scalar f32 divide-add chains per thread, unrolled 4x — the fp32 scalar FMA test with divide in place of multiply, so the gap between the two isolates the cost of division.',
26
23
  wgsl: flopsF32DivWgsl,
27
24
  flopsPerIteration: 64,
28
25
  defaultIterations: 256,
@@ -32,10 +29,7 @@ export function prepareFlopsF32Div(ctx, harness = {}) {
32
29
  export function prepareFlopsI32Div(ctx, harness = {}) {
33
30
  return prepareFlopsBenchmark(ctx, {
34
31
  id: 'flops-i32-div',
35
- label: 'i32 div FLOPS',
36
- description: 'Eight independent scalar i32 divide-add chains per thread, unrolled 4x — the int8-range scalar test with divide in place of multiply. Integer division is typically the slowest basic ALU op on a GPU.',
37
32
  wgsl: flopsI32DivWgsl,
38
- metric: OPS_METRIC,
39
33
  flopsPerIteration: 64,
40
34
  defaultIterations: 256,
41
35
  }, harness);
@@ -44,8 +38,6 @@ export function prepareFlopsI32Div(ctx, harness = {}) {
44
38
  export function prepareFlopsF32Sqrt(ctx, harness = {}) {
45
39
  return prepareFlopsBenchmark(ctx, {
46
40
  id: 'flops-f32-sqrt',
47
- label: 'fp32 sqrt FLOPS',
48
- description: 'Eight independent scalar f32 sqrt-add chains per thread, unrolled 4x. sqrt is a common special-function-unit instruction; this measures its throughput in isolation.',
49
41
  wgsl: flopsF32SqrtWgsl,
50
42
  flopsPerIteration: 64,
51
43
  defaultIterations: 256,
@@ -55,8 +47,6 @@ export function prepareFlopsF32Sqrt(ctx, harness = {}) {
55
47
  export function prepareFlopsF32Rsqrt(ctx, harness = {}) {
56
48
  return prepareFlopsBenchmark(ctx, {
57
49
  id: 'flops-f32-rsqrt',
58
- label: 'fp32 rsqrt FLOPS',
59
- description: 'Eight independent scalar f32 inverseSqrt-add chains per thread, unrolled 4x. The op behind every normalize(); most GPUs have a dedicated fast-rsqrt path, so compare against flops-f32-sqrt to see the gap.',
60
50
  wgsl: flopsF32RsqrtWgsl,
61
51
  flopsPerIteration: 64,
62
52
  defaultIterations: 256,
@@ -66,8 +56,6 @@ export function prepareFlopsF32Rsqrt(ctx, harness = {}) {
66
56
  export function prepareFlopsF32Pow(ctx, harness = {}) {
67
57
  return prepareFlopsBenchmark(ctx, {
68
58
  id: 'flops-f32-pow',
69
- label: 'fp32 pow FLOPS',
70
- description: 'Eight independent scalar f32 pow-add chains per thread, unrolled 4x. pow(x, e) for a non-integer e is usually exp2(e * log2(x)) under the hood — several instructions — so expect this well below sqrt/div throughput.',
71
59
  wgsl: flopsF32PowWgsl,
72
60
  flopsPerIteration: 64,
73
61
  defaultIterations: 128,
@@ -77,8 +65,6 @@ export function prepareFlopsF32Pow(ctx, harness = {}) {
77
65
  export function prepareFlopsF32Sincos(ctx, harness = {}) {
78
66
  return prepareFlopsBenchmark(ctx, {
79
67
  id: 'flops-f32-sincos',
80
- label: 'fp32 sin/cos FLOPS',
81
- description: 'Eight independent scalar f32 cos(sin(x)) chains per thread, unrolled 4x. Naturally bounded to [-1, 1], so no stabilization term is needed. Measures combined sin+cos throughput.',
82
68
  wgsl: flopsF32SincosWgsl,
83
69
  flopsPerIteration: 64,
84
70
  defaultIterations: 128,
@@ -88,8 +74,6 @@ export function prepareFlopsF32Sincos(ctx, harness = {}) {
88
74
  export function prepareFlopsF32Log(ctx, harness = {}) {
89
75
  return prepareFlopsBenchmark(ctx, {
90
76
  id: 'flops-f32-log',
91
- label: 'fp32 ln FLOPS',
92
- description: 'Eight independent scalar f32 ln-add chains per thread, unrolled 4x. log(x) is usually log2(x) * ln(2) under the hood, so expect throughput close to a raw log2 special-function call.',
93
77
  wgsl: flopsF32LogWgsl,
94
78
  flopsPerIteration: 64,
95
79
  defaultIterations: 256,
@@ -1 +1 @@
1
- {"version":3,"file":"flopsMath.js","sourceRoot":"","sources":["../../src/benchmarks/flopsMath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OA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;QACrB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,6MAA6M;QAC/M,IAAI,EAAE,iBAAiB;QACvB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,UAA8B,EAAE;IAClF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,wNAAwN;QAC1N,IAAI,EAAE,eAAe;QACrB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB,CAAC,GAAe,EAAE,UAA8B,EAAE;IACrF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,kLAAkL;QACpL,IAAI,EAAE,kBAAkB;QACxB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,UAA8B,EAAE;IAClF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,uLAAuL;QACzL,IAAI,EAAE,eAAe;QACrB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"flopsMath.js","sourceRoot":"","sources":["../../src/benchmarks/flopsMath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EA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EACH;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,UAA8B,EAAE;IAClF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB,CAAC,GAAe,EAAE,UAA8B,EAAE;IACrF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,kBAAkB;QACxB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,UAA8B,EAAE;IAClF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -3,15 +3,16 @@ import type { GeneratedData } from '../data/generate.ts';
3
3
  import { type HarnessConfig, type PreparedBenchmark } from './common.ts';
4
4
  /**
5
5
  * Read-bandwidth test: streams the (already-allocated, matrix-sized) input
6
- * buffer through each thread with nothing but addition, writing back a
7
- * single scalar per thread. Reads vastly outweigh writes, so `gbps` here is
8
- * a read-bandwidth-bound number close to the device's peak.
6
+ * buffer through a coalesced grid-stride loop with nothing but addition,
7
+ * writing back a single scalar per thread. Reads vastly outweigh writes, so
8
+ * `gbps` here is a read-bandwidth-bound number close to the device's peak.
9
9
  */
10
10
  export declare function prepareReadBandwidth(ctx: GpuContext, data: GeneratedData, harness?: HarnessConfig): Promise<PreparedBenchmark>;
11
11
  /**
12
12
  * Write-bandwidth test: streams computed values out into a matrix-sized
13
- * output buffer. No buffer reads at all, so `gbps` here is a
14
- * write-bandwidth-bound number close to the device's peak.
13
+ * output buffer through the same coalesced grid-stride loop. No buffer reads
14
+ * at all, so `gbps` here is a write-bandwidth-bound number close to the
15
+ * device's peak.
15
16
  */
16
17
  export declare function prepareWriteBandwidth(ctx: GpuContext, data: GeneratedData, harness?: HarnessConfig): Promise<PreparedBenchmark>;
17
18
  //# sourceMappingURL=streamBandwidth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"streamBandwidth.d.ts","sourceRoot":"","sources":["../../src/benchmarks/streamBandwidth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAIrB;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAiC5B;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA+B5B"}
1
+ {"version":3,"file":"streamBandwidth.d.ts","sourceRoot":"","sources":["../../src/benchmarks/streamBandwidth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAA0C,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAsBjH;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA4B5B;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA0B5B"}
@@ -1,20 +1,36 @@
1
1
  import { createUniformBuffer, createStorageBuffer, createEmptyStorageBuffer } from "../gpu/buffers.js";
2
- import { createPipeline, prepareKernelBenchmark, BYTES_METRIC, } from "./common.js";
2
+ import { createPipeline, prepareKernelBenchmark } from "./common.js";
3
3
  import { streamReadWgsl } from "../shaders/streamRead.js";
4
4
  import { streamWriteWgsl } from "../shaders/streamWrite.js";
5
+ const WORKGROUP_SIZE = 256;
6
+ /**
7
+ * vec4 loads/stores per thread. Threads are sized from the buffer, not the
8
+ * GPU: WebGPU limits say nothing about core count or memory bus, so instead
9
+ * every device gets a shape that's good everywhere — coalesced grid-stride
10
+ * access, a few independent accesses per thread to hide latency, and enough
11
+ * threads (256K for the default 64 MB buffer) to fill a wide discrete GPU,
12
+ * while a small mobile GPU just drains the same workgroups over more waves.
13
+ * On an M3 this is within a few percent of the best thread count in a sweep.
14
+ */
15
+ const VEC4S_PER_THREAD = 16;
16
+ function bandwidthShape(data) {
17
+ const count = data.matrix.length / 4;
18
+ const workgroups = Math.max(1, Math.ceil(count / VEC4S_PER_THREAD / WORKGROUP_SIZE));
19
+ return { count, threads: workgroups * WORKGROUP_SIZE, workgroups };
20
+ }
5
21
  /**
6
22
  * Read-bandwidth test: streams the (already-allocated, matrix-sized) input
7
- * buffer through each thread with nothing but addition, writing back a
8
- * single scalar per thread. Reads vastly outweigh writes, so `gbps` here is
9
- * a read-bandwidth-bound number close to the device's peak.
23
+ * buffer through a coalesced grid-stride loop with nothing but addition,
24
+ * writing back a single scalar per thread. Reads vastly outweigh writes, so
25
+ * `gbps` here is a read-bandwidth-bound number close to the device's peak.
10
26
  */
11
27
  export async function prepareReadBandwidth(ctx, data, harness = {}) {
12
28
  const { device } = ctx;
13
- const cols4 = data.cols / 4;
29
+ const { count, threads, workgroups } = bandwidthShape(data);
14
30
  const pipeline = await createPipeline(device, 'stream-read', streamReadWgsl);
15
- const paramsBuf = createUniformBuffer(device, new Uint32Array([data.rows, cols4]), 'params');
31
+ const paramsBuf = createUniformBuffer(device, new Uint32Array([count, threads]), 'params');
16
32
  const dataBuf = createStorageBuffer(device, data.matrix, 'data');
17
- const outBuf = createEmptyStorageBuffer(device, data.rows * 4, 'out');
33
+ const outBuf = createEmptyStorageBuffer(device, threads * 4, 'out');
18
34
  const bindGroup = device.createBindGroup({
19
35
  layout: pipeline.getBindGroupLayout(0),
20
36
  entries: [
@@ -25,16 +41,12 @@ export async function prepareReadBandwidth(ctx, data, harness = {}) {
25
41
  });
26
42
  return prepareKernelBenchmark({
27
43
  id: 'read-bandwidth',
28
- label: 'Read bandwidth',
29
- description: 'One thread per row; streams a large buffer in via vec4<f32> loads and addition only, writes one scalar. Read-bandwidth-bound.',
30
- source: streamReadWgsl,
31
44
  category: 'bandwidth',
32
45
  ctx,
33
46
  rows: data.rows,
34
47
  cols: data.cols,
35
- metric: BYTES_METRIC,
36
48
  amountPerOp: data.matrix.byteLength,
37
- workgroupsPerIteration: [Math.ceil(data.rows / 64), 1, 1],
49
+ workgroupsPerIteration: [workgroups, 1, 1],
38
50
  pipeline,
39
51
  bindGroup,
40
52
  ...harness,
@@ -42,14 +54,15 @@ export async function prepareReadBandwidth(ctx, data, harness = {}) {
42
54
  }
43
55
  /**
44
56
  * Write-bandwidth test: streams computed values out into a matrix-sized
45
- * output buffer. No buffer reads at all, so `gbps` here is a
46
- * write-bandwidth-bound number close to the device's peak.
57
+ * output buffer through the same coalesced grid-stride loop. No buffer reads
58
+ * at all, so `gbps` here is a write-bandwidth-bound number close to the
59
+ * device's peak.
47
60
  */
48
61
  export async function prepareWriteBandwidth(ctx, data, harness = {}) {
49
62
  const { device } = ctx;
50
- const cols4 = data.cols / 4;
63
+ const { count, threads, workgroups } = bandwidthShape(data);
51
64
  const pipeline = await createPipeline(device, 'stream-write', streamWriteWgsl);
52
- const paramsBuf = createUniformBuffer(device, new Uint32Array([data.rows, cols4]), 'params');
65
+ const paramsBuf = createUniformBuffer(device, new Uint32Array([count, threads]), 'params');
53
66
  const outBuf = createEmptyStorageBuffer(device, data.matrix.byteLength, 'out');
54
67
  const bindGroup = device.createBindGroup({
55
68
  layout: pipeline.getBindGroupLayout(0),
@@ -60,16 +73,12 @@ export async function prepareWriteBandwidth(ctx, data, harness = {}) {
60
73
  });
61
74
  return prepareKernelBenchmark({
62
75
  id: 'write-bandwidth',
63
- label: 'Write bandwidth',
64
- description: 'One thread per row; stores computed vec4<f32> values into a large buffer with no buffer reads. Write-bandwidth-bound.',
65
- source: streamWriteWgsl,
66
76
  category: 'bandwidth',
67
77
  ctx,
68
78
  rows: data.rows,
69
79
  cols: data.cols,
70
- metric: BYTES_METRIC,
71
80
  amountPerOp: data.matrix.byteLength,
72
- workgroupsPerIteration: [Math.ceil(data.rows / 64), 1, 1],
81
+ workgroupsPerIteration: [workgroups, 1, 1],
73
82
  pipeline,
74
83
  bindGroup,
75
84
  ...harness,
@@ -1 +1 @@
1
- {"version":3,"file":"streamBandwidth.js","sourceRoot":"","sources":["../../src/benchmarks/streamBandwidth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,YAAY,GAGb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAA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AAC,MAAM,CAAC,UAAU;QACnC,sBAAsB,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QAC1C,QAAQ;QACR,SAAS;QACT,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
package/dist/catalog.d.ts CHANGED
@@ -1,22 +1,33 @@
1
1
  import type { BenchmarkCategory, MetricDef } from './types.ts';
2
- /** Identity of one benchmark, known without touching the GPU. */
2
+ /**
3
+ * Identity of one benchmark, known without touching the GPU: label,
4
+ * description and WGSL source for display, plus category/metric for
5
+ * formatting a result once one arrives. The sole source of truth for all
6
+ * of this — `runSuite`'s `BenchmarkResult` rows carry only what's known
7
+ * from actually running (status, timings, `metricValue`), keyed by `id`
8
+ * back onto this catalog rather than repeating it.
9
+ */
3
10
  export interface BenchmarkInfo {
4
11
  id: string;
5
12
  label: string;
13
+ description: string;
14
+ /** WGSL source of the kernel, for display alongside a result. */
15
+ source: string;
6
16
  category: BenchmarkCategory;
7
17
  metric: MetricDef;
8
18
  }
9
19
  /**
10
20
  * Every benchmark `runSuite` can yield a row for, in the same order it
11
21
  * schedules them — so a UI can render the full results table (id, label,
12
- * category, metric unit) before a device is even acquired, then fill in
13
- * throughput as `runSuite`'s rows arrive and merge onto these ids.
22
+ * category, metric unit, description, source) before a device is even
23
+ * acquired, then fill in throughput as `runSuite`'s rows arrive and merge
24
+ * onto these ids.
14
25
  *
15
26
  * Kept as a hand-written list, not derived from `suite.ts`'s benchmark
16
- * table, because each kernel's id/label/metric there is itself a literal
17
- * embedded next to its WGSL and `prepare*` call (real GPU setup) nothing
18
- * to derive from without running it. `suite.browser.test.ts` asserts this
19
- * list's ids match `runSuite`'s one-to-one, so the two can't drift silently.
27
+ * table, because `suite.ts` only wires up *how* to run each kernel (its
28
+ * `prepare*` call) it doesn't carry a duplicate copy of this metadata to
29
+ * derive from. `suite.browser.test.ts` asserts this list's ids match
30
+ * `runSuite`'s one-to-one, so the two can't drift silently.
20
31
  */
21
32
  export declare const BENCHMARK_CATALOG: readonly BenchmarkInfo[];
22
33
  //# sourceMappingURL=catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/D,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,aAAa,EAiCrD,CAAC"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4B/D;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,aAAa,EA0OrD,CAAC"}
package/dist/catalog.js CHANGED
@@ -1,48 +1,251 @@
1
1
  import { BYTES_METRIC, FLOPS_METRIC, OPS_METRIC } from "./benchmarks/common.js";
2
+ import { streamReadWgsl } from "./shaders/streamRead.js";
3
+ import { streamWriteWgsl } from "./shaders/streamWrite.js";
4
+ import { flopsF32ScalarWgsl } from "./shaders/flopsF32Scalar.js";
5
+ import { flopsF32Vec4Wgsl } from "./shaders/flopsF32Vec4.js";
6
+ import { flopsF32Mat4Wgsl } from "./shaders/flopsF32Mat4.js";
7
+ import { flopsF32MatvecWgsl } from "./shaders/flopsF32Matvec.js";
8
+ import { flopsF16ScalarWgsl } from "./shaders/flopsF16Scalar.js";
9
+ import { flopsF16Vec4Wgsl } from "./shaders/flopsF16Vec4.js";
10
+ import { flopsF16Mat4Wgsl } from "./shaders/flopsF16Mat4.js";
11
+ import { flopsF16MatvecWgsl } from "./shaders/flopsF16Matvec.js";
12
+ import { flopsI8ScalarWgsl } from "./shaders/flopsI8Scalar.js";
13
+ import { flopsI8Vec4Wgsl } from "./shaders/flopsI8Vec4.js";
14
+ import { flopsI8Mat4Wgsl } from "./shaders/flopsI8Mat4.js";
15
+ import { flopsI8MatvecWgsl } from "./shaders/flopsI8Matvec.js";
16
+ import { flopsI8MatvecDp4aWgsl } from "./shaders/flopsI8MatvecDp4a.js";
17
+ import { flopsI8Dp4aWgsl } from "./shaders/flopsI8Dp4a.js";
18
+ import { flopsF32DivWgsl } from "./shaders/flopsF32Div.js";
19
+ import { flopsI32DivWgsl } from "./shaders/flopsI32Div.js";
20
+ import { flopsF32SqrtWgsl } from "./shaders/flopsF32Sqrt.js";
21
+ import { flopsF32RsqrtWgsl } from "./shaders/flopsF32Rsqrt.js";
22
+ import { flopsF32PowWgsl } from "./shaders/flopsF32Pow.js";
23
+ import { flopsF32SincosWgsl } from "./shaders/flopsF32Sincos.js";
24
+ import { flopsF32LogWgsl } from "./shaders/flopsF32Log.js";
25
+ import { flopsU32PackUnpackWgsl } from "./shaders/flopsU32PackUnpack.js";
26
+ import { flopsI32F32ConvertWgsl } from "./shaders/flopsI32F32Convert.js";
27
+ import { flopsF32F16ConvertWgsl } from "./shaders/flopsF32F16Convert.js";
2
28
  /**
3
29
  * Every benchmark `runSuite` can yield a row for, in the same order it
4
30
  * schedules them — so a UI can render the full results table (id, label,
5
- * category, metric unit) before a device is even acquired, then fill in
6
- * throughput as `runSuite`'s rows arrive and merge onto these ids.
31
+ * category, metric unit, description, source) before a device is even
32
+ * acquired, then fill in throughput as `runSuite`'s rows arrive and merge
33
+ * onto these ids.
7
34
  *
8
35
  * Kept as a hand-written list, not derived from `suite.ts`'s benchmark
9
- * table, because each kernel's id/label/metric there is itself a literal
10
- * embedded next to its WGSL and `prepare*` call (real GPU setup) nothing
11
- * to derive from without running it. `suite.browser.test.ts` asserts this
12
- * list's ids match `runSuite`'s one-to-one, so the two can't drift silently.
36
+ * table, because `suite.ts` only wires up *how* to run each kernel (its
37
+ * `prepare*` call) it doesn't carry a duplicate copy of this metadata to
38
+ * derive from. `suite.browser.test.ts` asserts this list's ids match
39
+ * `runSuite`'s one-to-one, so the two can't drift silently.
13
40
  */
14
41
  export const BENCHMARK_CATALOG = [
15
- { id: 'read-bandwidth', label: 'Read bandwidth', category: 'bandwidth', metric: BYTES_METRIC },
16
- { id: 'write-bandwidth', label: 'Write bandwidth', category: 'bandwidth', metric: BYTES_METRIC },
17
- { id: 'flops-f32-scalar', label: 'fp32 scalar FMA FLOPS', category: 'compute', metric: FLOPS_METRIC },
18
- { id: 'flops-f32-vec4', label: 'fp32 vec4 FLOPS', category: 'compute', metric: FLOPS_METRIC },
19
- { id: 'flops-f32-mat4', label: 'fp32 mat4 FLOPS', category: 'compute', metric: FLOPS_METRIC },
20
- { id: 'flops-f32-matvec', label: 'fp32 matvec FLOPS', category: 'compute', metric: FLOPS_METRIC },
21
- { id: 'flops-f16-scalar', label: 'fp16 scalar FMA FLOPS', category: 'compute', metric: FLOPS_METRIC },
22
- { id: 'flops-f16-vec4', label: 'fp16 vec4 FLOPS', category: 'compute', metric: FLOPS_METRIC },
23
- { id: 'flops-f16-mat4', label: 'fp16 mat4 FLOPS', category: 'compute', metric: FLOPS_METRIC },
24
- { id: 'flops-f16-matvec', label: 'fp16 matvec FLOPS', category: 'compute', metric: FLOPS_METRIC },
25
- { id: 'flops-i8-scalar', label: 'int8-range scalar FMA FLOPS', category: 'compute', metric: OPS_METRIC },
26
- { id: 'flops-i8-vec4', label: 'int8-range vec4 FLOPS', category: 'compute', metric: OPS_METRIC },
27
- { id: 'flops-i8-mat4', label: 'int8-range mat4 FLOPS', category: 'compute', metric: OPS_METRIC },
28
- { id: 'flops-i8-matvec', label: 'int8 matvec FLOPS (i32 dot)', category: 'compute', metric: OPS_METRIC },
42
+ {
43
+ id: 'read-bandwidth',
44
+ label: 'Read bandwidth',
45
+ description: 'Coalesced grid-stride loop: adjacent threads load adjacent vec4<f32>s from a large buffer, folded with addition only, one scalar written per thread. Read-bandwidth-bound.',
46
+ source: streamReadWgsl,
47
+ category: 'bandwidth',
48
+ metric: BYTES_METRIC,
49
+ },
50
+ {
51
+ id: 'write-bandwidth',
52
+ label: 'Write bandwidth',
53
+ description: 'Coalesced grid-stride loop: adjacent threads store adjacent computed vec4<f32>s into a large buffer with no buffer reads. Write-bandwidth-bound.',
54
+ source: streamWriteWgsl,
55
+ category: 'bandwidth',
56
+ metric: BYTES_METRIC,
57
+ },
58
+ {
59
+ id: 'flops-f32-scalar',
60
+ label: 'fp32 scalar FMA FLOPS',
61
+ description: 'Eight independent scalar f32 fused multiply-add chains per thread, unrolled 4x, so the ALU always has work in flight and the number reflects throughput rather than FMA latency. ~no memory traffic.',
62
+ source: flopsF32ScalarWgsl,
63
+ category: 'compute',
64
+ metric: FLOPS_METRIC,
65
+ },
66
+ {
67
+ id: 'flops-f32-vec4',
68
+ label: 'fp32 vec4 FLOPS',
69
+ description: 'Eight independent FMA chains held in vec4<f32> registers, unrolled 4x: the fp32 scalar test with every chain 4 lanes wide. On scalar-SIMT GPUs (Apple, NVIDIA, AMD) each step is 4 scalar FMAs, so this should match the scalar number; a gap means vector ops cost extra.',
70
+ source: flopsF32Vec4Wgsl,
71
+ category: 'compute',
72
+ metric: FLOPS_METRIC,
73
+ },
74
+ {
75
+ id: 'flops-f32-mat4',
76
+ label: 'fp32 mat4 FLOPS',
77
+ description: 'x = m * x + c chained in a register with a mat4x4<f32> (a bounded contraction so it stays numerically stable): 16 FMAs per step with plenty of independent work, exercising the full mat4 x vec4 multiply.',
78
+ source: flopsF32Mat4Wgsl,
79
+ category: 'compute',
80
+ metric: FLOPS_METRIC,
81
+ },
82
+ {
83
+ id: 'flops-f32-matvec',
84
+ label: 'fp32 matvec FLOPS',
85
+ description: 'A 4-row x 8-column f32 weight tile held in registers, applied to an 8-wide input every iteration via dot() (outputs feed back as the next inputs). The dot-product-accumulate shape of a GEMV inner loop with zero buffer traffic: pure ALU.',
86
+ source: flopsF32MatvecWgsl,
87
+ category: 'compute',
88
+ metric: FLOPS_METRIC,
89
+ },
90
+ {
91
+ id: 'flops-f16-scalar',
92
+ label: 'fp16 scalar FMA FLOPS',
93
+ description: 'Same eight independent, 4x-unrolled FMA chains as the fp32 scalar test, but every operand and accumulator is f16, so the chains run entirely in half precision.',
94
+ source: flopsF16ScalarWgsl,
95
+ category: 'compute',
96
+ metric: FLOPS_METRIC,
97
+ },
98
+ {
99
+ id: 'flops-f16-vec4',
100
+ label: 'fp16 vec4 FLOPS',
101
+ description: 'Same eight 4x-unrolled vec4 FMA chains as the fp32 vec4 test, but in vec4<f16>. Only GPUs with packed-half ALUs run this faster than fp32.',
102
+ source: flopsF16Vec4Wgsl,
103
+ category: 'compute',
104
+ metric: FLOPS_METRIC,
105
+ },
106
+ {
107
+ id: 'flops-f16-mat4',
108
+ label: 'fp16 mat4 FLOPS',
109
+ description: 'Same bounded x = m * x + c recurrence as the fp32 mat4 test, but m, c, and x are all f16, so the mat4x4 x vec4 multiply runs entirely in half precision.',
110
+ source: flopsF16Mat4Wgsl,
111
+ category: 'compute',
112
+ metric: FLOPS_METRIC,
113
+ },
114
+ {
115
+ id: 'flops-f16-matvec',
116
+ label: 'fp16 matvec FLOPS',
117
+ description: 'Same register-resident 4x8 matvec tile as the fp32 matvec test, but weights, inputs, and dot() accumulation are all f16. Pure ALU: the fp16 win here comes only from the ALU, not from halved memory traffic.',
118
+ source: flopsF16MatvecWgsl,
119
+ category: 'compute',
120
+ metric: FLOPS_METRIC,
121
+ },
122
+ {
123
+ id: 'flops-i8-scalar',
124
+ label: 'int8-range scalar FMA FLOPS',
125
+ description: 'Same eight independent, 4x-unrolled multiply-add chains as the fp32 scalar test, but on i32 (WGSL has no first-class i8 type). Measures integer multiply-add throughput; overflow wraps.',
126
+ source: flopsI8ScalarWgsl,
127
+ category: 'compute',
128
+ metric: OPS_METRIC,
129
+ },
130
+ {
131
+ id: 'flops-i8-vec4',
132
+ label: 'int8-range vec4 FLOPS',
133
+ description: 'Same eight 4x-unrolled vec4 multiply-add chains as the fp32 vec4 test, but in vec4<i32>.',
134
+ source: flopsI8Vec4Wgsl,
135
+ category: 'compute',
136
+ metric: OPS_METRIC,
137
+ },
138
+ {
139
+ id: 'flops-i8-mat4',
140
+ label: 'int8-range mat4 FLOPS',
141
+ description: 'x = m * x + c chained in a register, where m is a 4x4 integer matrix emulated as four vec4<i32> rows combined with dot() (WGSL has no mat4x4<i32>): the same 4 dot products a real int4x4 multiply compiles to.',
142
+ source: flopsI8Mat4Wgsl,
143
+ category: 'compute',
144
+ metric: OPS_METRIC,
145
+ },
146
+ {
147
+ id: 'flops-i8-matvec',
148
+ label: 'int8 matvec FLOPS (i32 dot)',
149
+ description: 'Same register-resident 4x8 matvec tile as the fp32 matvec test, with int8-range weights and inputs held unpacked as vec4<i32> and accumulated with integer dot(). The no-extension int8 path: what dot4I8Packed is competing against.',
150
+ source: flopsI8MatvecWgsl,
151
+ category: 'compute',
152
+ metric: OPS_METRIC,
153
+ },
29
154
  {
30
155
  id: 'flops-i8-matvec-dp4a',
31
156
  label: 'int8 matvec FLOPS (dot4I8Packed)',
157
+ description: "Same 4x8 matvec tile, but weights and inputs stay packed four int8 lanes per u32 and each 4-wide dot product is one dot4I8Packed call from the packed_4x8_integer_dot_product extension. On GPUs without a native dp4a instruction this runs the extension's polyfill.",
158
+ source: flopsI8MatvecDp4aWgsl,
159
+ category: 'compute',
160
+ metric: OPS_METRIC,
161
+ },
162
+ {
163
+ id: 'flops-i8-dp4a',
164
+ label: 'int8 dot4I8Packed FLOPS',
165
+ description: "Eight independent accumulators per thread, each summing dot4I8Packed(a, b) — the packed_4x8_integer_dot_product extension's 4-wide int8 dot-product instruction — in a tight loop to measure its peak throughput in isolation.",
166
+ source: flopsI8Dp4aWgsl,
167
+ category: 'compute',
168
+ metric: OPS_METRIC,
169
+ },
170
+ {
171
+ id: 'flops-f32-div',
172
+ label: 'fp32 div FLOPS',
173
+ description: 'Eight independent scalar f32 chains of x = a / x + b per thread, unrolled 4x — the fp32 scalar FMA test with divide in place of multiply, so the gap between the two isolates the cost of division. The loop-carried value is the divisor, so the compiler cannot hoist a reciprocal and turn it back into an FMA.',
174
+ source: flopsF32DivWgsl,
175
+ category: 'compute',
176
+ metric: FLOPS_METRIC,
177
+ },
178
+ {
179
+ id: 'flops-i32-div',
180
+ label: 'i32 div FLOPS',
181
+ description: 'Eight independent scalar i32 chains of x = a / x + b per thread, unrolled 4x — the int8-range scalar test with divide in place of multiply, divisor loop-carried. Integer division is typically the slowest basic ALU op on a GPU.',
182
+ source: flopsI32DivWgsl,
183
+ category: 'compute',
184
+ metric: OPS_METRIC,
185
+ },
186
+ {
187
+ id: 'flops-f32-sqrt',
188
+ label: 'fp32 sqrt FLOPS',
189
+ description: 'Eight independent scalar f32 sqrt-add chains per thread, unrolled 4x. sqrt is a common special-function-unit instruction; this measures its throughput in isolation.',
190
+ source: flopsF32SqrtWgsl,
191
+ category: 'compute',
192
+ metric: FLOPS_METRIC,
193
+ },
194
+ {
195
+ id: 'flops-f32-rsqrt',
196
+ label: 'fp32 rsqrt FLOPS',
197
+ description: 'Eight independent scalar f32 inverseSqrt-add chains per thread, unrolled 4x. The op behind every normalize(); most GPUs have a dedicated fast-rsqrt path, so compare against flops-f32-sqrt to see the gap.',
198
+ source: flopsF32RsqrtWgsl,
199
+ category: 'compute',
200
+ metric: FLOPS_METRIC,
201
+ },
202
+ {
203
+ id: 'flops-f32-pow',
204
+ label: 'fp32 pow FLOPS',
205
+ description: 'Eight independent scalar f32 pow-add chains per thread, unrolled 4x. pow(x, e) for a non-integer e is usually exp2(e * log2(x)) under the hood — several instructions — so expect this well below sqrt/div throughput.',
206
+ source: flopsF32PowWgsl,
207
+ category: 'compute',
208
+ metric: FLOPS_METRIC,
209
+ },
210
+ {
211
+ id: 'flops-f32-sincos',
212
+ label: 'fp32 sin/cos FLOPS',
213
+ description: 'Eight independent scalar f32 cos(sin(x)) chains per thread, unrolled 4x. Naturally bounded to [-1, 1], so no stabilization term is needed. Measures combined sin+cos throughput.',
214
+ source: flopsF32SincosWgsl,
215
+ category: 'compute',
216
+ metric: FLOPS_METRIC,
217
+ },
218
+ {
219
+ id: 'flops-f32-log',
220
+ label: 'fp32 ln FLOPS',
221
+ description: 'Eight independent scalar f32 ln-add chains per thread, unrolled 4x. log(x) is usually log2(x) * ln(2) under the hood, so expect throughput close to a raw log2 special-function call.',
222
+ source: flopsF32LogWgsl,
223
+ category: 'compute',
224
+ metric: FLOPS_METRIC,
225
+ },
226
+ {
227
+ id: 'flops-u32-packunpack',
228
+ label: 'u32 byte pack/unpack',
229
+ description: 'Eight independent u32 lanes, unrolled 4x, each step unpacking 4 bytes via shift+mask, incrementing them, and repacking — no pack4x8 (or unpack4x8) builtin, just the bit-twiddling those compile to. Counted as 2 ops per lane step (one unpack + one pack of a whole u32), since the compiler folds the individual shifts and masks.',
230
+ source: flopsU32PackUnpackWgsl,
231
+ category: 'compute',
232
+ metric: OPS_METRIC,
233
+ },
234
+ {
235
+ id: 'flops-i32-f32-convert',
236
+ label: 'i32<->f32 convert',
237
+ description: 'Eight independent chains per thread, unrolled 4x: xi -> f32(xi)*a+b -> back to i32 each step. Counted as 2 ops per lane step (one convert each way; the FMA is not counted).',
238
+ source: flopsI32F32ConvertWgsl,
239
+ category: 'compute',
240
+ metric: OPS_METRIC,
241
+ },
242
+ {
243
+ id: 'flops-f32-f16-convert',
244
+ label: 'f32<->f16 convert',
245
+ description: 'Eight independent vec2<f32> chains per thread, unrolled 4x: pack2x16float then unpack2x16float (round-trips through fp16 bits) plus a vec2 FMA to keep the chain moving. Counted as 2 ops per lane per step (one convert each way; the FMA is not counted). Unlike flops-f16-*, this needs no shader-f16 device feature — it measures the conversion, not f16 compute.',
246
+ source: flopsF32F16ConvertWgsl,
32
247
  category: 'compute',
33
248
  metric: OPS_METRIC,
34
249
  },
35
- { id: 'flops-i8-dp4a', label: 'int8 dot4I8Packed FLOPS', category: 'compute', metric: OPS_METRIC },
36
- { id: 'flops-f32-div', label: 'fp32 div FLOPS', category: 'compute', metric: FLOPS_METRIC },
37
- { id: 'flops-i32-div', label: 'i32 div FLOPS', category: 'compute', metric: OPS_METRIC },
38
- { id: 'flops-f32-sqrt', label: 'fp32 sqrt FLOPS', category: 'compute', metric: FLOPS_METRIC },
39
- { id: 'flops-f32-rsqrt', label: 'fp32 rsqrt FLOPS', category: 'compute', metric: FLOPS_METRIC },
40
- { id: 'flops-f32-pow', label: 'fp32 pow FLOPS', category: 'compute', metric: FLOPS_METRIC },
41
- { id: 'flops-f32-sincos', label: 'fp32 sin/cos FLOPS', category: 'compute', metric: FLOPS_METRIC },
42
- { id: 'flops-f32-log', label: 'fp32 ln FLOPS', category: 'compute', metric: FLOPS_METRIC },
43
- { id: 'flops-u32-packunpack', label: 'u32 byte pack/unpack ops', category: 'compute', metric: OPS_METRIC },
44
- { id: 'flops-i32-f32-convert', label: 'i32<->f32 convert FLOPS', category: 'compute', metric: OPS_METRIC },
45
- { id: 'flops-f32-f16-convert', label: 'f32<->f16 convert FLOPS', category: 'compute', metric: OPS_METRIC },
46
- { id: 'flops-i32-f16-convert', label: 'i32<->f16 convert FLOPS', category: 'compute', metric: OPS_METRIC },
47
250
  ];
48
251
  //# sourceMappingURL=catalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAWhF;;;;;;;;;;;GA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,EAAE,UAAU;KACnB;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,8KAA8K;QAChL,MAAM,EAAE,sBAAsB;QAC9B,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,UAAU;KACnB;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,wWAAwW;QAC1W,MAAM,EAAE,sBAAsB;QAC9B,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,UAAU;KACnB;CACF,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { runSuite } from './suite.ts';
2
2
  export { BENCHMARK_CATALOG } from './catalog.ts';
3
3
  export type { BenchmarkInfo } from './catalog.ts';
4
- export type { BenchmarkResult, SuiteOptions, SuiteProgressEvent, DeviceInfo, Stats, BenchmarkCategory, BenchmarkStatus, TimingMethod, SamplingStopReason, } from './types.ts';
4
+ export type { BenchmarkResult, SuiteOptions, SuiteProgressEvent, DeviceInfo, Stats, BenchmarkCategory, BenchmarkStatus, TimingMethod, SamplingStopReason, MetricDef, } from './types.ts';
5
5
  export { computeStats, isBestStable, isThrottled, tQuantile975 } from './stats.ts';
6
6
  export type { BestStableOptions } from './stats.ts';
7
7
  export { DEFAULT_SAMPLING, runSampling, recordSample, roundIsThrottled, resolveSamplingConfig } from './sampling.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EACV,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,kBAAkB,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AAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACrH,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAajD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAcjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}