Skip to content

Zero-Copy from Torch

A PyTorch tensor on MPS or CUDA reaches the screen without a host copy: the renderer reads or imports its device memory, and a ladder of synchronization modes orders the work.

Field Value
ID REN-08
Status Shipped
Scope Core
Pillar Rendering and 3-D
Sprint None
Depends On Metal Renderer (REN-01)
Vulkan Renderer with CUDA (REN-02)
Unblocks EmbedScope (INT-27)
geometry.v1 (REN-04)
Tensor Bridge Service (REN-64)
Torch Adapter (REN-66)
Exportable Pool (REN-67)
f16 and bf16 (STR-19)
Docs Zero-Copy Tensors, Tensor Texture Paths
Branches None
Design None

Coverage Ledger

  • design/producer-runtime.md, under Producer Runtime. The graphics layer without a window as a native module in the training process, with WGSL compute that reads training tensors in place.
  • design/producer-runtime.md, under Device and Queue. The backend on the bound tensor's MTLDevice with its own command queue, and memory shared with torch's allocator.
  • design/producer-runtime.md, under Framework Adapter Interface. The adapter's export, sync, hook, probe and state functions and the native module's interface.
  • design/producer-runtime.md, under Sync Points. Framework work complete, Caliper's pass, and Caliper's work complete before the next write of a bound tensor.
  • design/producer-runtime.md, under Platforms Without Measurements. Vulkan with CUDA is expected to follow the same design and is untested.
  • design/renderer-core.md on the branch sprint4, under What is built and what is planned. The page states that nothing on it is built and lists built pieces: the renderer seam and its backends, the zero-copy paths, the geometry service and tensor bridge, the live views and the pixel-exact graphics suite.
  • design/renderer-core.md on the branch sprint4, under Zero-copy as a backend capability. Section heading for zero-copy as a backend capability.
  • design/renderer-core.md on the branch sprint4, under Fast Path Thresholds. Before and after benchmarks and acceptance thresholds that every migration step must pass.
  • design/renderer-core.md on the branch sprint4, under Limits. Limits: zero-copy only on the same machine, single-sample views, no frame graph, no fallback renderer between steps 5 and 15, the Windows gap.
  • design/renderer-core.md on the branch sprint4, under Decisions. Decisions on zero-copy as a hard requirement, the scene service, applets adapting to the API, and the particle applets first.
  • design/roadmap.md, under Renderers. Metal on macOS and Vulkan on Windows stay the normal path at full speed with zero-copy; nothing routes them through another layer.
  • caliper.tensor_bridge.v1, v1_1 and v1_2, caliper.tensor_bridge.v1_1 Handoff. caliper.tensor_bridge.v1_1 adds caps() and a stream-ordered handoff.
  • caliper.tensor_bridge.v1, v1_1 and v1_2, caliper.tensor_bridge.v1_2 Imported Allocations. caliper.tensor_bridge.v1_2 adds imported device allocations.
  • View Calls, MPS Zero-Copy. A tensor on MPS reaches the viewer with no host copy.
  • Adapters, torch.hpp. torch.hpp turns a torch tensor into a CaliperTensor, rejects rather than copies, and applies the MPS and CUDA rules.
  • Adapters, exportable_pool.hpp. ExportablePool allocates tensors the renderer can draw from in place.
  • Torch per Platform, Step Details. The six steps of the zero-copy path on macOS Metal and on Windows Vulkan with CUDA.
  • ML Applet Cookbook, 3. Device-Resident Pull. The device-resident pull of a tensor into a texture.
  • Zero-Copy Tensors, Tensor Texture Paths. How a tensor reaches a texture on Apple silicon, on Windows with an NVIDIA GPU and on the OpenGL fallback.
  • Zero-Copy Tensors, Sync Ladder. The sync ladder of synchronization modes.
  • Zero-Copy Tensors, Derived Graphics. Derived graphics.
  • Pull request #2. Pull request 2 (merged) adds zero-copy mechanism diagrams to the landing page.

Roadmap Graph Feature in Graph