-
Notifications
You must be signed in to change notification settings - Fork 32
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
Nodes in ContractionTree with same indices sets #3
Comments
Hey thanks. Yes this type of thing is sadly not supported currently - and this issue has come up a few times in
To be honest not sure if 2 would be possible without doing 3! Do you think this a potentially common case in your uses? |
I have read the above issues and they are indeed very informative. I believe it is very important to have these preprocessing as you mentioned: hadamard de-duplication and single index reduction. I guess the case here is a special case of hadmard deduplication? |
Ah I don't want to give the impression these are not supported in opt_einsum - they are - the issues were that some of the path finders weren't finding good paths in certain edge cases, suggesting it might be sensible to deal with them separately at the start. The difference here is that cotengras contraction tree object actually can't represent them at all. |
Well, I guess if such preprocess happens before calling any optimizer in opt_einsum, then HyperOptimizer here is okay since what it accepts is tensors without repetitive indices (already processed by opt_einsum). And by such architecture, no path finders need to implement their own preprocessing stuff. Is this a good way to go? |
Hi, I am repeatedly getting the following uninformative error when trying to run the hyperoptimizer. For instance, from the readme file: import opt_einsum as oe eq, shapes = oe.helpers.rand_equation(30, 4) BrokenProcessPool Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/opt_einsum/contract.py in contract_path(*operands, **kwargs) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cotengra-0.1.0-py3.8.egg/cotengra/hyper.py in call(self, inputs, output, size_dict, memory_limit) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cotengra-0.1.0-py3.8.egg/cotengra/hyper.py in _gen_results_parallel(self, repeats, trial_fn, trial_args) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cotengra-0.1.0-py3.8.egg/cotengra/hyper.py in get_and_report_next_future(self) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py in result(self, timeout) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py in __get_result(self) BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending. Any ideas what is hapening? |
Hi @kastoryano, looks like you are maybe new to github - try creating a new, separate issue for your problem (unless you suspect its related to this one!), as a first step, I'd use |
@refraction-ray I actually changed the internal representation of the nodes in recent commits so just should work now, feel free to reopen if not! |
Hi, there. Very great project to play with!
I have a question on the construction of
ContractionTree
object.In building such a tree structure, it seems to me that the node is totally determined by the frozen set of its edge indices.
I am wondering whether tensors with the same indices can be well handled in the setups, or at least they should be automatically contracted first?
Say trace of matrix square
I am afraid such a contractiontree may have problem since it cannot actually differentiate nodes.
Note how children and parent nodes are somehow messed with the same label and how total flops is zero which is not true for the trace operation.
I guess such scenario is a corner case, and such nodes should be contracted before contructing the tree? Though it would be great such automatic contraction and correct flop counting are also taken care of by tree construction in the program.
The text was updated successfully, but these errors were encountered: