Skip to main content

Graph

@luma.gl/graph provides operations, GPU data, and execution infrastructure. Start with Getting started with graphs for a complete computation and cleanup example.

Learn in this order​

  1. Getting started: inputs → operations → selected results → execution.
  2. Inputs, results, and state: types, dimensions, ownership, storage reuse, and caller-owned encoding.
  3. Expression syntax: arithmetic, functions, casts, components, and typed rows.
  4. Upload and copy and capacity/count results: data movement and GPU-sized selection.
  5. Operation contracts: extend the graph with explicit logical effects and lowerings.
  6. Command-graph concepts: scheduling and physical resources when implementing a lowering or diagnosing execution.

Choose an interface​

InterfaceUse it forExecution
GPUGraphNamed inputs/state and operation-defined results, including custom WebGPU operationscompile(device), then run(bindings) or prepare(bindings) and caller-owned encoding
GPUSimpleGraph reusable expressionsShared expression, upload, and copy operations on WebGL and WebGPUcompile(device), then run({inputs, outputTargets})
GPUSimpleGraph evaluator recipesLazy uploads and evaluator operations beyond the shared expression subsetnew GPUSimpleGraph(device), then compile() and run()
GPUCommandGraphExplicit compute, render, and copy passes, textures, and advanced schedulingCompile fixed resource descriptors, encode into a caller-owned encoder, submit explicitly

These are related layers, not interchangeable APIs. Full GPUGraph execution currently requires WebGPU. SimpleGraph does not support full-graph custom lowerings, mutable state, or the prepared execution API. Its evaluator recipes also have different result ownership; see its mode comparison.

How the layers fit​

GPUGraph describes logical operations. Reusable compilation checks their contracts and builds expression kernels. Preparing an invocation resolves dimensions and lowers operations through GPUGraphCompiler into a GPUCommandGraph. The command graph schedules concrete passes, tracks hazards, and plans compatible transient reuse. Encoding appends those commands; the application or run() submits them.

Applications normally use graph.compile(device). The lower-level GPUGraphCompiler.compile() returns command-graph declarations for advanced composition and requires concrete vector sizes. See the GPUGraph reference and command-graph reference.

Data and processing modules​

GPU data primitives live in @luma.gl/graph/gpu-data. A GPUData owns or borrows one buffer; a GPUVector describes an ordered sequence of chunks. Engine renderers consume these shared types. Logical graph declarations describe values; they do not own the input buffers.

Optional processing modules use explicit subpaths. Their individual references identify whether they provide semantic operations, command-graph contributors, or higher-level workflows; sharing the graph package does not imply every algorithm accepts the reusable expression interface.

SubpathCapability
gpu-simple-graphPortable evaluator-backed composition, upload/copy, scoped runs, and output storage
gpu-coreGraph primitives, GPU programs, resource planning, and execution helpers
gpu-graph-algorithmsGraph topology, analytics, and layouts
gpu-parseEncoded columnar page decoding
gpu-vector-searchSimilarity search and clustering
gpu-dggs, gpu-h3, gpu-a5, geospatial, gpu-projectSpatial indexing and coordinate processing
gpu-physics, gpu-geometry, gpu-pointcloud, gpu-timeseriesPhysics and domain computations
gpu-tables, gpu-dataframe, gpu-sql, gpu-crossfilterTables, queries, and selection
gpu-raster, lucimRaster and volume processing
gpu-simulation, gpu-effectsGraph-based ocean/fire simulations and FFT bloom
gpu-traceTrace analytics

For image processing, see texture values and execution bindings.