-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Faster cycle detection during optimization #4233
Comments
@nouiz, I believe this could become a part of the Faster optimization phase during compilation GSoC project idea |
Yes. Do you have question? I would start by making a first hacky version. Just to make sure it speed For this, go in the file gof/destroyhandler.py. And modify the method: Call io_toposort() on the graph and do the check in a loop. This will On Tue, Mar 15, 2016 at 7:02 PM, Gokula Krishnan notifications@github.com
|
I would profile this on 2 king of example, with convolution on GPU and On Wed, Mar 16, 2016 at 1:22 PM, Frédéric Bastien <
|
For the later version, you need to make a new subclass of Feature. You must implement the method on_input_change() and on_import(). This will allow to test only the nodes introduced in the graph and nodes where its inputs are changed. In those method, just record in the object that it failed and in the method validate() raise an exception (InconsistencyError) and make sure the next call won't raise that error. |
A start and some discussions that help explain it: https://github.com/Theano/Theano/compare/master...nouiz:faster_topo?expand=1 What need to be done.
|
Now it is working in master, so I'll close this issue. |
Currently, the cycle detection needed for the inplace optimization can be time consuming. Her is a few different way to help that:
The more strict algo is my prefered current direction (@nouiz). For example, if we allow to be inplace only on variable that have only 1 clients and aren't the result of view or inplace operation, this check can be done in constant time instead of being super linear in the number of node. We can extend this idea to be less strict and allow chain of inplace/view. It is important for many case like CuDNN and scan to allow inplace. Otherwise, the memory buffer allocated in the graph need to be copied.
The text was updated successfully, but these errors were encountered: