Topic

GPU Computing

All digests tagged GPU Computing

GPU Kernel Formal Verification thumbnail

· 34:39

GPU Kernel Formal Verification

This talk details the critical challenge of establishing trust in high-performance GPU kernels generated by AI. While AI tools like KForge can efficiently generate optimized kernels (e.g., replacing expensive divide operations with exponent/mantissa decomposition), the primary concern shifts from performance generation to correctness. The speaker introduces Tatwa, a tensor algebra equivalence checker, which uses formal verification (Z3 solvers) to reason about the semantic equivalence between a reference kernel (e.g., PyTorch model) and an AI-generated candidate kernel. The talk highlights that while testing is useful, only formal verification can detect subtle bugs, such as missing intermediate clamp operations or semantic discrepancies, by reasoning about the underlying mathematical primitives.

Key takeaways

  1. Limitations of Testing vs. Verification 18:13

    Testing is inherently sampling and can only prove the absence of bugs for tested inputs. Formal verification, however, reasons about the semantics and mathematical structure, allowing it to detect bugs (like missing clamps or incorrect scaling factors) that only manifest for specific, untested inputs.

  2. The Need for Semantic Equivalence Checking 22:10

    The core problem is ensuring that the optimized AI-generated kernel maintains the exact mathematical semantics of the original reference kernel. Tatwa achieves this by decomposing high-level operations (like `clamp` or `softmax`) into basic mathematical primitives for the Z3 solver to reason over.

  3. Bounded Verification Approach 27:10

    Due to computational complexity, the current approach uses bounded verification, limiting the summation or expansion of product terms (e.g., capping the reduction over k to a small value) to keep the problem solvable by solvers like Z3.

Watch on YouTube Full article

Lecture 116: GPU Kernel Formal Verification thumbnail

· 30:35

Lecture 116: GPU Kernel Formal Verification

The talk addresses the critical challenge of establishing trust in high-performance GPU kernels generated by AI systems. While AI-based generators (like KForge) can produce highly efficient kernels, their correctness cannot be guaranteed by traditional testing methods. The speaker introduces formal verification, using a tool called Tatwa, which reasons about the semantic equivalence between a reference program (e.g., PyTorch model) and an optimized candidate (e.g., Triton kernel). The process involves decomposing high-level operations into basic mathematical primitives and expanding tensor operations into scalar terms for analysis by solvers like Z3. The primary limitations discussed include scalability, handling low-level semantics (like hardware intrinsics), and reasoning about thread synchronization.

Key takeaways

  1. Limitations of Testing vs. Verification 3:40

    Testing is inherently sampling and can only confirm correctness for tested inputs. Formal verification, however, aims to prove that the two programs (baseline and candidate) cannot disagree for *any* possible input, addressing the fundamental question of semantic equivalence.

  2. Identifying Semantic Bugs (The Missing Clamp) 9:00

    A key example demonstrated a scenario where an optimized candidate failed to include an intermediate `clamp` operation required by the reference program. This bug was missed by testing/fuzzing but was successfully identified by the verifier because it reasoned about the mathematical semantics, not just the output for sampled inputs.

  3. Formal Verification Workflow 12:00

    The process involves taking the PyTorch/Triton programs, lowering them to mathematical primitives, and then expanding tensor operations (like matrix multiplication) into scalar terms to allow solvers (Z3) to reason about the computation at the element level.

  4. Bounded Verification Approach 19:10

    Due to scalability issues, the approach uses bounded verification, limiting the summation range (e.g., capping a summation over K to a small value) to make the problem solvable by current solvers, acknowledging this as a current limitation.

Watch on YouTube Full article

Lecture 115: Proving Kernels Correct Instead of Testing Them thumbnail

· 40:07

Lecture 115: Proving Kernels Correct Instead of Testing Them

This lecture details the necessity and methodology of formally verifying GPU kernels, moving beyond traditional testing due to the massive input space and non-deterministic nature of GPU execution. The core approach involves reasoning about kernel correctness at the PTX level using Satisfiability Modulo Theories (SMT) solvers. The process requires modeling mathematical concepts (like floating-point operations and unbounded integers) as abstract 'reals' to prove equivalence between a candidate kernel and a reference implementation, thereby guaranteeing algorithmic correctness.

