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!
소스 검색

Add test_timing_05().

master
Stanislaw Adaszewski 4 년 전
부모
커밋
431c871af7
2개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. +1
    -0
      .gitignore
  2. +13
    -0
      tests/icosagon/test_trainloop.py

+ 1
- 0
.gitignore 파일 보기

@@ -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 파일 보기

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

불러오는 중...
취소
저장