r/CUDA • • 6d ago

[Open Source] Virtualizing a 16 TB FP16 cuFFT into 450 MB VRAM (71.1x speedup, 1.03 ms/batch) + Tensor-Core Beam-CVP on a 4 GB RTX 3050 Laptop

I built an open-source CUDA benchmark suite (MIT License) exploring extreme memory virtualization and mixed-precision GPU computing on a **4 GB VRAM RTX 3050 Laptop** (`sm_86`, 15 GB RAM), applied to the 256-bit ECDSA Hidden Number Problem (Bleichenbacher Fourier + Albrecht–Heninger lattice CVP, synthetic test vectors only).

**GitHub Repo:** https://github.com/jcube2024/secp256k1-gpu-audit

### Key CUDA / Systems Optimizations

  1. **`v4 FP16 cuFFT` (`71.1×` speedup over v1 FP32, `1.03–1.16 ms` per `2^22` batch):**

    - Virtualizes a **`2^40`-point (`16 TB`)** DFT into **`~450 MB` VRAM** via CSR binning (`4 B/pair`: 18-bit high index + 14-bit quantized phase).

    - `K = 8` register-level complex phase recurrence (eliminates redundant `__sincosf` calls).

    - Mixed-precision accumulation in FP32 registers + `1/32` pre-scaling into `CUDA_C_16F` (`__half2`) avoids FP16 overflow while preserving exact FP32 SNR (`8.99`).

  2. **GPU `CUB DeviceRadixSort` + Merge Wagner (`30.0×` vs 16-core CPU):**

    - `32M`-element Wagner merge round drops from `1.354 s` (`__gnu_parallel::sort`) to **`0.045 s`** on RTX 3050 (100% bit-exact).

  3. **5-Bucket NVMe Streaming Merge (`< 5 GB` RAM):**

    - Processes `600M` virtual pairs on a 15 GB RAM laptop with monotonically shrinking SSD footprint (`19.2 GB → 9.6 GB → 0 GB`).

  4. **cuBLAS TF32 Tensor-Core `Beam-Sieve-CVP` + GPU 256-bit Predicate:**

    - Solves batched nearest-neighbor search over `G6K` lattice sieve databases (`R @ U^T`) + FP64 GPU Babai-lifting in `0.21 s`.

Includes 8 standalone `.cu` engines (`make -j4 all`), a patched CUDA 12 `G6K-GPU-Tensor`, and a 4-part technical writeup. Happy to discuss any of the CUDA kernel details!

2 Upvotes

0 comments sorted by