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!
Bladeren bron

Add test_timing_05().

master
Stanislaw Adaszewski 4 jaren geleden
bovenliggende
commit
431c871af7
2 gewijzigde bestanden met toevoegingen van 14 en 0 verwijderingen
  1. +1
    -0
      .gitignore
  2. +13
    -0
      tests/icosagon/test_trainloop.py

+ 1
- 0
.gitignore Bestand weergeven

@@ -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 Bestand weergeven

@@ -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)

Laden…
Annuleren
Opslaan