Skip to content

Commit

Permalink
[jlse-run] use different method of timing
Browse files Browse the repository at this point in the history
  • Loading branch information
danlkv committed Oct 10, 2020
1 parent 013f19c commit 2657bdf
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion qtensor/ProcessingFrameworks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
from functools import reduce
import time
import lazy_import
from qtree import np_framework
from qtree import optimizer as opt
Expand Down Expand Up @@ -198,12 +199,27 @@ class CustomGeneratedBackend(cls):
Backend = backend
return CustomGeneratedBackend(*args, **kwargs)

def process_bucket(self, bucket, no_sum=False):
def process_bucket_pyrofiler(self, bucket, no_sum=False):
""" This method was original, but let's try what is with vanilia time.time()
Using pyrofiler allows to easily add more profilers like memory or cpu,
but adds a couple of function calls.
"""
indices = [tensor.indices for tensor in bucket]
with timing('process bucket time', indices
, callback=self._profile_callback):
return self.backend.process_bucket(bucket, no_sum=no_sum)

def process_bucket(self, bucket, no_sum=False):
indices = [tensor.indices for tensor in bucket]
start = time.time()
result = self.backend.process_bucket(bucket, no_sum=no_sum)
end = time.time()
duration = end - start
if self._print:
print(f"PROF:: perf data process bucket time: {duration}")
self._profile_results[str(indices)] = indices, duration
return result

def get_sliced_buckets(self, buckets, data_dict, slice_dict):
return self.backend.get_sliced_buckets(buckets, data_dict, slice_dict)

Expand Down

1 comment on commit 2657bdf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automake run result

Performance summary:

===Results===
Total time: 79.116
Simulator fitted flops: 0.041285 G
Matmul flops: 221.86 G
Simulator optimality: 0.00018608346870725733

Backend used: mkl (full)

Performance plot:

Run date: Sat Oct 10 22:06:50 UTC 2020

Please sign in to comment.