Skip to content

Commit

Permalink
undo edits
Browse files Browse the repository at this point in the history
  • Loading branch information
aartbik committed Jul 30, 2024
1 parent 7a1c89b commit 7f3d03c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions benchmark/python/manual/sum_of_sq.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def runbench_eager(tag, sp, net, x, num_iters=1000):
checksum = checksum + res
end = time.time()
time_ms = (end - start) * 1000 / num_iters
# print("%s : %.2f : %8.4f ms. : checksum=%d" % (tag, sp, time_ms, checksum))
print(time_ms)
print("%s : %.2f : %8.4f ms. : checksum=%d" % (tag, sp, time_ms, checksum))


def runbench_mpact(tag, sp, net, x, num_iters=1000):
Expand All @@ -29,8 +28,7 @@ def runbench_mpact(tag, sp, net, x, num_iters=1000):
checksum = checksum + res
end = time.time()
time_ms = (end - start) * 1000 / num_iters
# print("%s : %.2f : %8.4f ms. : checksum=%d" % (tag, sp, time_ms, checksum))
print(time_ms)
print("%s : %.2f : %8.4f ms. : checksum=%d" % (tag, sp, time_ms, checksum))


class SqSumNet(torch.nn.Module):
Expand All @@ -55,7 +53,7 @@ def forward(self, x):
# into the MLIR sparse tensor type to make optimize it fully.
s = x.to_sparse_csr()

# runbench_eager("PyTorch (dense) ", sparsity, net, x)
# runbench_mpact("MPACT (dense) ", sparsity, net, x)
# runbench_eager("PyTorch (sparse)", sparsity, net, s)
runbench_eager("PyTorch (dense) ", sparsity, net, x)
runbench_mpact("MPACT (dense) ", sparsity, net, x)
runbench_eager("PyTorch (sparse)", sparsity, net, s)
runbench_mpact("MPACT (sparse)", sparsity, net, s)

0 comments on commit 7f3d03c

Please sign in to comment.