yields in SASS instructions
redplait.blogspot.comYields inserted by PTXAS on instruction-specific stall counts threshold
Yields inserted by PTXAS on instruction-specific stall counts threshold
r/CUDA • u/Winter_Mistake_3185 • 7h ago
Four sessions already live and next one is releasing soon about writing your first CUDA kernel
Roadmap (44 sessions):
- Foundations: CPU parallelism, GPU architecture, roofline, first CUDA kernels
- Memory hierarchy
- GEMM: naive kernel to optimized, profiling at every step
- Tensor cores
- Profiling and debugging
- PyTorch integration and Triton
- Attention / FlashAttention
- Hopper and Blackwell: TMA, WGMMA, CUTLASS, FP8/quantization, NVFP4, multi-GPU basics, FlashAttention 4, DeepSeek's kernels, AI-written kernels, capstone project
Prerequisites are C/C++, basic linear algebra, and PyTorch.
Caveats: it's in progress, and the later sessions (especially Blackwell/NVFP4) may change as the tooling does.
r/CUDA • u/Bryant_Yef • 10h ago
I've been putting together a collection of notes as I learn about GPU architecture and decided to share it with the community. It's organized like a book, moving through topics in a logical sequence, and it's under the MIT license. I would love any feedback on errors, clearer explanations, or even suggestions for diagrams that could help clarify the concepts.
Check it out here: https://github.com/BEFORE-GPU-ENGINEERING/BEFORE-GPU-ENGINEERING
r/CUDA • u/StreamHPC • 22h ago
Today is day one of our Advent of Kernel Optimization, covering fused-multiply add. We'll post about one GPU kernel optimization technique every weekday, you can follow along at https://streamhpc.com/blog/tag/advent2026/.
r/CUDA • u/SheSaidTechno • 1d ago
Hi everyone!
I'm a C++ developer with around 6 years of experience. I've played around with CUDA casually, enough to write basic kernels and get things running, but I've never studied it properly. I'd now like to go from "it works" to actually understanding what's going on and writing good CUDA.
I'm looking for two kinds of resources:
1. Learning resources
I'm looking for a technically accurate, well-structured course or book to learn CUDA properly. I'm comfortable with C++, but I don't mind revisiting the fundamentals if it's done right. I've seen plenty of crash courses on YouTube and Udemy but it's hard to tell which ones are technically sound. What would you recommend?
2. Reference material
What are the go-to references for CUDA that you keep bookmarked?
Cheers!
r/CUDA • u/NoDevice9292 • 3d 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/Delicious_Abies_9708 • 3d ago
I'm using it as a learning project so don't flame me https://github.com/billyblackburn/vkdata
r/CUDA • u/Obvious-Ask-9099 • 3d 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 • 4d 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 • 5d 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 • 5d 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/mikebmx1 • 6d ago
r/CUDA • u/Thenoocoder • 6d 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 • 6d 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/Public-Luck1904 • 6d 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?
