-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_summary.py
More file actions
42 lines (34 loc) · 1.33 KB
/
test_summary.py
File metadata and controls
42 lines (34 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import sys
import torch
print("=" * 60)
print("FakeGPU + PyTorch Integration Test Summary")
print("=" * 60)
try:
# Basic checks
print(f"\n1. PyTorch version: {torch.__version__}")
print(f"2. CUDA available: {torch.cuda.is_available()}")
print(f"3. Device count: {torch.cuda.device_count()}")
if torch.cuda.is_available():
print(f"\n4. Device properties (GPU 0):")
props = torch.cuda.get_device_properties(0)
print(f" - Name: {props.name}")
print(f" - Total memory: {props.total_memory / 1024**3:.2f} GB")
print(f" - Compute capability: {props.major}.{props.minor}")
print(f"\n5. Creating small tensor on CUDA...")
x = torch.randn(10, 10, device='cuda')
print(f" - Tensor shape: {x.shape}")
print(f" - Tensor device: {x.device}")
print(f"\n6. Simple tensor operation...")
y = torch.randn(10, 10, device='cuda')
z = x + y
print(f" - Result shape: {z.shape}")
print(f"\n7. Memory info:")
print(f" - Allocated: {torch.cuda.memory_allocated(0) / 1024**2:.2f} MB")
print("\n" + "=" * 60)
print("SUCCESS: All tests passed!")
print("=" * 60)
except Exception as e:
print(f"\nERROR: {e}")
import traceback
traceback.print_exc()
sys.exit(1)