IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

Add test_timing_05().

master
Stanislaw Adaszewski 3 years ago
parent
commit
431c871af7
2 changed files with 14 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +13
    -0
      tests/icosagon/test_trainloop.py

+ 1
- 0
.gitignore View File

@@ -4,3 +4,4 @@ __pycache__
/docs/icosagon/*.dot
/docs/icosagon/*.png
/experiments/decagon_run/profiler_results
/experiments/decagon_run_effcat/profiler_results

+ 13
- 0
tests/icosagon/test_trainloop.py View File

@@ -112,3 +112,16 @@ def test_timing_04():
for _ in range(1300):
_ = torch.sparse.mm(adj_mat, rep)
print('Elapsed:', time.time() - t)
def test_timing_05():
if torch.cuda.device_count() == 0:
pytest.skip('Test requires CUDA')
dev = torch.device('cuda:0')
adj_mat = (torch.rand(2000, 2000) < .001).to(torch.float32).to_sparse().to(dev)
rep = torch.eye(2000).requires_grad_(True).to(dev)
t = time.time()
for _ in range(1300):
_ = torch.sparse.mm(adj_mat, rep)
torch.cuda.synchronize()
print('Elapsed:', time.time() - t)

Loading…
Cancel
Save