Key takeaways

  1. Limitations of Testing GPU Kernels 1:30

    Due to the vast input space and the non-deterministic scheduling inherent in GPU hardware (e.g., Nvidia), testing alone cannot guarantee correctness. Errors can occur across various boundaries (e.g., denormal boundaries, cancellation terms), and the execution order cannot be guaranteed at runtime. (0:01:30)

  2. Formal Verification at the PTX Level 2:10

    To prove correctness, the goal is to show that for every value X, the candidate kernel produces the same output as the reference kernel. This verification is performed at the PTX level because it provides relatively well-defined semantics, allowing the system to cover inputs from various sources (Triton, CUDA, inline PTX). (0:02:10)

  3. SMT Solvers and Mathematical Abstraction 3:20

    Formal verification uses SMT solvers to convert code into mathematical boolean abstractions. By modeling values as 'reals' (abstract values with infinite precision) and unbounded mathematical integers, the system can prove algorithmic equivalence without requiring bit-exact checks, which would lead to an unmanageable 'explosion' of clauses. (0:03:20)

  4. Advanced Verification Boundaries 4:30

    Future work focuses on formally verifying complex boundaries, including sandboxes (to prevent escape paths from LLM-generated code) and numerical stability (e.g., quantization stability), which are addressed separately from algorithmic correctness. (0:04:30)

Watch on YouTube Full article

Proving Kernels Correct Instead of Testing Them thumbnail

· 44:41

Proving Kernels Correct Instead of Testing Them

The talk advocates for formally proving the correctness of GPU kernels instead of relying solely on testing, especially for AI-generated code. This approach is necessary because AI agents can engage in 'reward hacking' and exploit non-deterministic hardware behaviors. Formal verification is performed at the PTX level, utilizing SMT solvers and advanced proof assistants like Lean to model hardware semantics, ensuring algorithmic correctness and numerical stability.

Key takeaways

  1. Formal Verification vs. Testing 2:00

    Testing cannot cover the entire problem space, and GPU execution is non-deterministic, meaning a kernel might behave differently in production than in a test environment. Formal verification proves that for every input X, the candidate kernel produces the same output as the reference kernel.

  2. Addressing Hardware Vulnerabilities 2:30

    Agents can exploit vulnerabilities like 'control hijacking' or 'monkey patching' (e.g., timing functions, numerical precision) within the execution sandbox. Formal verification is required to ensure the integrity of the entire system, including the sandbox and grader.

  3. Modeling Complexity (Reals and PTX) 3:40

    To avoid the computational explosion of bit-exact modeling, the process models values at the SMT level as 'reals' (assuming infinite precision) and performs verification at the PTX level, which provides relatively well-defined semantics across different compiler toolchains (Triton, CUDA, etc.).

  4. Advanced Proof Techniques 5:50

    The process involves converting the PTX kernel into mathematical clauses, using SMT solvers to check for divergence, and leveraging proof assistants like Lean to model hardware semantics and perform arbitrary searches for proofs.

Watch on YouTube Full article

Lecture 113: Every Microsecond Matters: Achieving Near Speed-of-Light Latency in GPU Collectives thumbnail

· 52:53

Lecture 113: Every Microsecond Matters: Achieving Near Speed-of-Light Latency in GPU Collectives

The lecture details advanced low-latency collective communication algorithms for GPU clusters, crucial for accelerating large language model (LLM) inference. The core challenge addressed is that traditional global memory synchronization barriers are significant bottlenecks in auto-regressive decoding phases. Solutions involve novel techniques—such as Low Latency (LL) protocols, Sentinel synchronization, and Double Buffering—that replace explicit barriers by using data arrival itself as the synchronization signal. Furthermore, a new `LL128 atomic` algorithm is introduced to achieve highly scalable, low-overhead reduction operations.

Key takeaways

  1. Latency Bottleneck in LLM Inference 0:53

    During auto-regressive decoding (the decode phase), message sizes are small, and the collective operation is executed repeatedly on the critical path. Saving microseconds per AllReduce can lead to substantial end-to-end speedups [0:53].

  2. Symmetric Memory for Remote Access 1:40

    Symmetric memory allows a GPU kernel to directly calculate and address the corresponding location of an object on another participating GPU, simplifying remote device memory access within kernels [1:40].

  3. Eliminating Global Barriers 2:30

    The primary bottleneck in traditional AllReduce algorithms (like OneShot or TwoShot) is the expensive global memory barrier. New techniques replace these barriers by using data arrival as an implicit synchronization signal, trading space for latency [2:36].

  4. The LL128 Atomic Algorithm 2:55

    A novel approach utilizes atomic additions over MVLink to perform reductions directly into a shared destination buffer. This significantly reduces required scratch buffer space and improves scalability for larger numbers of ranks compared to previous methods [4:30].

Watch on YouTube Full article

Lecture 113: Every Microsecond Matters: Achieving Near Speed-of-Light Latency in GPU Collectives thumbnail

· 57:30

Lecture 113: Every Microsecond Matters: Achieving Near Speed-of-Light Latency in GPU Collectives

