Created
July 26, 2023 14:37
-
-
Save mahendrapaipuri/16e436593ae3a8db5fa3ffb97013d4d5 to your computer and use it in GitHub Desktop.
CUDA simple load test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Nicked from https://github.com/waggle-sensor/gpu-stress-test/tree/main | |
| import os | |
| import sys | |
| import time | |
| import torch | |
| x = torch.linspace(0, 4, 16 * 1024 ** 2).cuda() | |
| runtime = 60 | |
| timeout = time.time() + runtime | |
| print(f"Running GPU stress test loop [{runtime}s]") | |
| while True: | |
| x = x * (1.0 - x) | |
| if time.time() > timeout: | |
| sys.exit(os.EX_OK) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment