webgpu-bench 0.2.0 → 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.
- package/README.md +4 -4
- package/dist/benchmarks/flopsConvert.d.ts +7 -6
- package/dist/benchmarks/flopsConvert.d.ts.map +1 -1
- package/dist/benchmarks/flopsConvert.js +10 -17
- package/dist/benchmarks/flopsConvert.js.map +1 -1
- package/dist/benchmarks/flopsF16.d.ts +1 -1
- package/dist/benchmarks/flopsF16.d.ts.map +1 -1
- package/dist/benchmarks/flopsF16.js +3 -3
- package/dist/benchmarks/flopsF16.js.map +1 -1
- package/dist/benchmarks/flopsF32.d.ts +1 -1
- package/dist/benchmarks/flopsF32.d.ts.map +1 -1
- package/dist/benchmarks/flopsF32.js +3 -3
- package/dist/benchmarks/flopsF32.js.map +1 -1
- package/dist/benchmarks/flopsI8.d.ts +2 -2
- package/dist/benchmarks/flopsI8.d.ts.map +1 -1
- package/dist/benchmarks/flopsI8.js +6 -6
- package/dist/benchmarks/flopsI8.js.map +1 -1
- package/dist/benchmarks/streamBandwidth.d.ts +6 -5
- package/dist/benchmarks/streamBandwidth.d.ts.map +1 -1
- package/dist/benchmarks/streamBandwidth.js +29 -12
- package/dist/benchmarks/streamBandwidth.js.map +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +14 -23
- package/dist/catalog.js.map +1 -1
- package/dist/shaders/flopsF16Vec4.d.ts +5 -4
- package/dist/shaders/flopsF16Vec4.d.ts.map +1 -1
- package/dist/shaders/flopsF16Vec4.js +46 -6
- package/dist/shaders/flopsF16Vec4.js.map +1 -1
- package/dist/shaders/flopsF32Div.d.ts +6 -3
- package/dist/shaders/flopsF32Div.d.ts.map +1 -1
- package/dist/shaders/flopsF32Div.js +37 -34
- package/dist/shaders/flopsF32Div.js.map +1 -1
- package/dist/shaders/flopsF32F16Convert.d.ts +3 -3
- package/dist/shaders/flopsF32F16Convert.js +3 -3
- package/dist/shaders/flopsF32Vec4.d.ts +8 -6
- package/dist/shaders/flopsF32Vec4.d.ts.map +1 -1
- package/dist/shaders/flopsF32Vec4.js +49 -8
- package/dist/shaders/flopsF32Vec4.js.map +1 -1
- package/dist/shaders/flopsI32Div.d.ts +5 -3
- package/dist/shaders/flopsI32Div.d.ts.map +1 -1
- package/dist/shaders/flopsI32Div.js +37 -35
- package/dist/shaders/flopsI32Div.js.map +1 -1
- package/dist/shaders/flopsI32F32Convert.d.ts +2 -2
- package/dist/shaders/flopsI32F32Convert.js +2 -2
- package/dist/shaders/flopsI8Dp4a.d.ts +8 -5
- package/dist/shaders/flopsI8Dp4a.d.ts.map +1 -1
- package/dist/shaders/flopsI8Dp4a.js +40 -9
- package/dist/shaders/flopsI8Dp4a.js.map +1 -1
- package/dist/shaders/flopsI8Vec4.d.ts +4 -4
- package/dist/shaders/flopsI8Vec4.d.ts.map +1 -1
- package/dist/shaders/flopsI8Vec4.js +45 -6
- package/dist/shaders/flopsI8Vec4.js.map +1 -1
- package/dist/shaders/flopsU32PackUnpack.d.ts +10 -8
- package/dist/shaders/flopsU32PackUnpack.d.ts.map +1 -1
- package/dist/shaders/flopsU32PackUnpack.js +49 -23
- package/dist/shaders/flopsU32PackUnpack.js.map +1 -1
- package/dist/shaders/streamRead.d.ts +9 -7
- package/dist/shaders/streamRead.d.ts.map +1 -1
- package/dist/shaders/streamRead.js +15 -17
- package/dist/shaders/streamRead.js.map +1 -1
- package/dist/shaders/streamWrite.d.ts +4 -5
- package/dist/shaders/streamWrite.d.ts.map +1 -1
- package/dist/shaders/streamWrite.js +10 -15
- package/dist/shaders/streamWrite.js.map +1 -1
- package/dist/suite.d.ts.map +1 -1
- package/dist/suite.js +1 -2
- package/dist/suite.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,17 +16,17 @@ bandwidth/FLOPS specs.
|
|
|
16
16
|
|
|
17
17
|
| Benchmark | What it tests |
|
|
18
18
|
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| `read-bandwidth` |
|
|
20
|
-
| `write-bandwidth` |
|
|
19
|
+
| `read-bandwidth` | Coalesced grid-stride loop (adjacent threads load adjacent `vec4<f32>`s, ~256K threads) folded with addition only, one scalar written per thread — a read-bandwidth-bound probe of peak storage-buffer read throughput |
|
|
20
|
+
| `write-bandwidth` | The same coalesced grid-stride loop storing computed `vec4<f32>` values with no buffer reads at all — a write-bandwidth-bound probe of peak storage-buffer write throughput |
|
|
21
21
|
| `flops-f32-scalar` | Raw fp32 FLOPS: eight _independent_ scalar FMA chains per thread, unrolled 4x, so the ALU always has work in flight (a single dependent chain would measure FMA latency + loop overhead, not throughput) |
|
|
22
|
-
| `flops-f32-vec4` |
|
|
22
|
+
| `flops-f32-vec4` | The same eight 4x-unrolled chains held in `vec4<f32>` registers. 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 |
|
|
23
23
|
| `flops-f32-mat4` | `x = m * x + c` chained with a `mat4x4<f32>` (a bounded contraction, so it stays numerically stable over any iteration count) |
|
|
24
24
|
| `flops-f32-matvec` | Register-resident matvec tile: a 4x8 f32 weight tile held in registers, applied to an 8-wide input every iteration via `dot()`, outputs feeding back as the next inputs. The dot-product-accumulate shape of a GEMV inner loop with zero buffer traffic |
|
|
25
25
|
| `flops-f16-scalar` / `-vec4` / `-mat4` / `-matvec` | The same four shapes, entirely in `f16` (skipped if the device lacks `shader-f16`) |
|
|
26
26
|
| `flops-i8-scalar` / `-vec4` / `-mat4` | The scalar / vec4 shapes on `i32` (WGSL has no first-class `i8` type), and a 4x4 integer matvec emulated as four `vec4<i32>` rows combined with `dot()` (WGSL has no `mat4x4<i32>`) |
|
|
27
27
|
| `flops-i8-matvec` | The register-resident matvec tile with int8-range weights/inputs held unpacked as `vec4<i32>` and integer `dot()` accumulation — the no-extension int8 path |
|
|
28
28
|
| `flops-i8-matvec-dp4a` | The same tile with weights/inputs kept packed four int8 lanes per `u32`, each 4-wide dot product a single `dot4I8Packed` (skipped without `packed_4x8_integer_dot_product`) |
|
|
29
|
-
| `flops-i8-dp4a` | `dot4I8Packed` accumulated in a tight loop to isolate the instruction's peak throughput (skipped without the feature)
|
|
29
|
+
| `flops-i8-dp4a` | `dot4I8Packed` accumulated into eight independent accumulators in a tight loop to isolate the instruction's peak throughput (skipped without the feature) |
|
|
30
30
|
|
|
31
31
|
The two bandwidth benchmarks stream the same deterministically-generated buffer (default 4096 ×
|
|
32
32
|
4096 f32, padded to a multiple of 4). The raw-FLOPS kernels' loop trip count and per-lane operands are
|
|
@@ -5,14 +5,15 @@ import type { PreparedBenchmark } from './common.ts';
|
|
|
5
5
|
* Bit-twiddling and type-conversion ops: what quantized/packed formats
|
|
6
6
|
* actually cost to get in and out of, as opposed to the flops-i8-* kernels
|
|
7
7
|
* (which measure compute once data is already unpacked into i32/u32
|
|
8
|
-
* registers). "Ops
|
|
8
|
+
* registers). "Ops" here count only the conversions themselves, one per
|
|
9
|
+
* direction per lane (an unpack or pack of a whole u32 counts as one), not
|
|
10
|
+
* the FMA / shifts / masks around them: the compiler folds and fuses those,
|
|
11
|
+
* so a source-level op count would overstate what executes.
|
|
9
12
|
*/
|
|
10
|
-
/** Manual (shift+mask) byte pack/unpack: no pack4x8 (or unpack4x8) builtin, just what those compile to. */
|
|
13
|
+
/** Manual (shift+mask) byte pack/unpack: no pack4x8 (or unpack4x8) builtin, just what those compile to. 2 ops per lane step (unpack + pack). */
|
|
11
14
|
export declare function prepareFlopsU32PackUnpack(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
12
|
-
/** i32<->f32 round-trip: convert, FMA, convert back —
|
|
15
|
+
/** i32<->f32 round-trip: convert, FMA, convert back — 2 ops per lane step (one convert each way). */
|
|
13
16
|
export declare function prepareFlopsI32F32Convert(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
14
|
-
/** fp32<->fp16 round-trip via pack2x16float/unpack2x16float — no shader-f16 feature needed. */
|
|
17
|
+
/** fp32<->fp16 round-trip via pack2x16float/unpack2x16float — no shader-f16 feature needed. Counted as 2 ops per lane round-trip (one convert each way). */
|
|
15
18
|
export declare function prepareFlopsF32F16Convert(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
16
|
-
/** i32<->f16 round-trip, chained through f32 (there's no native int<->f16 builtin). */
|
|
17
|
-
export declare function prepareFlopsI32F16Convert(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
18
19
|
//# sourceMappingURL=flopsConvert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsConvert.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsConvert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"flopsConvert.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsConvert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAIlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;GAQG;AAEH,gJAAgJ;AAChJ,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,UAAU,EACf,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED,qGAAqG;AACrG,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,UAAU,EACf,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED,4JAA4J;AAC5J,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,UAAU,EACf,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAW5B"}
|
|
@@ -2,46 +2,39 @@ import { prepareFlopsBenchmark } from "./flopsCommon.js";
|
|
|
2
2
|
import { flopsU32PackUnpackWgsl } from "../shaders/flopsU32PackUnpack.js";
|
|
3
3
|
import { flopsI32F32ConvertWgsl } from "../shaders/flopsI32F32Convert.js";
|
|
4
4
|
import { flopsF32F16ConvertWgsl } from "../shaders/flopsF32F16Convert.js";
|
|
5
|
-
import { flopsI32F16ConvertWgsl } from "../shaders/flopsI32F16Convert.js";
|
|
6
5
|
/**
|
|
7
6
|
* Bit-twiddling and type-conversion ops: what quantized/packed formats
|
|
8
7
|
* actually cost to get in and out of, as opposed to the flops-i8-* kernels
|
|
9
8
|
* (which measure compute once data is already unpacked into i32/u32
|
|
10
|
-
* registers). "Ops
|
|
9
|
+
* registers). "Ops" here count only the conversions themselves, one per
|
|
10
|
+
* direction per lane (an unpack or pack of a whole u32 counts as one), not
|
|
11
|
+
* the FMA / shifts / masks around them: the compiler folds and fuses those,
|
|
12
|
+
* so a source-level op count would overstate what executes.
|
|
11
13
|
*/
|
|
12
|
-
/** Manual (shift+mask) byte pack/unpack: no pack4x8 (or unpack4x8) builtin, just what those compile to. */
|
|
14
|
+
/** Manual (shift+mask) byte pack/unpack: no pack4x8 (or unpack4x8) builtin, just what those compile to. 2 ops per lane step (unpack + pack). */
|
|
13
15
|
export function prepareFlopsU32PackUnpack(ctx, harness = {}) {
|
|
14
16
|
return prepareFlopsBenchmark(ctx, {
|
|
15
17
|
id: 'flops-u32-packunpack',
|
|
16
18
|
wgsl: flopsU32PackUnpackWgsl,
|
|
17
|
-
flopsPerIteration:
|
|
19
|
+
flopsPerIteration: 64,
|
|
18
20
|
defaultIterations: 256,
|
|
19
21
|
}, harness);
|
|
20
22
|
}
|
|
21
|
-
/** i32<->f32 round-trip: convert, FMA, convert back —
|
|
23
|
+
/** i32<->f32 round-trip: convert, FMA, convert back — 2 ops per lane step (one convert each way). */
|
|
22
24
|
export function prepareFlopsI32F32Convert(ctx, harness = {}) {
|
|
23
25
|
return prepareFlopsBenchmark(ctx, {
|
|
24
26
|
id: 'flops-i32-f32-convert',
|
|
25
27
|
wgsl: flopsI32F32ConvertWgsl,
|
|
26
|
-
flopsPerIteration:
|
|
28
|
+
flopsPerIteration: 64,
|
|
27
29
|
defaultIterations: 256,
|
|
28
30
|
}, harness);
|
|
29
31
|
}
|
|
30
|
-
/** fp32<->fp16 round-trip via pack2x16float/unpack2x16float — no shader-f16 feature needed. */
|
|
32
|
+
/** fp32<->fp16 round-trip via pack2x16float/unpack2x16float — no shader-f16 feature needed. Counted as 2 ops per lane round-trip (one convert each way). */
|
|
31
33
|
export function prepareFlopsF32F16Convert(ctx, harness = {}) {
|
|
32
34
|
return prepareFlopsBenchmark(ctx, {
|
|
33
35
|
id: 'flops-f32-f16-convert',
|
|
34
36
|
wgsl: flopsF32F16ConvertWgsl,
|
|
35
|
-
flopsPerIteration:
|
|
36
|
-
defaultIterations: 256,
|
|
37
|
-
}, harness);
|
|
38
|
-
}
|
|
39
|
-
/** i32<->f16 round-trip, chained through f32 (there's no native int<->f16 builtin). */
|
|
40
|
-
export function prepareFlopsI32F16Convert(ctx, harness = {}) {
|
|
41
|
-
return prepareFlopsBenchmark(ctx, {
|
|
42
|
-
id: 'flops-i32-f16-convert',
|
|
43
|
-
wgsl: flopsI32F16ConvertWgsl,
|
|
44
|
-
flopsPerIteration: 192,
|
|
37
|
+
flopsPerIteration: 128,
|
|
45
38
|
defaultIterations: 256,
|
|
46
39
|
}, harness);
|
|
47
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsConvert.js","sourceRoot":"","sources":["../../src/benchmarks/flopsConvert.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM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@ -3,7 +3,7 @@ import { type FlopsHarnessConfig } from './flopsCommon.ts';
|
|
|
3
3
|
import type { PreparedBenchmark } from './common.ts';
|
|
4
4
|
/** Raw fp16 FLOPS: eight independent scalar f16 FMA chains per thread, unrolled 4x. */
|
|
5
5
|
export declare function prepareFlopsF16Scalar(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
6
|
-
/** fp16 vec4 FLOPS:
|
|
6
|
+
/** fp16 vec4 FLOPS: eight independent vec4<f16> FMA chains, unrolled 4x (same shape as scalar). */
|
|
7
7
|
export declare function prepareFlopsF16Vec4(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
8
8
|
/** fp16 mat4 FLOPS: x = m*x + c chained with a mat4x4<f16>. */
|
|
9
9
|
export declare function prepareFlopsF16Mat4(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsF16.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsF16.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAYnH;AAED,
|
|
1
|
+
{"version":3,"file":"flopsF16.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsF16.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAYnH;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAYjH;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAYjH;AAED,wGAAwG;AACxG,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAYnH"}
|
|
@@ -13,13 +13,13 @@ export function prepareFlopsF16Scalar(ctx, harness = {}) {
|
|
|
13
13
|
requiresF16: true,
|
|
14
14
|
}, harness);
|
|
15
15
|
}
|
|
16
|
-
/** fp16 vec4 FLOPS:
|
|
16
|
+
/** fp16 vec4 FLOPS: eight independent vec4<f16> FMA chains, unrolled 4x (same shape as scalar). */
|
|
17
17
|
export function prepareFlopsF16Vec4(ctx, harness = {}) {
|
|
18
18
|
return prepareFlopsBenchmark(ctx, {
|
|
19
19
|
id: 'flops-f16-vec4',
|
|
20
20
|
wgsl: flopsF16Vec4Wgsl,
|
|
21
|
-
flopsPerIteration:
|
|
22
|
-
defaultIterations:
|
|
21
|
+
flopsPerIteration: 256,
|
|
22
|
+
defaultIterations: 256,
|
|
23
23
|
requiresF16: true,
|
|
24
24
|
}, harness);
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsF16.js","sourceRoot":"","sources":["../../src/benchmarks/flopsF16.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,O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EACH;QACE,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,gBAAgB;QACtB,iBAAiB,EAAE,GAAG;QACtB,iBAAiB,EAAE,GAAG;QACtB,WAAW,EAAE,IAAI;KAClB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,mBAAmB,CAAC,GAAe,EAAE,UAA8B,EAAE;IACnF,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,gBAAgB;QACtB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,IAAI;QACvB,WAAW,EAAE,IAAI;KAClB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,wGAAwG;AACxG,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;QACtB,WAAW,EAAE,IAAI;KAClB,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { type FlopsHarnessConfig } from './flopsCommon.ts';
|
|
|
3
3
|
import type { PreparedBenchmark } from './common.ts';
|
|
4
4
|
/** Raw fp32 FLOPS: eight independent scalar FMA chains per thread, unrolled 4x. */
|
|
5
5
|
export declare function prepareFlopsF32Scalar(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
6
|
-
/** fp32 vec4 FLOPS:
|
|
6
|
+
/** fp32 vec4 FLOPS: eight independent vec4<f32> FMA chains, unrolled 4x (same shape as scalar). */
|
|
7
7
|
export declare function prepareFlopsF32Vec4(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
8
8
|
/** fp32 mat4 FLOPS: x = m*x + c chained with a mat4x4<f32>. */
|
|
9
9
|
export declare function prepareFlopsF32Mat4(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsF32.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsF32.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWnH;AAED,
|
|
1
|
+
{"version":3,"file":"flopsF32.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsF32.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWnH;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWjH;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWjH;AAED,oGAAoG;AACpG,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWnH"}
|
|
@@ -12,13 +12,13 @@ export function prepareFlopsF32Scalar(ctx, harness = {}) {
|
|
|
12
12
|
defaultIterations: 256,
|
|
13
13
|
}, harness);
|
|
14
14
|
}
|
|
15
|
-
/** fp32 vec4 FLOPS:
|
|
15
|
+
/** fp32 vec4 FLOPS: eight independent vec4<f32> FMA chains, unrolled 4x (same shape as scalar). */
|
|
16
16
|
export function prepareFlopsF32Vec4(ctx, harness = {}) {
|
|
17
17
|
return prepareFlopsBenchmark(ctx, {
|
|
18
18
|
id: 'flops-f32-vec4',
|
|
19
19
|
wgsl: flopsF32Vec4Wgsl,
|
|
20
|
-
flopsPerIteration:
|
|
21
|
-
defaultIterations:
|
|
20
|
+
flopsPerIteration: 256,
|
|
21
|
+
defaultIterations: 256,
|
|
22
22
|
}, harness);
|
|
23
23
|
}
|
|
24
24
|
/** fp32 mat4 FLOPS: x = m*x + c chained with a mat4x4<f32>. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsF32.js","sourceRoot":"","sources":["../../src/benchmarks/flopsF32.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,mFAAmF;AACnF,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,C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G,EACH;QACE,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,kBAAkB;QACxB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { type FlopsHarnessConfig } from './flopsCommon.ts';
|
|
|
3
3
|
import type { PreparedBenchmark } from './common.ts';
|
|
4
4
|
/** Raw int8-range FLOPS: eight independent scalar i32 multiply-add chains per thread, unrolled 4x. */
|
|
5
5
|
export declare function prepareFlopsI8Scalar(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
6
|
-
/** int8-range vec4 FLOPS:
|
|
6
|
+
/** int8-range vec4 FLOPS: eight independent vec4<i32> multiply-add chains, unrolled 4x (same shape as scalar). */
|
|
7
7
|
export declare function prepareFlopsI8Vec4(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
8
8
|
/** int8-range mat4 FLOPS: a 4x4 integer matvec emulated via four dot(vec4<i32>) calls (WGSL has no mat4x4<i32>). */
|
|
9
9
|
export declare function prepareFlopsI8Mat4(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
@@ -11,6 +11,6 @@ export declare function prepareFlopsI8Mat4(ctx: GpuContext, harness?: FlopsHarne
|
|
|
11
11
|
export declare function prepareFlopsI8Matvec(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
12
12
|
/** int8 register-resident matvec tile on packed u32 words, two dot4I8Packed calls per output row. */
|
|
13
13
|
export declare function prepareFlopsI8MatvecDp4a(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
14
|
-
/** int8 packed-dot-product FLOPS: dot4I8Packed from the packed_4x8_integer_dot_product extension, run in a tight accumulation loop. */
|
|
14
|
+
/** int8 packed-dot-product FLOPS: dot4I8Packed from the packed_4x8_integer_dot_product extension, run in a tight accumulation loop over eight independent accumulators. */
|
|
15
15
|
export declare function prepareFlopsI8Dp4a(ctx: GpuContext, harness?: FlopsHarnessConfig): Promise<PreparedBenchmark>;
|
|
16
16
|
//# sourceMappingURL=flopsI8.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsI8.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsI8.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWlH;AAED,
|
|
1
|
+
{"version":3,"file":"flopsI8.d.ts","sourceRoot":"","sources":["../../src/benchmarks/flopsI8.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWlH;AAED,kHAAkH;AAClH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWhH;AAED,oHAAoH;AACpH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWhH;AAED,qHAAqH;AACrH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWlH;AAED,qGAAqG;AACrG,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,UAAU,EACf,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAY5B;AAED,2KAA2K;AAC3K,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAYhH"}
|
|
@@ -14,13 +14,13 @@ export function prepareFlopsI8Scalar(ctx, harness = {}) {
|
|
|
14
14
|
defaultIterations: 256,
|
|
15
15
|
}, harness);
|
|
16
16
|
}
|
|
17
|
-
/** int8-range vec4 FLOPS:
|
|
17
|
+
/** int8-range vec4 FLOPS: eight independent vec4<i32> multiply-add chains, unrolled 4x (same shape as scalar). */
|
|
18
18
|
export function prepareFlopsI8Vec4(ctx, harness = {}) {
|
|
19
19
|
return prepareFlopsBenchmark(ctx, {
|
|
20
20
|
id: 'flops-i8-vec4',
|
|
21
21
|
wgsl: flopsI8Vec4Wgsl,
|
|
22
|
-
flopsPerIteration:
|
|
23
|
-
defaultIterations:
|
|
22
|
+
flopsPerIteration: 256,
|
|
23
|
+
defaultIterations: 256,
|
|
24
24
|
}, harness);
|
|
25
25
|
}
|
|
26
26
|
/** int8-range mat4 FLOPS: a 4x4 integer matvec emulated via four dot(vec4<i32>) calls (WGSL has no mat4x4<i32>). */
|
|
@@ -51,13 +51,13 @@ export function prepareFlopsI8MatvecDp4a(ctx, harness = {}) {
|
|
|
51
51
|
requiresI8Dot: true,
|
|
52
52
|
}, harness);
|
|
53
53
|
}
|
|
54
|
-
/** int8 packed-dot-product FLOPS: dot4I8Packed from the packed_4x8_integer_dot_product extension, run in a tight accumulation loop. */
|
|
54
|
+
/** int8 packed-dot-product FLOPS: dot4I8Packed from the packed_4x8_integer_dot_product extension, run in a tight accumulation loop over eight independent accumulators. */
|
|
55
55
|
export function prepareFlopsI8Dp4a(ctx, harness = {}) {
|
|
56
56
|
return prepareFlopsBenchmark(ctx, {
|
|
57
57
|
id: 'flops-i8-dp4a',
|
|
58
58
|
wgsl: flopsI8Dp4aWgsl,
|
|
59
|
-
flopsPerIteration:
|
|
60
|
-
defaultIterations:
|
|
59
|
+
flopsPerIteration: 64,
|
|
60
|
+
defaultIterations: 256,
|
|
61
61
|
requiresI8Dot: true,
|
|
62
62
|
}, harness);
|
|
63
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flopsI8.js","sourceRoot":"","sources":["../../src/benchmarks/flopsI8.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,sGAAsG;AACtG,MAAM,UAAU,oBAAoB,CAAC,GAAe,EAAE,UAA8B,EAAE;IACpF,OAAO,qBAAqB,CAC1B,GAAG,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,
|
|
1
|
+
{"version":3,"file":"flopsI8.js","sourceRoot":"","sources":["../../src/benchmarks/flopsI8.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EA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AE,EAAE;QACrB,iBAAiB,EAAE,GAAG;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,wBAAwB,CACtC,GAAe,EACf,UAA8B,EAAE;IAEhC,OAAO,qBAAqB,CAC1B,GAAG,EACH;QACE,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,GAAG;QACtB,aAAa,EAAE,IAAI;KACpB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,2KAA2K;AAC3K,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;QACtB,aAAa,EAAE,IAAI;KACpB,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
|
|
7
|
-
* single scalar per thread. Reads vastly outweigh writes, so
|
|
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
|
|
14
|
-
* write-bandwidth-bound number close to the
|
|
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,EAA0C,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
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"}
|
|
@@ -2,19 +2,35 @@ import { createUniformBuffer, createStorageBuffer, createEmptyStorageBuffer } fr
|
|
|
2
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
|
|
8
|
-
* single scalar per thread. Reads vastly outweigh writes, so
|
|
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
|
|
29
|
+
const { count, threads, workgroups } = bandwidthShape(data);
|
|
14
30
|
const pipeline = await createPipeline(device, 'stream-read', streamReadWgsl);
|
|
15
|
-
const paramsBuf = createUniformBuffer(device, new Uint32Array([
|
|
31
|
+
const paramsBuf = createUniformBuffer(device, new Uint32Array([count, threads]), 'params');
|
|
16
32
|
const dataBuf = createStorageBuffer(device, data.matrix, 'data');
|
|
17
|
-
const outBuf = createEmptyStorageBuffer(device,
|
|
33
|
+
const outBuf = createEmptyStorageBuffer(device, threads * 4, 'out');
|
|
18
34
|
const bindGroup = device.createBindGroup({
|
|
19
35
|
layout: pipeline.getBindGroupLayout(0),
|
|
20
36
|
entries: [
|
|
@@ -30,7 +46,7 @@ export async function prepareReadBandwidth(ctx, data, harness = {}) {
|
|
|
30
46
|
rows: data.rows,
|
|
31
47
|
cols: data.cols,
|
|
32
48
|
amountPerOp: data.matrix.byteLength,
|
|
33
|
-
workgroupsPerIteration: [
|
|
49
|
+
workgroupsPerIteration: [workgroups, 1, 1],
|
|
34
50
|
pipeline,
|
|
35
51
|
bindGroup,
|
|
36
52
|
...harness,
|
|
@@ -38,14 +54,15 @@ export async function prepareReadBandwidth(ctx, data, harness = {}) {
|
|
|
38
54
|
}
|
|
39
55
|
/**
|
|
40
56
|
* Write-bandwidth test: streams computed values out into a matrix-sized
|
|
41
|
-
* output buffer
|
|
42
|
-
* write-bandwidth-bound number close to the
|
|
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.
|
|
43
60
|
*/
|
|
44
61
|
export async function prepareWriteBandwidth(ctx, data, harness = {}) {
|
|
45
62
|
const { device } = ctx;
|
|
46
|
-
const
|
|
63
|
+
const { count, threads, workgroups } = bandwidthShape(data);
|
|
47
64
|
const pipeline = await createPipeline(device, 'stream-write', streamWriteWgsl);
|
|
48
|
-
const paramsBuf = createUniformBuffer(device, new Uint32Array([
|
|
65
|
+
const paramsBuf = createUniformBuffer(device, new Uint32Array([count, threads]), 'params');
|
|
49
66
|
const outBuf = createEmptyStorageBuffer(device, data.matrix.byteLength, 'out');
|
|
50
67
|
const bindGroup = device.createBindGroup({
|
|
51
68
|
layout: pipeline.getBindGroupLayout(0),
|
|
@@ -61,7 +78,7 @@ export async function prepareWriteBandwidth(ctx, data, harness = {}) {
|
|
|
61
78
|
rows: data.rows,
|
|
62
79
|
cols: data.cols,
|
|
63
80
|
amountPerOp: data.matrix.byteLength,
|
|
64
|
-
workgroupsPerIteration: [
|
|
81
|
+
workgroupsPerIteration: [workgroups, 1, 1],
|
|
65
82
|
pipeline,
|
|
66
83
|
bindGroup,
|
|
67
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,EAAE,cAAc,EAAE,sBAAsB,EAA8C,MAAM,aAAa,CAAC;AACjH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAAe,EACf,IAAmB,EACnB,UAAyB,EAAE;IAE3B,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACvB,MAAM,KAAK,GAAG,
|
|
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,EAAE,cAAc,EAAE,sBAAsB,EAA8C,MAAM,aAAa,CAAC;AACjH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;A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,CAAC,CAAC,CAAC;QACtC,OAAO,EAAE;YACP,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;YAC/C,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;SAC7C;KACF,CAAC,CAAC;IAEH,OAAO,sBAAsB,CAAC;QAC5B,EAAE,EAAE,iBAAiB;QACrB,QAAQ,EAAE,WAAW;QACrB,GAAG;QACH,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,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.map
CHANGED
|
@@ -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;
|
|
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
|
@@ -25,7 +25,6 @@ import { flopsF32LogWgsl } from "./shaders/flopsF32Log.js";
|
|
|
25
25
|
import { flopsU32PackUnpackWgsl } from "./shaders/flopsU32PackUnpack.js";
|
|
26
26
|
import { flopsI32F32ConvertWgsl } from "./shaders/flopsI32F32Convert.js";
|
|
27
27
|
import { flopsF32F16ConvertWgsl } from "./shaders/flopsF32F16Convert.js";
|
|
28
|
-
import { flopsI32F16ConvertWgsl } from "./shaders/flopsI32F16Convert.js";
|
|
29
28
|
/**
|
|
30
29
|
* Every benchmark `runSuite` can yield a row for, in the same order it
|
|
31
30
|
* schedules them — so a UI can render the full results table (id, label,
|
|
@@ -43,7 +42,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
43
42
|
{
|
|
44
43
|
id: 'read-bandwidth',
|
|
45
44
|
label: 'Read bandwidth',
|
|
46
|
-
description: '
|
|
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.',
|
|
47
46
|
source: streamReadWgsl,
|
|
48
47
|
category: 'bandwidth',
|
|
49
48
|
metric: BYTES_METRIC,
|
|
@@ -51,7 +50,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
51
50
|
{
|
|
52
51
|
id: 'write-bandwidth',
|
|
53
52
|
label: 'Write bandwidth',
|
|
54
|
-
description: '
|
|
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.',
|
|
55
54
|
source: streamWriteWgsl,
|
|
56
55
|
category: 'bandwidth',
|
|
57
56
|
metric: BYTES_METRIC,
|
|
@@ -67,7 +66,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
67
66
|
{
|
|
68
67
|
id: 'flops-f32-vec4',
|
|
69
68
|
label: 'fp32 vec4 FLOPS',
|
|
70
|
-
description: '
|
|
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.',
|
|
71
70
|
source: flopsF32Vec4Wgsl,
|
|
72
71
|
category: 'compute',
|
|
73
72
|
metric: FLOPS_METRIC,
|
|
@@ -99,7 +98,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
99
98
|
{
|
|
100
99
|
id: 'flops-f16-vec4',
|
|
101
100
|
label: 'fp16 vec4 FLOPS',
|
|
102
|
-
description: 'Same
|
|
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.',
|
|
103
102
|
source: flopsF16Vec4Wgsl,
|
|
104
103
|
category: 'compute',
|
|
105
104
|
metric: FLOPS_METRIC,
|
|
@@ -131,7 +130,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
131
130
|
{
|
|
132
131
|
id: 'flops-i8-vec4',
|
|
133
132
|
label: 'int8-range vec4 FLOPS',
|
|
134
|
-
description: 'Same
|
|
133
|
+
description: 'Same eight 4x-unrolled vec4 multiply-add chains as the fp32 vec4 test, but in vec4<i32>.',
|
|
135
134
|
source: flopsI8Vec4Wgsl,
|
|
136
135
|
category: 'compute',
|
|
137
136
|
metric: OPS_METRIC,
|
|
@@ -163,7 +162,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
163
162
|
{
|
|
164
163
|
id: 'flops-i8-dp4a',
|
|
165
164
|
label: 'int8 dot4I8Packed FLOPS',
|
|
166
|
-
description: "
|
|
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.",
|
|
167
166
|
source: flopsI8Dp4aWgsl,
|
|
168
167
|
category: 'compute',
|
|
169
168
|
metric: OPS_METRIC,
|
|
@@ -171,7 +170,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
171
170
|
{
|
|
172
171
|
id: 'flops-f32-div',
|
|
173
172
|
label: 'fp32 div FLOPS',
|
|
174
|
-
description: 'Eight independent scalar f32
|
|
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.',
|
|
175
174
|
source: flopsF32DivWgsl,
|
|
176
175
|
category: 'compute',
|
|
177
176
|
metric: FLOPS_METRIC,
|
|
@@ -179,7 +178,7 @@ export const BENCHMARK_CATALOG = [
|
|
|
179
178
|
{
|
|
180
179
|
id: 'flops-i32-div',
|
|
181
180
|
label: 'i32 div FLOPS',
|
|
182
|
-
description: 'Eight independent scalar i32
|
|
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.',
|
|
183
182
|
source: flopsI32DivWgsl,
|
|
184
183
|
category: 'compute',
|
|
185
184
|
metric: OPS_METRIC,
|
|
@@ -226,35 +225,27 @@ export const BENCHMARK_CATALOG = [
|
|
|
226
225
|
},
|
|
227
226
|
{
|
|
228
227
|
id: 'flops-u32-packunpack',
|
|
229
|
-
label: 'u32 byte pack/unpack
|
|
230
|
-
description: 'Eight independent u32 lanes, each step unpacking 4 bytes via shift+mask, incrementing them, and repacking
|
|
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.',
|
|
231
230
|
source: flopsU32PackUnpackWgsl,
|
|
232
231
|
category: 'compute',
|
|
233
232
|
metric: OPS_METRIC,
|
|
234
233
|
},
|
|
235
234
|
{
|
|
236
235
|
id: 'flops-i32-f32-convert',
|
|
237
|
-
label: 'i32<->f32 convert
|
|
238
|
-
description: 'Eight independent chains per thread, unrolled 4x: xi -> f32(xi)*a+b -> back to i32 each step.
|
|
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).',
|
|
239
238
|
source: flopsI32F32ConvertWgsl,
|
|
240
239
|
category: 'compute',
|
|
241
240
|
metric: OPS_METRIC,
|
|
242
241
|
},
|
|
243
242
|
{
|
|
244
243
|
id: 'flops-f32-f16-convert',
|
|
245
|
-
label: 'f32<->f16 convert
|
|
246
|
-
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. Unlike flops-f16-*, this needs no shader-f16 device feature — it measures the conversion, not f16 compute.',
|
|
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.',
|
|
247
246
|
source: flopsF32F16ConvertWgsl,
|
|
248
247
|
category: 'compute',
|
|
249
248
|
metric: OPS_METRIC,
|
|
250
249
|
},
|
|
251
|
-
{
|
|
252
|
-
id: 'flops-i32-f16-convert',
|
|
253
|
-
label: 'i32<->f16 convert FLOPS',
|
|
254
|
-
description: 'Eight independent i32 chains per thread, unrolled 4x: xi -> f32 -> pack2x16float -> unpack2x16float -> f32*a+b -> i32. There is no native int<->f16 conversion, so this is what the real path (through f32) costs.',
|
|
255
|
-
source: flopsI32F16ConvertWgsl,
|
|
256
|
-
category: 'compute',
|
|
257
|
-
metric: OPS_METRIC,
|
|
258
|
-
},
|
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