Skip to content

migrate to rustc's FxHasher#16

Merged
enthropy7 merged 1 commit into
enthropy7:mainfrom
Human9000-bit:faster-hashing
Jul 11, 2026
Merged

migrate to rustc's FxHasher#16
enthropy7 merged 1 commit into
enthropy7:mainfrom
Human9000-bit:faster-hashing

Conversation

@Human9000-bit

Copy link
Copy Markdown
Collaborator

std::collections hashling algo is cryptographic and randomised; we do not need this. Let's migrate to rustc's FxHasher, since it is cheaper in terms of compute

@Human9000-bit

Copy link
Copy Markdown
Collaborator Author

/bench

@github-actions

Copy link
Copy Markdown

ONNX CPU benchmark

GitHub-hosted runner signal, advisory only. Base and head are compared within the same architecture job.

arch case base p50 head p50 delta
x86_64 gemm_relu_256x512x512 922 us 935 us +1.4% slower
x86_64 small_conv_relu_64 447 us 458 us +2.5% slower
x86_64 small_dw_pw_64 133 us 133 us +0.0% flat
x86_64 small_gemm_relu_1x128 11 us 11 us +0.0% flat
x86_64 small_residual_conv_64 706 us 663 us -6.1% faster
x86_64 winograd_3x3_20x20_c256 5.13 ms 5.12 ms -0.1% flat
x86_64 winograd_3x3_80x80_c64 5.94 ms 5.91 ms -0.5% flat
x86_64 yolo11n_bus_640 69.94 ms 69.79 ms -0.2% flat
x86_64 yolov8n_bus_640 76.72 ms 75.96 ms -1.0% flat

Head op/kernel summary

arch case ops dispatched kernels
x86_64 gemm_relu_256x512x512 Gemm x1, Relu x1 Gemm via blocked-mr4 x1
x86_64 small_conv_relu_64 Conv_Relu x1 Conv_Relu via nhwc-padded/winograd-3x3 x1
x86_64 small_dw_pw_64 FusedDwPw x1 -
x86_64 small_gemm_relu_1x128 Gemm x1, Relu x1 Gemm via row-gemm x1
x86_64 small_residual_conv_64 Conv_Add_Relu x1 Conv_Add_Relu via nhwc-padded/winograd-3x3 x1
x86_64 winograd_3x3_20x20_c256 Conv_Relu x1 Conv_Relu via nhwc-padded/winograd-3x3 x1
x86_64 winograd_3x3_80x80_c64 Conv_Relu x1 Conv_Relu via nhwc-padded/winograd-3x3 x1
x86_64 yolo11n_bus_640 Conv x85, Mul x83, Sigmoid x78, Concat x39, Add x22, Reshape x17, +18 more Conv via nhwc-padded/winograd-3x3 x28, Conv via nhwc-gemm-prepacked/pw-gemm x24, Conv via nhwc-gemm-prepacked/pw-nx16-direct x20, Conv via dw-nhwc-padded/dw-avx512 x6, Conv via nhwc-padded/im2col-gemm x6, MatMul via blocked-mr4 x2, +2 more
x86_64 yolov8n_bus_640 Conv x64, Mul x61, Sigmoid x58, Concat x33, Add x17, Reshape x14, +15 more Conv via nhwc-padded/winograd-3x3 x32, Conv via nhwc-gemm-prepacked/pw-gemm x17, Conv via nhwc-gemm-prepacked/pw-nx16-direct x8, Conv via nhwc-padded/im2col-gemm x6, Conv via nhwc-padded/first-layer-rgb x1

Missing paired result(s): aarch64/gemm_relu_256x512x512, aarch64/small_conv_relu_64, aarch64/small_dw_pw_64, aarch64/small_gemm_relu_1x128, aarch64/small_residual_conv_64, aarch64/winograd_3x3_20x20_c256, aarch64/winograd_3x3_80x80_c64, aarch64/yolo11n_bus_640, aarch64/yolov8n_bus_640

Raw JSON artifacts include per-run min/p50/avg/p95/p99, optimized node counts, yscv CPU dispatch report, and per-node runner profile summaries.

@Human9000-bit Human9000-bit force-pushed the faster-hashing branch 2 times, most recently from 24c8ad8 to aabfde4 Compare July 10, 2026 19:26
@github-actions

Copy link
Copy Markdown

ONNX CPU benchmark

GitHub-hosted runner signal, advisory only. Base and head are compared within the same architecture job.

