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!
Explorar el Código

Add test_timing_05().

master
Stanislaw Adaszewski hace 4 años
padre
commit
431c871af7
Se han modificado 2 ficheros con 14 adiciones y 0 borrados
  1. +1
    -0
      .gitignore
  2. +13
    -0
      tests/icosagon/test_trainloop.py

+ 1
- 0
.gitignore Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar