summaryrefslogtreecommitdiff
path: root/experiments/crossover_hardware_smoke.py
blob: 89c11c22b4eb5a8f17676bebe9cfaae9dd217f1a (plain)
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
#!/usr/bin/env python3
"""Dependency-free checks for frozen crossover hardware profiles."""
from crossover_hardware import (
    assert_hardware_report,
    policy,
    policy_for_report,
)


def main():
    report = {
        "hardware_profile": "a6000",
        "cuda_visible_devices": "3",
        "physical_gpu_index": 3,
        "physical_gpu_uuid": "GPU-smoke",
        "physical_gpu_name": "NVIDIA RTX A6000",
        "total_memory_mib": 49140,
    }
    a6000 = policy_for_report("a6000", report)
    assert a6000["allowed_physical_gpu_indices"] == [3]
    assert_hardware_report(report, a6000)
    gtx = policy("timan107_gtx1080")
    assert gtx["allowed_physical_gpu_indices"] == [5, 7]
    assert gtx["allowed_device_names"] == ["NVIDIA GeForce GTX 1080"]
    print("crossover hardware smoke: all checks passed")


if __name__ == "__main__":
    main()