Skip to main content

Wafer CLI

The Wafer CLI is a powerful command-line tool for GPU kernel development, profiling, and optimization. It provides access to AI-powered assistance, performance analysis tools, and remote GPU infrastructure.

Installation

pip install wafer-cli
Verify the installation:
wafer --version

Command Groups

The Wafer CLI organizes commands into logical groups:

Kernel Development

Commands for developing and testing GPU kernels:
  • wafer agent — AI assistant for optimization
  • wafer evaluate — Test kernel correctness
  • wafer baseline — Discover PyTorch kernel dispatch
  • wafer roofline — Performance analysis

Profiling

GPU profiling and trace analysis:
  • wafer nvidia — NVIDIA profiling tools
  • wafer amd — AMD profiling tools
  • wafer compare — Cross-platform comparison

Infrastructure

Remote GPU access and workspaces:
  • wafer workspaces — Cloud GPU workspaces
  • wafer config targets — GPU target management

Configuration

Setup and authentication:
  • wafer auth — Authentication
  • wafer config — Configuration management

Basic Usage

Get Help

# Show all commands
wafer --help

# Get help for a specific command
wafer agent --help
wafer evaluate --help

Common Workflows

Ask the AI agent about GPU optimization:
wafer agent "How do I reduce bank conflicts in shared memory?"
Evaluate a kernel implementation:
wafer evaluate gpumode --impl ./my_kernel.py --reference ./reference.py
Analyze performance against roofline model:
wafer roofline --gpu H100 --bytes 1e9 --flops 1e12 --time-ms 0.5
Profile a kernel with NCU:
wafer nvidia ncu analyze ./profile.ncu-rep

Global Options

OptionDescription
--versionShow CLI version
--helpShow help for any command

Environment Variables

VariableDescription
WAFER_API_KEYAPI key for Wafer services
ANTHROPIC_API_KEYDirect API key for agent (bypasses proxy)

Next Steps