Created
August 26, 2021 23:34
-
-
Save pavanky/dd4a23e58f52b64427ce8f0b1af7e31d to your computer and use it in GitHub Desktop.
This file contains 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
import torch | |
import numpy as np | |
import time | |
elapsed = 0 | |
for _ in range(10): | |
a1 = np.random.random((8192, 8192)).astype(np.float32) | |
b1 = torch.tensor(a1) | |
st = time.time() | |
c1 = b1.cuda() | |
elapsed += time.time() - st | |
bandwidth = a1.nbytes / (elapsed / 10) / 1E9 | |
print(f"Total time: {elapsed}") | |
print(f"GBPS: {bandwidth}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment