Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
Introduction
torch.js· 2026
LegalTerms of UsePrivacy Policy
  1. docs
  2. wgpu-native
  3. Introduction

wgpu-native

The @torchjsorg/wgpu-native package provides the default high-performance WebGPU backend for Node.js, built on top of the Rust wgpu library.

wgpu logo

Why choose wgpu-native?

  • Performance: Extremely lean and fast, with minimal overhead.
  • Broad Compatibility: Excellent support for Vulkan (Linux/Windows), Metal (macOS), and DX12 (Windows).

Installation

npm install @torchjsorg/wgpu-native

Usage

import { wgpu } from '@torchjsorg/wgpu-native';
import torch from '@torchjsorg/torch.js';

// Register wgpu as the global WebGPU provider
torch.webgpu.setProvider(wgpu);
Next
BindGroupDescriptor