arch case base p50 head p50 delta
x86_64 gemm_relu_256x512x512 1.00 ms 1.01 ms +0.6% flat
x86_64 small_conv_relu_64 408 us 413 us +1.2% slower
x86_64 small_dw_pw_64 147 us 144 us -2.0% faster
x86_64 small_gemm_relu_1x128 7 us 7 us +0.0% flat
x86_64 small_residual_conv_64 459 us 440 us -4.1% faster
x86_64 winograd_3x3_20x20_c256 5.52 ms 5.53 ms +0.2% flat
x86_64 winograd_3x3_80x80_c64 6.64 ms 6.58 ms -0.8% flat
x86_64 yolo11n_bus_640 92.90 ms 94.29 ms +1.5% slower
x86_64 yolov8n_bus_640 102.09 ms 101.68 ms -0.4% flat

Head op/kernel summary

arch case ops dispatched kernels
x86_64 gemm_relu_256x512x512 Gemm x1, Relu x1 Gemm via blocked-mr4 x1
x86_64 small_conv_relu_64 Conv_Relu x1 Conv_Relu via nhwc-padded/winograd-3x3 x1
x86_64 small_dw_pw_64 FusedDwPw x1 -
x86_64 small_gemm_relu_1x128 Gemm x1, Relu x1 Gemm via row-gemm x1
x86_64 small_residual_conv_64 Conv_Add_Relu x1 Conv_Add_Relu via nhwc-padded/winograd-3x3 x1
x86_64 winograd_3x3_20x20_c256 Conv_Relu x1 Conv_Relu via nhwc-padded/winograd-3x3 x1
x86_64 winograd_3x3_80x80_c64 Conv_Relu x1 Conv_Relu via nhwc-padded/winograd-3x3 x1
x86_64 yolo11n_bus_640 Conv x85, Mul x83, Sigmoid x78, Concat x39, Add x22, Reshape x17, +18 more Conv via nhwc-padded/winograd-3x3 x28, Conv via nhwc-gemm-prepacked/pw-gemm x24, Conv via nhwc-gemm-prepacked/pw-nx16-direct x20, Conv via dw-nhwc-padded/dw-avx-fma x6, Conv via nhwc-padded/im2col-gemm x6, MatMul via blocked-mr4 x2, +2 more
x86_64 yolov8n_bus_640 Conv x64, Mul x61, Sigmoid x58, Concat x33, Add x17, Reshape x14, +15 more Conv via nhwc-padded/winograd-3x3 x32, Conv via nhwc-gemm-prepacked/pw-gemm x17, Conv via nhwc-gemm-prepacked/pw-nx16-direct x8, Conv via nhwc-padded/im2col-gemm x6, Conv via nhwc-padded/first-layer-rgb x1

Missing paired result(s): aarch64/gemm_relu_256x512x512, aarch64/small_conv_relu_64, aarch64/small_dw_pw_64, aarch64/small_gemm_relu_1x128, aarch64/small_residual_conv_64, aarch64/winograd_3x3_20x20_c256, aarch64/winograd_3x3_80x80_c64, aarch64/yolo11n_bus_640, aarch64/yolov8n_bus_640

Raw JSON artifacts include per-run min/p50/avg/p95/p99, optimized node counts, yscv CPU dispatch report, and per-node runner profile summaries.

@Human9000-bit Human9000-bit force-pushed the faster-hashing branch 3 times, most recently from b343b1b to cbd1c0c Compare July 11, 2026 09:04
@enthropy7 enthropy7 merged commit f364661 into enthropy7:main Jul 11, 2026
4 of 6 checks passed
enthropy7 added a commit that referenced this pull request Jul 11, 2026
Revert e3cffe0 — put FxHashMap back across the public API of
yscv-model/pipeline/video/onnx and restore rustc-hash as a dependency of
the three crates, for one consistent map type across the codebase (the
original #16 design). Speed is unchanged: the reverted maps were all cold
boundaries (once-per-inference outputs, per-epoch metrics, parsed-once
configs), so this is purely a consistency choice.

Also migrate the metal-backend examples that still built std HashMap
inputs (yolo_vis, debug_metal_yolo, bench_metal_yolo, bench_metal_vball,
bench_mpsgraph) to FxHashMap with the proper import. Several were already
broken under the macOS metal-backend CI job (E0433 missing import / E0308
once run_onnx_model's parameter is a concrete FxHashMap again).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants