Skip to content

Commit

Permalink
Add HIP (ROCm) and Liger Kernel to env report (#456)
Browse files Browse the repository at this point in the history
## Summary
Add HIP (ROCm) and Liger Kernel to env report

## Testing Done

- Hardware Type: A100 80GB PCIe
- [ ] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

cc @ByronHsu  , @lancerts
  • Loading branch information
Comet0322 authored Dec 10, 2024
1 parent 0dcd771 commit 37ffbe9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/liger_kernel/env_report.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import platform
import sys
from importlib.metadata import version


def print_env_report():
Expand All @@ -17,6 +18,11 @@ def print_env_report():
print(f"Operating System: {platform.platform()}")
print(f"Python version: {sys.version.split()[0]}")

try:
print(f"Liger Kernel version: {version('liger-kernel')}")
except ImportError:
print("Liger Kernel: Not installed")

try:
import torch

Expand All @@ -25,9 +31,17 @@ def print_env_report():
torch.version.cuda if torch.cuda.is_available() else "Not available"
)
print(f"CUDA version: {cuda_version}")
hip_version = (
torch.version.hip
if torch.cuda.is_available() and torch.version.hip
else "Not available"
)
print(f"HIP(ROCm) version: {hip_version}")

except ImportError:
print("PyTorch: Not installed")
print("CUDA version: Unable to query")
print("HIP(ROCm) version: Unable to query")

try:
import triton
Expand Down

0 comments on commit 37ffbe9

Please sign in to comment.