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
I recently updated to current theano dev version. While doing so, I noticed a significant slowdown when training keras models.
It looks like that GPUDNNReduction is much slower than previous used GpuCAReduceCuda. I tried to create a minimal example to reproduce the problem:
Thanks for the report. I have been able to reproduce it an an GTX750 too.
I'll open an issue with NVIDIA about this. Note, I modified your test to isolate more the dnn reduction time (so mostly, we don't move the data to the GPU inside the timing)
import numpy as np
import theano
import pygpu
from time import time
print('theano: {}'.format(theano.__version__))
print('pygpu: {}'.format(pygpu.__version__))
dtype = theano.config.floatX
sizes = [1000, 10000] # , 20000]
a = theano.shared(np.random.random((sizes[0], sizes[0])).astype(dtype))
f_max = theano.function([], a.max(axis=1))
f_min = theano.function([], a.min(axis=1))
f_sum = theano.function([], a.sum(axis=1))
# print graphs
funcs = {'max': f_max, 'min': f_min, 'sum': f_sum}
for f in funcs:
print(f)
theano.printing.debugprint(funcs[f], print_type=True)
# first call
funcs[f]()
# time execution
n_runs = 100
for f in funcs:
print(f)
for s in sizes:
data = np.random.random((s, s)).astype(dtype)
a.set_value(data)
t1 = time()
for i in range(n_runs):
funcs[f]()
print("{}x{}:\t{}".format(s, s, (time() - t1)/n_runs))
I recently updated to current theano dev version. While doing so, I noticed a significant slowdown when training keras models.
It looks like that GPUDNNReduction is much slower than previous used GpuCAReduceCuda. I tried to create a minimal example to reproduce the problem:
I tested both a Maxwell GPU (Titan X) and a Pascal GPU (GTX 1080Ti) which - for whatever reason - is slower than the Titan X:
When running with theano defaults the output looks like:
When running with
THEANO_FLAGS='optimizer_excluding=local_dnn_reduction'
:Currently, I ended up in disabling all related optimizers:
local_dnn_reduction
,local_cudnn_maxandargmax
,local_dnn_argmax
.The text was updated successfully, but these errors were encountered: