-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contraction_list: only keep remaining for last 20 contractions #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are hitting #147 in the CI as well, for that test can you add a check for (ValueError, TypeError)
with a comment like, # changed in Numpy 1.19, see https://github.com/numpy/numpy/commit/35b0a051c19265f5643f6011ee11e31d30c8bc4c
?
It's a harmless change.
@@ -51,16 +51,22 @@ def __repr__(self): | |||
" Complete contraction: {}\n".format(self.eq), " Naive scaling: {}\n".format(len(self.indices)), | |||
" Optimized scaling: {}\n".format(max(self.scale_list)), " Naive FLOP count: {:.3e}\n".format( | |||
self.naive_cost), " Optimized FLOP count: {:.3e}\n".format(self.opt_cost), | |||
" Theoretical speedup: {:3.3f}\n".format(self.speedup), | |||
" Theoretical speedup: {:.3e}\n".format(self.speedup), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 the values were getting out of hand.
opt_einsum/contract.py
Outdated
@@ -303,7 +309,12 @@ def contract_path(*operands, **kwargs): | |||
|
|||
einsum_str = ",".join(tmp_inputs) + "->" + idx_result | |||
|
|||
contraction = (contract_inds, idx_removed, einsum_str, input_list[:], do_blas) | |||
if len(input_list) <= 10: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any harm in extending this to 15-20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None memory wise! 10 was just a rough judgement call on neatness, but 20 feels fine as well.
OK, raised number of 'remaining terms' kept to 20 and should have fixed #147 now as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Description
Resolves #148, by only keeping the last 10 'remaining terms' lists in the
contraction_list
, which is generally the point it starts to look a bit messy in thePathInfo
object. This could be tweaked / made customizable.I've also
[...]
might also be clearer.Status