IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

PDL

struct PDL[overlap_at_beginning: Bool = False]

Programmatic Dependency Launch (PDL) control structure.

This struct provides a way to manage programmatic stream serialization on NVIDIA GPUs. It waits on the predecessor grids on entry and releases the dependent grids on exit.

overlap_at_beginning (PDLLevel.OVERLAP_AT_BEGINNING) releases the dependents on entry instead, so they turn resident while this kernel is still running and overlap it with their predecessor-independent work (weight loads, descriptor setup). Releasing early cannot expose unwritten output: a dependent's own wait_on_dependent_grids blocks until the predecessor grids have completed and their stores are visible, so the release only decides when the dependent is scheduled. It is unsafe only for a dependent that writes memory this grid still reads, before its own wait.

Note:

  • Only supported on NVIDIA SM90+ (Hopper architecture and newer) GPUs.

Parameters

  • overlap_at_beginning (Bool): Release the dependent grids on entry rather than on exit.

Implemented traits

AnyType, Defaultable, Deinitable, Movable

Methods

__init__

def __init__(out self)

Initialize the PDL control structure.

__enter__

def __enter__(self)

Wait for the predecessor grids to complete.

__exit__

def __exit__(self)

Release the grids that depend on this one.