-
Notifications
You must be signed in to change notification settings - Fork 5
01. Installation
This guide covers all installation scenarios for TritonParse, from basic usage to full development setup.
For users who only need to generate traces and use the web interface
For contributors working on the web interface
For core contributors working on Python code
- Python >= 3.10
- Operating System: Linux, macOS, or Windows (with WSL recommended)
-
GPU Required (Triton depends on GPU):
- NVIDIA GPUs: CUDA 11.8+ or 12.x
- AMD GPUs: ROCm 5.0+ (supports MI100, MI200, MI300 series)
- Node.js >= 18.0.0 (for website development only)
⚠️ Important: GPU is required to generate traces because Triton kernels can only run on GPU hardware. The web interface can view existing traces without GPU.
-
PyTorch with GPU support (we recommend PyTorch nightly for best compatibility)
- For NVIDIA GPUs: PyTorch with CUDA support
- For AMD GPUs: PyTorch with ROCm support
- Triton > 3.3.1 (must be compiled from source for TritonParse compatibility)
💡 Note: Detailed installation instructions for these dependencies are provided in each installation option below.
Perfect for users who want to generate traces and use the web interface.
git clone https://github.com/pytorch-labs/tritonparse.git
cd tritonparse
# Install PyTorch nightly with CUDA 12.8 support (recommended)
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
# Alternative: Install stable PyTorch with CUDA support
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# Verify PyTorch installation
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
# Install PyTorch nightly with ROCm support (recommended)
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2
# Alternative: Install stable PyTorch with ROCm support
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1
# Verify PyTorch installation
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
python -c "import torch; print(f'ROCm available: {torch.cuda.is_available()}')"
python -c "import torch; print(f'GPU device: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else \"No GPU\"}')"
# First, uninstall any existing PyTorch-bundled Triton
pip uninstall -y pytorch-triton triton || true
# Install Triton from source (required)
git clone https://github.com/triton-lang/triton.git
cd triton
pip install -e .
# Verify Triton installation
python -c "import triton; print(f'Triton version: {triton.__version__}')"
python -c "import triton; print(f'Triton path: {triton.__file__}')"
# Go back to tritonparse directory
cd ../tritonparse
# Install in development mode
pip install -e .
# Or install with test dependencies
pip install -e ".[test]"
# Test with the included example
cd tests
TORCHINDUCTOR_FX_GRAPH_CACHE=0 python test_add.py
Expected output:
Triton kernel executed successfully
Torch compiled function executed successfully
tritonparse log file list: /tmp/tmp1gan7zky/log_file_list.json
INFO:tritonparse:Copying parsed logs from /tmp/tmp1gan7zky to /scratch/findhao/tritonparse/tests/parsed_output
================================================================================
📁 TRITONPARSE PARSING RESULTS
================================================================================
📂 Parsed files directory: /scratch/findhao/tritonparse/tests/parsed_output
📊 Total files generated: 2
📄 Generated files:
--------------------------------------------------
1. 📝 dedicated_log_triton_trace_findhao__mapped.ndjson.gz (7.2KB)
2. 📝 log_file_list.json (181B)
================================================================================
✅ Parsing completed successfully!
================================================================================
- Generate trace files using the Python API
- Visit https://pytorch-labs.github.io/tritonparse/
- Load your trace files (.ndjson or .gz format)
For contributors working on the React-based web interface.
- Node.js >= 18.0.0
- npm (comes with Node.js)
Follow Option 1: Basic User Installation first to install PyTorch, Triton, and TritonParse.
cd website
npm install
npm run dev
Access the development server at http://localhost:5173
# Development server
npm run dev
# Production build
npm run build
# Standalone HTML build (single file)
npm run build:single
# Linting
npm run lint
# Preview production build
npm run preview
For core contributors working on Python code, including formatting and testing.
Follow Option 1: Basic User Installation first to install PyTorch, Triton, and TritonParse.
# Install all development dependencies including formatting tools
make install-dev
This installs:
-
black
- Code formatting -
usort
- Import sorting -
ruff
- Linting
# Check code formatting
make format-check
# Run linting
make lint-check
# Run tests
python -m unittest tests.test_tritonparse -v
If you also need to work on the web interface, follow Option 2: Website Development Setup for additional setup.
# Error: "No module named 'triton'"
# Solution: Uninstall existing Triton and install from source
pip uninstall -y pytorch-triton triton || true
git clone https://github.com/triton-lang/triton.git
cd triton
pip install -e .
# Error: "CUDA not available" or "ROCm not available"
# Check GPU installation
python -c "import torch; print(f'GPU available: {torch.cuda.is_available()}')"
python -c "import torch; print(f'Device count: {torch.cuda.device_count()}')"
# For NVIDIA GPUs - Install CUDA-enabled PyTorch
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
# Alternative: stable version
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# For AMD GPUs - Install ROCm-enabled PyTorch
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2
# Alternative: stable version
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1
# Verify GPU support after installation
python -c "import torch; print(f'GPU available: {torch.cuda.is_available()}')"
python -c "import torch; print(f'GPU device: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else \"No GPU\"}')"
python -c "import torch; print(f'Backend version: {torch.version.cuda if torch.version.cuda else torch.version.hip}')"
# Error: Permission denied
# Use virtual environment
python -m venv tritonparse-env
source tritonparse-env/bin/activate # Linux/Mac
# or
tritonparse-env\Scripts\activate # Windows
# Error: "black not found"
# Reinstall development dependencies
make install-dev
# Or install manually
pip install black usort ruff
# Error: "Node.js version too old"
# Update Node.js to >= 18.0.0
nvm install 18
nvm use 18
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
Set these for development:
# TritonParse specific
export TRITONPARSE_DEBUG=1 # Enable debug logging
export TRITONPARSE_NDJSON=1 # Enable NDJSON output (default)
export TRITON_TRACE_GZIP=1 # Enable gzip compression
export TRITON_TRACE=/path/to/traces # Custom trace directory
# PyTorch/TorchInductor related
export TORCHINDUCTOR_FX_GRAPH_CACHE=0 # Disable FX graph cache (for testing)
export TORCH_LOGS="+dynamo,+inductor" # Enable PyTorch debug logs
export CUDA_VISIBLE_DEVICES=0 # Limit to specific NVIDIA GPU
export ROCR_VISIBLE_DEVICES=0 # Limit to specific AMD GPU (ROCm)
export HIP_VISIBLE_DEVICES=0 # Alternative for AMD GPUs
# GPU debugging (if needed)
export CUDA_LAUNCH_BLOCKING=1 # Synchronous CUDA execution (NVIDIA)
export HIP_LAUNCH_BLOCKING=1 # Synchronous HIP execution (AMD)
export TORCH_USE_CUDA_DSA=1 # Enable CUDA device-side assertions (NVIDIA)
If you encounter issues:
- Check the Troubleshooting Guide for common solutions
- Review the FAQ for frequently asked questions
- Search GitHub Issues for existing solutions
-
Open a new issue with:
- Your system information (
python --version
,pip list
) - Complete error messages
- Steps to reproduce the issue
- Your system information (
After installation, verify everything works:
# Test PyTorch installation
import torch
print(f"PyTorch version: {torch.__version__}")
print(f"GPU available: {torch.cuda.is_available()}")
print(f"GPU device count: {torch.cuda.device_count()}")
if torch.cuda.is_available():
print(f"GPU device: {torch.cuda.get_device_name(0)}")
print(f"Backend version: {torch.version.cuda if torch.version.cuda else torch.version.hip}")
# Test Triton installation
import triton
print(f"Triton version: {triton.__version__}")
# Test TritonParse installation
import tritonparse.structured_logging
import tritonparse.utils
print("TritonParse installed successfully!")
cd tests
TORCHINDUCTOR_FX_GRAPH_CACHE=0 python test_add.py
- Load the example trace file from
tests/example_output/
- Visit https://pytorch-labs.github.io/tritonparse/
- Upload and visualize the trace
# Should all pass without errors
make format-check
make lint-check
python -m unittest tests.test_tritonparse.TestTritonparseCPU -v
After successful installation:
- Read the Usage Guide to learn how to generate traces
- Explore the Web Interface Guide to master the visualization
- Check out Basic Examples for practical usage scenarios
- Join the GitHub Discussions for community support