r/CUDA • u/Delicious_Abies_9708 • 1h ago
I'm attempting to remake cuda-x libraries with vulkan shaders instead of actual cuda
I'm using it as a learning project so don't flame me https://github.com/billyblackburn/vkdata
r/CUDA • u/Delicious_Abies_9708 • 1h ago
I'm using it as a learning project so don't flame me https://github.com/billyblackburn/vkdata
r/CUDA • u/NoDevice9292 • 27m ago
Gated DeltaNet: 1.55–1.98x on B200, 1.54–2.00x on B300 KDA: 1.43–1.53x on B200 What's still slow: B200 trails our own Hopper kernels on an H200 by 4–20%. The products in the serial loops are synchronous, where Hopper's WGMMA overlaps them. Moving to M=128 tiles and asynchronous commits is the obvious next step.
Repo (opt-in with JLA_BLACKWELL=1): https://github.com/jla-org/jax-linear-attention
Happy to answer questions about the Pallas Mosaic GPU side.
r/CUDA • u/Obvious-Ask-9099 • 2h ago
Hi everyone, Over millions of time steps in river and open-channel flow simulations, standard float32/float64 arithmetic often introduces small volume drift, subtractive cancellation in shallow trapezoidal beds, and slight discrepancies between CPU and parallel GPU runs. I have been developing an integer-first hydrodynamics and scientific computing framework (UNIQUANT) that replaces floating-point updates with exact integer and rational arithmetic, and I formally verified 40 of its core modules in Lean 4 (0 sorry):
- Backlog-free donor-limited volume ledgers: Proportional outflow apportionment so cell inventories never overdraw and blocked zero-flow channels leave no unphysical backlog.
- Cancellation-free trapezoidal channel geometry: Algebraic depth inversion h = 2A / (b + sqrt(b^2 + 4mA)), exact hydrostatic pressure moment identities (I1'(h) = A(h)), and cut-cell ramp integrals.
- Tridiagonal M-matrix integer solvers: Strictly row-dominant integer solvers with dyadic grid refinement invariance (K to 2K), tie-to-even rounding to prevent solver oscillation, and certified L_infinity error bounds.
- Coupled sediment and momentum conservation: Exact two-phase suspended/bed sediment mass conservation, equilibrium Rusanov fluxes, and 128/256-bit multi-limb arithmetic for bit-exact CPU/CUDA execution.
The reference code (including Elbe hydraulic core headers and Python implementations) and Lean 4 proofs are open source here:
Primary repo & code: https://github.com/joesen88/Uniquant23 (DOI: 10.5281/zenodo.24570873)
Lean 4 formalization: https://github.com/joesen88/UNIQUANT-Formal (DOI: 10.5281/zenodo.24629562)
Would love to hear feedback from anyone working on shallow-water solvers, well-balanced schemes, or deterministic CFD!
r/CUDA • u/Possible_Community10 • 11h ago
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
**`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`).
**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).
**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`).
**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!
For GPU/CUDA kernel engineers, active GitHub open-source maintainers, and competitive programmers (Codeforces/Kaggle)
I started a side project that tracks remote work on 15+ platforms, and there's currently roles offering $50-$120/hr USD for CUDA/GPU kernel engineering, and $45-$120/hr USD for algorithmic problem setters and Kaggle medalists.
Basically if you send me a brief blurb with your country, degree, years of experience, tGitHub/CUDA/CP (i.e. technologies) background (no personal information please), I'll send you a custom Google doc with a list of referrals to roles that match your information. I also provide guides for each of the platforms to help with onboarding.
r/CUDA • u/Emergency-Tutor-7 • 1d ago
Repo: https://github.com/Furox-Art/vram-stream - MIT, 0.4.0.
Install: python -m pip install vram-stream or npm install -g vram-stream - both registries carry 0.4.0.
The pattern this wraps is the mapped-memory one: allocate a pinned host buffer with the device-mapped flag, get its device pointer, and pass it to the kernel alongside a normal device allocation. Two addresses, one kernel, no explicit memcpy between them. The library turns that into a workspace object so you are not hand-rolling the attribute flags and the context bookkeeping each time.
The self-check is the part I would run first, since mapped memory is where driver and platform differences show up:
vram-stream memory --device 0 --vram-mib 16 --ram-mib 16It allocates both regions in the selected context, launches one kernel that combines values read from VRAM and system RAM, writes results back to both, synchronises, and verifies the first and last aligned 32-bit word of each region. The bundled PTX kernel is compiled by the driver at run time, so nothing is precompiled against a specific CUDA version. From Python, open_cuda_workspace(vram_bytes=..., ram_bytes=...) exposes vram_device_pointer, ram_device_pointer and gpu_accessible_bytes, releases both on exit and restores the calling thread's previous context.
For repeated reads there is a block cache (open_cuda_cache): one pinned RAM buffer and one VRAM buffer per slot, copies and kernels on separate streams, CUDA events protecting the pinned buffer while a prefetch is in flight.
The limit is the link. Mapped RAM traffic crosses PCIe or NVLink at that link's bandwidth and latency, and the driver and OS cap how much you can pin, so this pays off for read-mostly data with locality you can plan for - not as a general replacement for keeping a working set in VRAM.
r/CUDA • u/Apprehensive_Board46 • 2d ago
I use Claude Code on my laptop, but my GPU is in Colab. I used to copy each kernel change into the notebook, run it, and paste the error or benchmark numbers back into Claude.
How does that work in your setup? Can your agent launch the GPU run and read the output itself? If so, how did you connect the two?
r/CUDA • u/Thenoocoder • 2d ago
Hey guys, I want to get a job as an Inference Engineer/ CUDA Programmer. I’m currently working as an AI and Data Engineer at a Vehicle Parts company in USA. I have been learning CUDA since the beginning of this year, I started with Metal(Apple) then shifted to CUDA, have a few good PRs and have 3 open PRs in vLLM. I would like your suggestion on what I can do differently and what I should do to get a job in Inference. My target is May-June next year as it will be 1 year at my current company.
r/CUDA • u/DeepEngineeringPackt • 2d ago
We're hosting a free technical webinar with Henry Wu, Henry Wu, Executive Director on ML/AI at Wells Fargo and bestselling author of Distributed AI Systems on December 5 at 11 AM ET.
The session will explore:
Thought this might be useful to those working with GPU computing and distributed systems.
Free registration: From One GPU to Thousands
r/CUDA • u/mikebmx1 • 2d ago
r/CUDA • u/Public-Luck1904 • 2d ago
I expected the benchmarks to settle whether I should worry about the HIP source path on NVIDIA. What I came away with was a better question about how to measure sub-percent differences.
We replayed six captured CaRtGS rasterizer backward workloads on one RTX 4090. Both builds used CUDA 12.8, CUDA LibTorch, and CCCL 2.8.2. The HIP source path still builds with nvcc and uses the CUDA runtime on this card. CaRtGS upstream · AMD HIP compilation and platforms
| Saved workload | CUDA median (ms) | HIP median (ms) | Median paired change |
|---|---|---|---|
| Replica room0 · step 100 | 0.19709 | 0.19661 | −0.28% |
| Replica room0 · step 500 | 0.32936 | 0.32893 | −0.11% |
| Replica room0 · step 1,500 | 0.35627 | 0.35701 | +0.24% |
| TUM fr1/desk · step 100 | 0.13010 | 0.12956 | −0.42% |
| TUM fr1/desk · step 500 | 0.20825 | 0.20815 | −0.04% |
| TUM fr1/desk · step 1,500 | 0.21627 | 0.21621 | +0.02% |
The metric is synchronized host wall time around one backward API call, including host-side launch work, any allocations inside the call, and synchronization. Four interleaved pairs per workload, 30 samples per mode per pair after warm-up. The percentages are medians of the paired ratios. Negative favors HIP. One early Replica pair came out at −15.47% and stayed in the calculation.
As a sanity check, the 300-frame Replica mapping run took 12.28–12.31 s with the HIP source path and 12.33–12.35 s with the CUDA source path. Two runs per mode, 2,900 mapper updates each. That’s a small pilot, so I’m treating the sub-percent differences as descriptive.
The reason I care is maintenance. CaRtGS and RTG-SLAM both build on Graphdeco’s original differentiable rasterizer. Their implementations share the same CUB inclusive scan and radix-sort calls for binning splats by image tile and depth. That gives us a concrete place to share a HIP wrapper and test, while keeping each project’s specialized kernels. CaRtGS rasterization code · RTG-SLAM depth rasterization code · My RTG-SLAM ROCm port
If you’re writing a new custom GPU kernel for a paper or side project, try starting with HIP and adding both build targets while the kernel is still small. On NVIDIA you can still use nvcc, CUDA libraries, and your usual profiling tools. Keep vendor-specific primitives behind a small interface, and check the same saved inputs on both GPUs.
I’m sharing the project with a few GPU communities. I’m posting here specifically for feedback on how we measured the NVIDIA builds.
For those who benchmark this kind of change, would you start with CUDA events around the individual GPU stages, longer interleaved batches, or both?

r/CUDA • u/episodefive • 3d ago
Doing generative video (like ComfyUI + MiniMax) on Mac seems to be much slower than running on a similarly-priced Nvidia GPU.
Is this just an inherent tradeoff in how Apple is architecting their chips, and what they’re optimizing for?
Or is the gap likely to be closed over time as the kernels and other software elements mature for Metal, etc?
Local AI is a very exciting space, and Mac + generative media seem like a very natural fit. But their current performance with gen video seems much more limited thank what RTX cards can do.
This isn’t intended to bash on Mac - I love the Mac. I just want to better understand how likely it is to achieve parity with Nvidia/CUDA, specifically for video. Any insights from CUDA/Metal peeps?
r/CUDA • u/Cobra-38 • 3d ago
I just bought my first NVIDIA card in hopes of learning cuda programming, I'm already knowledgeable in C and C++ but is this a good choice? 5060 Ti 8gb (sadly not the 16gb) and I think it'd be a decent card for basic stuff related to cuda or other things like LLM hosting.
I plan on taking some free courses to earn some certifications and do my own studies about the coding languages and CUDA as a whole, opinions on the matter, tips, or questions?
PM on Discord for more info: someoneresides
Email: r2wosolution@gmail.com
Icloud: r2wosolution@icloud.com
r/CUDA • u/EngineeringDry6493 • 4d ago
r/CUDA • u/Full-World8839 • 6d ago
RTX 5070/5080/5090 (sm_120, compute 12.0) currently fails with "no kernel image is available" because setup.py only builds for 70;80;90.
I built working wheels for Blackwell:
\- Patch: TORCH_CUDA_ARCH_LIST=12.0 and replace sm_70/sm_80/sm_90 with sm_120 in setup.py
\- Tested on 5070 WSL2 + torch 2.11.0+cu128 + py3.10
\- Wheels here for anyone stuck: https://github.com/Rapa2026/mamba-ssm-5070-blackwell-wheels
Happy to PR the sm_120 fix if you want it.
Test: Mamba2(d_model=64).cuda() -> OK
r/CUDA • u/adityazero • 6d ago
While building a high-level language with a rich type system, a core goal is reducing the need for low-level escape hatches like inline asm.
In glm-vx(GLM-5.3 serving engine with kernels in Vx-lang, checkpoint loading, and streaming HTTP), we replaced most inline PTX with MLIR ops, cutting asm regions from 499 to 81 across 20 kernels.
When LLVM sees the surrounding code, it can simplify logic and cut spills thus generating better code.
e.g., A bf16 store. The epilogue of the GEMM converts each f32 result to bf16 and stores 16 bits. The asm converted into a 16-bit register and then widened it to 32 bits with cvt.u32.u16, only for the store to use the low 16 bits again. Now the store takes the 16-bit register, and fp8_gemm_m64 has 64 fewer instructions:
// before
{ .reg .b16 h; cvt.rn.bf16.f32 h, %r393; cvt.u32.u16 %r199, h; }
st.global.b16 [%rd65], %r199;
// after
cvt.rn.bf16.f32 %rs1, %r327;
st.global.b16 [%rd74], %rs1;But when hoisting/reordering hurts (like %laneid or mma scheduling on H200), we have no option to keep the asm. Link to the full writeup in comments.
EDIT:
the generated SASS was also better in the topk examples from the post but in the above case it was identical.
r/CUDA • u/Ok-Pomegranate2755 • 6d ago
summary:
r/CUDA • u/Sure_Resource4753 • 8d ago
GPU JPEG decoders are fast, but their pixels differ from the CPU libraries'. On 102 public test images, nvJPEG matched libjpeg-turbo on none of them, by up to 110 levels at 4:2:0. That quietly breaks reproducible ML pipelines, test baselines and caches whenever decoding moves between CPU and GPU.
exact-gpu-jpeg decodes on the GPU and returns libjpeg-turbo's pixels byte for byte (accurate IDCT, fancy upsampling), and its encoder writes the same bytes as Pillow. Anything it can't reproduce exactly, progressive files for example, goes to libjpeg-turbo itself, so the output is always the reference.
On a 2016 GTX 1070: a 30 MP camera photo decodes in 11.3 ms, against 185 ms for libjpeg-turbo on one core and 164 ms for nvJPEG on the same card. Batches of small images: 7,310 images/s. Encoding: 5.5x faster than Pillow with identical files.
Where it loses is listed near the top of the README: one small image at a time, small encodes against 8 CPU threads, progressive files. Everything so far is from one machine, so results from other GPUs are very welcome: `python bench/reproduce.py --quick`, and there's a pinned issue for them.
The parallel Huffman stage (Weißenberger & Schmidt's self-synchronising method) is drawn in docs/huffman-sync.md, and there's a white paper in docs/ covering the method, the evidence and the limits.