Skip to content

Instantly share code, notes, and snippets.

@Acephalia
Created April 18, 2025 22:41
Show Gist options
  • Save Acephalia/96ef2a160972406ef7346b5497e46dad to your computer and use it in GitHub Desktop.
Save Acephalia/96ef2a160972406ef7346b5497e46dad to your computer and use it in GitHub Desktop.
PyTorch Environment Version Check: Python, Torch, CUDA, Torchvision, Torchaudio, Flash-Attention, Triton, and SageAttention Dependencies
import sys
import torch
import torchvision
import torchaudio
print("python version:", sys.version)
print("python version info:", sys.version_info)
print("torch version:", torch.__version__)
print("cuda version (torch):", torch.version.cuda)
print("torchvision version:", torchvision.__version__)
print("torchaudio version:", torchaudio.__version__)
print("cuda available:", torch.cuda.is_available())
try:
import flash_attn
print("flash-attention version:", flash_attn.__version__)
except ImportError:
print("flash-attention is not installed or cannot be imported")
try:
import triton
print("triton version:", triton.__version__)
except ImportError:
print("triton is not installed or cannot be imported")
try:
import sageattention
print("sageattention version:", sageattention.__version__)
except ImportError:
print("sageattention is not installed or cannot be imported")
except AttributeError:
print("sageattention is installed but has no __version__ attribute")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment