ロボティクス&エッジ AI

NVIDIA Warp: Python kernels for CPU and GPU simulation

NVIDIA/warp

Compiles typed Python functions into compute kernels with geometry, physics and differentiable programming capabilities for simulation and machine learning.

★ 7.1Kスター
⑂ 621フォーク数
242未解決の問題
Python言語
Apache-2.0ライセンス
Q92編集部スコア

概要

Warp lets developers write parallel kernels in a Python-based language and just-in-time compile them for CPUs or supported NVIDIA GPUs. It provides vector and matrix types, geometry operations and simulation components, with differentiable computation that can participate in PyTorch or JAX workflows. A practical starting point is to isolate one measurable particle, geometry or optimization operation and compare correctness and performance.

主な機能

  • Just-in-time compilation of Python kernels.
  • Supports CPU and CUDA execution devices.
  • Provides vector, matrix and geometry primitives.
  • Supports differentiable kernels and machine-learning integration.
  • Includes physics, geometry, optimization and finite-element examples.
  • Includes an example browser and USD animation output in some examples.

要件、インストール、クイックスタート

1. Use Python 3.10 or newer.
2. Install pip install warp-lang; the package name is warp-lang.
3. Install pip install "warp-lang[examples]" for example dependencies.
4. Run python -m warp.examples.browse to explore examples.
5. Follow the README to define @wp.kernel functions, allocate wp.array data and launch work with wp.launch.
6. Validate numerical results on a small input before scaling the workload and measuring performance.

使用方法

For a particle update, store positions and velocities in arrays, assign a particle to each thread and launch the kernel repeatedly to advance state. Compare the result with a simple reference implementation before timing larger runs. For parameter fitting, explore automatic differentiation and optimization examples and verify which operations support gradients in the intended pipeline.

Implementation notes
Separate compilation and warm-up time from steady-state measurements. Host-device transfers also cost time and can dominate small workloads. Arbitrary Python code is not automatically a valid Warp kernel; follow the supported type and compilation rules.

モデルの互換性とユースケース

Published wheels cover Windows x86-64, Linux x86-64/AArch64 and Apple Silicon macOS. CUDA acceleration on Windows and Linux needs a compatible NVIDIA GPU and driver. macOS wheels support CPU execution, not Metal acceleration.

ライセンスとリスクに関する注意事項

Warp uses Apache-2.0. Some build dependencies and bundled components have separate terms listed in the repository’s licenses directory.

mediapipe

google-ai-edge/mediapipe

★ 36.9KC++

cosmos

NVIDIA/cosmos

★ 11.2KJupyter Notebook