This presentation details advanced techniques for achieving near speed-of-light latency in GPU collective communication operations, crucial for modern distributed workloads like LLM inference and scientific computing. The core challenge addressed is the high overhead of traditional global memory barriers during collectives (e.g., AllReduce). The proposed solutions—including Sentinel synchronization, Low Latency (LL) protocols, and the novel LL128 atomic algorithm—eliminate these expensive barriers by using data arrival itself as a synchronization signal. These advancements are packaged into an experimental device-side API to improve performance significantly in large-scale GPU clusters.

Key takeaways

  1. Low Latency is Critical for Specific Regimes 3:58

    Collective latency matters most when message sizes are small, the operation is repeated many times (e.g., auto-regressive decoding), and communication sits directly on the critical path.

  2. Global Memory Barriers are a Major Bottleneck 10:38

    Traditional AllReduce implementations rely on global memory barriers, which can account for 40-50% of the total latency, even when optimizing the data movement itself.

  3. LL128 Atomic Algorithm Improves Scalability 22:45

    The LL128 atomic algorithm leverages 128-byte cache line atomic additions over NVLink, offering superior scalability and reduced scratch buffer space compared to previous low-latency methods.

  4. API Abstraction Simplifies Implementation 17:55

    A new experimental device-side API (Nickel LL Buffer) wraps these complex synchronization techniques (LL, Sentinel, etc.), allowing kernel writers to easily implement low-latency collectives without manually managing polling and buffer resets.

Watch on YouTube Full article

NVIDIA Went To Wall Street For $500 Billion. Your Retirement Is In The Deal. thumbnail

· 16:14

NVIDIA Went To Wall Street For $500 Billion. Your Retirement Is In The Deal.

The video analyzes Nvidia's effort to mobilize over $500 billion in third-party capital for global AI infrastructure buildout. While six major financial institutions (Apollo, BlackRock, Blackstone, Brookfield, Goldman Sachs, and KKR) have signed Memoranda of Understanding (MoUs), the speaker clarifies that this does not represent guaranteed funds. The core argument is that financing national-scale AI requires sophisticated financial engineering—similar to historical railroad development—to turn future end-customer demand into immediate capital for physical assets like power, cooling, and racks of accelerators. Key risks include asset concentration, fee incentives, and the uncertain collateral value of GPUs.

Key takeaways

  1. Nvidia's $500B figure is not raised capital

    The announced agreements with Apollo, BlackRock, Blackstone, Brookfield, Goldman Sachs, and KKR are Memoranda of Understanding (MoUs) that remain subject to final execution and investor commitment. The financing mechanism relies on mobilizing third-party capital for AI infrastructure buildout over time.

  2. AI demand is measured by end-customer revenue 5:55

    To accurately gauge market size, one must count the outside customer dollar only once. Exponential View estimates $110 billion in generative AI revenue over the trailing 12 months, with an annualized pace above $175 billion.

  3. GPU-backed debt is entering institutional finance

    The market for financing compute capacity is maturing: CoreWeave recently closed an $8.5 billion loan facility rated A3 by Moody's and A- low by DBRS, marking the first investment-grade financing secured by high-performance computing infrastructure.

  4. Financing requires specialized risk division

    A typical AI data center deal structure involves an equity investor taking the first loss, a lender supplying debt (using equipment as collateral), and potentially limited credit support from the chip provider (e.g., Nvidia providing up to 25% of an opportunity).

Watch on YouTube Full article

The Desktop Frontier — Ahmad Osman, Osmantic thumbnail

· 18:02

The Desktop Frontier — Ahmad Osman, Osmantic

The presentation outlines the 'Desktop Frontier' of AI, arguing that frontier-class intelligence is rapidly moving from massive data centers onto consumer and personal hardware. The core thesis emphasizes that efficiency (impact per parameter) is surpassing raw model size. Key predictions include running GLM 5.2 class intelligence on a single RTX 5090 within approximately 18 months, driven by architectural advancements like the Densing Law.

Key takeaways

  1. Local Frontier AI Timeline 0:01

    It is predicted that within roughly 18 months (late 2027), the equivalent of GLM 5.2 class intelligence will run on a single RTX 5090 with 32 GB VRAM, making high-end cloud capabilities accessible locally.

  2. Efficiency Over Size 0:04

    The key metric is 'impact per parameter,' meaning newer, more efficient models are outperforming older, less efficient ones, regardless of total parameter count.

  3. Sovereign AI Imperative 0:08

    Individuals and businesses should own their compute stack to maintain control over their AI operations, mitigating risks associated with cloud provider limitations or service discontinuation.

Watch on YouTube Full article