You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are super slow as the autograd abs and max are applied on autograd.numpy_array.ArrayBox.
However, they do not need gradients. So If changing them to numpy array,
Thanks! This is interesting, I am surprised there is an overhead in this - it may be worth investigating a bit further what the underlying reason is. For the time being though do you have a simulation where you observe this inefficiency?
I just ran the standard PhC waveguide simulation and inverse design. The runtime report, when set verbose=True, shows this is the runtime bottleneck. So, I profiled every line in this function. Those two lines turned out to be unexpectedly slow, as the autograd.max function tries to select one element to propagate the gradient, which might be the slowest part.
In gme.py, _separate_hamiltonian_sparse function,
are super slow as the autograd abs and max are applied on autograd.numpy_array.ArrayBox.
However, they do not need gradients. So If changing them to numpy array,
It will be much faster without any functionality impacts.
The text was updated successfully, but these errors were encountered: