Hitting 25.36 GH/s on RTX 5090: Beating Closed-Source Blackwell Assembly by 20%+ with an Open-Source SASS Stack
secp256k1 Pollard's Kangaroo · cubit + blackwell-isa · zero nvcc/ptxas · 0 OPEX errors · +26.74% iso-clock on RTX PRO 6000
01 Why Open-Source SASS Beat Proprietary Assembly
For elliptic-curve discrete logarithm solving (ECDLP) on secp256k1 via Pollard's Kangaroo, RetiredCoder's RCKangaroo v4.0 (SOTA v2, K = 1.15) has stood as the undisputed benchmark on NVIDIA GPUs. Its SM120 binary (kernel_sm120.cubin) was hand-assembled with a closed-source assembler (RCAsm) and widely treated as the practical ceiling of Blackwell's integer pipeline.
Using our open-source Blackwell toolchain — blackwell-isa (164,759 machine-readable encoding variants across SM120/SM103a/SM100a/SM121a, SM120 100.00% measured) and cubit (a Rust SASS assembler compiling standalone ELF .cubins directly without nvcc or ptxas) — we rebuilt the entire SM120 Kangaroo stack from scratch. Because programmatic Python generators emitting verified cubit SASS let us test hundreds of microarchitectural schedules in minutes, we uncovered silicon laws, scheduler phase locks, inverter spin-convoys, and a power-capped L2 cliff that black-box hand assembly cannot easily see.
- 100% Drop-in Replacement (
kernel_sm120_stage10_5090.cubin): Drops directly into unmodified./rckangaroov4.0 (BS=256, GS=24, inv=7). Delivers +21.76% iso-clock, +19.4% Boost, +18.9% Steady @ 600 W, and 22,475 MKeys/s live (+18.3%) on RTX 5090 — plus +22.05% iso-clock on RTX PRO 6000 — while eliminating all 171 illegal OPEX encodings present in RC's cubin. - Full-Stack Co-Designed Solver (
rckangaroo_5090_full& Track B v2): Combines our SM120 SASS arithmetic with a dedicated 2-streamKernelInv, Compact-C L2 + shifted persisting L2 window, 100% bit-exactKernelB_turbo, and a 2-in-flight double-buffered async host DP pipeline — hitting 25.36 GH/s cool Boost (25.17 GH/s 3-rd avg, +21.1%), 23.48 GH/s Steady @ 600 W (+20.5%), and 23,130–23,368 MKeys/s live (+21.8%, +4.13 GH/s live over RC) on RTX 5090, and +26.74% iso-clock on RTX PRO 6000.
02 Complete Benchmark Results
All runs were measured in counter-ordered interleaved A/B/C/D/E series (sleep 2 between runs on thermally warmed cards) so boost clocks and thermal drift cannot bias any comparison.
-dp 14 ECDLP solving.| Configuration (RTX 5090, 600 W) | Iso 2400 MHz | 600 W Boost | 600 W Steady | Live -dp 14 | vs RC (St / Live) | OPEX |
|---|---|---|---|---|---|---|
RetiredCoder v4.0 (inv=7) |
17.71 / 18.22 | 20.78 / 21.43 | 19.48 / 20.05 | 18,998 MKeys/s | baseline | 171 |
| Stage 9 v3 (cubit drop-in, 56w convoy) | 19.17 / 19.77 | 21.93 / 22.65 | 21.00 / 21.66 | 20,534 MKeys/s | +7.8% / +8.1% | 0 |
Stage 10 Drop-in (Track A, 42w, KB_turbo) |
21.56 / 22.30 | 24.87 / 25.80 | 23.16 / 23.97 | 22,475 MKeys/s | +18.9% / +18.3% | 0 |
Stage 10 Full-Stack (s2000, 2-stream inv=6, 47w) |
21.90 / 22.59 | 25.17 / 26.02* | 23.48 / 24.22* | 23,130 MKeys/s* | +20.5% / +21.8% | 0 |
Stage 10 Full-Stack (s4000, 2-stream inv=6, 47w) |
21.93 / 22.59 | 24.57 / 25.35 | 23.47 / 24.18 | — | +20.5% / — | 0 |
*Cool-start peaks: 25.360 GH/s Boost (26.230 A-only), 23.619 GH/s Steady (24.373 A-only), and 23,368 MKeys/s live -dp 14 with Err: 0.
GS=28, inv=4, and 376-CTA KernelB_turbo.03 Bare-Metal SM120 SASS Breakthroughs
At GS=24, every half-iteration performs 75 modular 256-bit operations per thread (63 MulMod256 + 12 SqrAddMod256). SR_CLOCKLO X-ray profiling shows Stage 10 down to ~53,000 SM cycles/half-iteration — 83.7% pure arithmetic running at 94.2% of the 73× IMAD.WIDE hardware pipe ceiling.
SR_CLOCKLO on RTX 5090 @ 2400 MHz): Pure modular math accounts for 44.36k of 53.0k SM cycles.- Odd-First Zero-Bank-Clash 2-Way
MulMod256(620.03 SM cy/op @w=8): Pairing two independent kangaroos in odd-first(1,0), (3,2), (5,4), (7,6)chunks warmsA[i].reuseon oddB[2k+1]reads before evenB[2k]reads — yielding 0 / 128 MOD-2 RF bank clashes. Delayingsc_loto rowi+1kills all 14S05cross-pipe carry stalls, Fast-Fold direct-Rodeletes 16 serial tail ops into a cold< 2-30handler, and placingRo[i]atpi=2locks the 2-warp SMSP scheduler into an out-of-phase3-2-3-2dual-pipe rhythm. - 45-
IMAD.WIDEFoldedSqrAddMod256(438.02 vs RC's 688 SM cy/op): Exploits squaring symmetry (17 fewerIMAD.WIDEper point jump) and folds2P - x1 - x2directly into diagonal accumulators for zero extra instructions. - Generalized Legal
.reuse+opt_inv: Extendingexact_schedule()to emit strictly legal.reuseacrossIMAD.WIDE,IMAD,IADD3,LOP3,SHF, andSEL(2,065 hits in drop-in; 3,278 in Track B v2) plus SM120'sIMAD -Rc(bit 75) and 20-cycleI2FP+LEA.HI+VIMNMXcutsInvMod256from 59,465 to 42,377 SM cy (w=8) and 32,183 SM cy (w=4). - ~1,700 SM cy/half-iter Glue Elimination: Row-0
SubMod corr_pairweaving acrossCTI, coldLastPntsoffloading viaUP4, deleting RC's deadREDG [InvBase+0x400](2.6M wasted L2 atomics/call),MEMBAR.ALL.GPU, and--fast_looppre-evaluation killing 25 dead stall cycles/pair.
// cubit SM120 SASS (gen_2way_mulmod v4): odd-first .reuse + delayed sc_lo + 3-2-3-2 phase lock [B------:R-:W-:Y:S01] IMAD.WIDE.U32 R76, P1, R12.reuse, R53, R76 ; // odd B[1] warms R12.reuse (0 clash) [B------:R-:W-:Y:S01] IMAD.WIDE.U32 R68, P0, R12, R52, R68 ; // even B[0] hits reuse cache [B------:R-:W-:Y:S01] IADD3.X R86, PT, PT, RZ, RZ, RZ, P0, !PT ; // delayed sc_lo (kills S05 stall) [B------:R-:W-:Y:S01] IMAD.WIDE.U32.X R78, P1, R12.reuse, R55, R78, P1 ; // paired w/ Stream 2 (Rt2) [B------:R-:W-:Y:S01] IADD3.X R70, P2, PT, R70, R77, RZ, P2, !PT ; // Ro[i] at pi=2 -> locks 2w phase
MulMod256 hits 620.03 SM cy/op only when the two warps per SMSP execute out of phase. Forcing lockstep via BAR.SYNC adds +57 cy/op (620 → 677), and changing the reduction tail from 2:2 to 1:1 starves the partner warp on the same SMSP (481.8 vs 659.5 cy/op, net +39.5 cy/op loss).
04 Three Surprising Silicon Discoveries on GB202
4.1 The RTX 5090 inv=7 Spin-Convoy Storm (+11.2% Recovery)
On RTX 5090 (170 SM), 163 Producer SMs generate 40.75 inversion batches/half-iter, but monolithic inv=7 spawns 56 inverter warps. The 15+ idle warps spun continuously on ATOMG.E.OR on the same SMSPs as busy opt_inv warps, inflating mean Recv_w from 550 → 3,360 SM cy and triggering 12,536 slow .label_local_inv fallbacks. Capping active warps (42w for drop-in inv=7, or 47w across dedicated 2-stream inv=6) + LDG.E.STRONG.GPU polling + StopThr=96% recovered +11.2% iso-clock.
opt_inv latency steps from 32.2k cy (1w/SMSP) to 42.4k cy (2w/SMSP). (B) Eliminating the 56-warp convoy recovers +2.40 GH/s; 2-stream inv=6 peaks at 47 active warps (21.90 GH/s @ 2400 MHz).4.2 The Two-Faced L2 Cliff: DRAM Power Throttling Hits Before Cycle Stalls
Sweeping active L2 working set on RTX 5090 (96 MB L2) revealed a striking rule for power-capped GPUs: at locked 2400 MHz, per-SM efficiency stays flat all the way to 85 MB, yet under the real 600 W board cap, GDDR7 spill power begins throttling SM clocks at 81–83 MB — collapsing clocks from 2610 → 2385 MHz at 85 MB (-225 MHz) and 2287 MHz at 89 MB (-323 MHz). Keeping GS=24 at 72.5 MB (12 SaveRegs + Compact-C cSlots=20 + MAX_WARPS=2048 + shifted 60 MB persisting L2) holds 2610 MHz steady on RTX 5090, while RTX PRO 6000's 128 MB L2 comfortably accommodates GS=28 (98.9 MB < 104 MB cliff).
4.3 Full-Stack Co-Design: KernelB_turbo & Zero-Bubble Async DP Pipelining
In stock GpuKang.cpp, the GPU sits idle for ~1.5–2.0 ms after every iteration during synchronous cudaMemcpy(DPs_out) and CPU AddPointsToList() (~750–800 MKeys/s live loss). Pairing our 100% bit-exact KernelB_turbo (32-bit fast loop filter + exact 64-bit .slow_k, 1-cycle SHF.R.S32.HI sign-extended 192-bit distance, 32 KB LDS, STG.E.EF.64, 164 exact-divisor CTAs) with a 2-in-flight double-buffered async DP pipeline (DPs_dev[2], pinned host buffers, streamDma, STEP_CNT=2000) eliminates the host bubble completely — turning a +1.35% kernel lead over Stage 10 Drop-in into a +2.92% (+655 MKeys/s) live solving lead.
05 Honest Graveyard: Closed Dead Ends on SM120
| Direction Tested | Measured SM120 Result | Root Cause on GB202 Silicon |
|---|---|---|
IMMA.16832.U8.U8 Tensor Core 256×256 | 5,612.7 cy/op (0.125× solo) | 256/256 exact, but 32-lane byte packing + column fold swamps ALU. |
FFMA FP32 dual-pipe + IMAD.WIDE | +2.00 cy/FFMA; 0.807× hetero | Shares 16 FP32/INT32 cores + RF collector (partner MulMod 722 → 1,152 cy). |
DMMA.8x8x4 (FP64 Tensor Core) | 1:64 hardware rate | GB202 Workstation/GeForce FP64 fuse. |
Karatsuba on IMAD.WIDE | 803.97 vs 620.03 cy/op | IADD3 shares 16-wide INT32 pipe; +60 IADD3 > -16 IMAD.WIDE. |
6× Unrolled NP_Save | +0.83 ms (5090), -4.0% (PRO 6000) | 263–284 KB code footprint crosses SM120's 128 KB L1 I-cache cliff. |
w=12 (BS=384, GS=16, reg=168) | 98.7–100.6 MKeys/s/SM solo; lost E2E | Short T_half forces inv=10..12; hits 400 W cap (PRO 6000) & 86 MB L2 cliff (5090). |
w=4 Solo-SMSP K=3..6 & Asym K=3 | 4096/4096 exact even at inv=2, 19.8–22.6 GH/s | Waiting for 2nd/3rd batch arrivals + 1-warp MulMod stalls > 53k cy T_half. |
12-bit pack12 & u32 JumpsList | pack12: B -0.30 ms, A +0.36 ms | Hoisted LDS pack12 loses slightly in KernelA; KernelB hits SHFL ceiling. |
4-op mul_4ch (2,032 .reuse) & NANOSLEEP | mul_4ch: 23.33 vs 23.62 GH/s | 4-op chunks break 3-2-3-2 dual-warp phase (+3.2% cy > RF Watt savings). |
06 Five-Gate Verification & Open-Source Links
Every shipped cubin passed all 5 silicon verification gates: 0 OPEX in local and remote nvdisasm (vs 171 in RC), 256/256 EXACT adversarial w=1 arithmetic verification, 4096/4096 – 4105/4105 EXACT CPU elliptic-curve invariant verification across 60.46B–79.13B jumps, live -dp 14 78-bit ECDLP solving with Err: 0, and 3-round counter-ordered benchmarks.
# Assemble & verify with our open-source Blackwell SASS stack git clone https://github.com/kacper-daftcode/cubit.git && cd cubit && cargo build --release # Browse the SM120 / SM103a / SM100a / SM121a ISA tables: # https://kacper-daftcode.github.io/blackwell-isa/