[theano-users] Re: Does theano compute parallel branches in parallel?

2017-04-19 Thread Patric
Could you share your model with us? We'd like to take a look :)

On Tuesday, April 18, 2017 at 5:24:30 PM UTC+8, Sharapolas wrote:
>
> I have a computation tree and am implementing leaf node evalutions. In 
> theano graph do paralle branches get evaluated in parallel on the GPU?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] improving fft performance on cpu

2017-04-19 Thread Frédéric Bastien
Now, mkl is available in conda freely for everybody. You don't need the
accelerate packages, just a recent enough conda. On older conda, you can
update it, it don't need a new installation.

Fred

On Wed, Apr 19, 2017 at 2:12 PM Jesse Livezey 
wrote:

> From tests I've done, the MKL fft library is comparable and sometimes
> faster than the FFTW package. Both are much faster than the numpy fft. It's
> available in the accelerate package from Continuum (mkl conda package only
> has blas).
>
> It also looks like intel has a free conda channel, which builds scipy and
> numpy against MKL
>
> https://software.intel.com/en-us/forums/intel-distribution-for-python/topic/713736
>
> On Wednesday, April 19, 2017 at 10:54:33 AM UTC-7, nouiz wrote:
>
>> Blas won't help for fft. So you would need a faster fft library then what
>> we use and modify the perform() method of those ops to use that new lib.
>>
>> FFTW is one possible faster implementation. There is others. I can't
>> comment on which one would be better. Search the web, I recall seeing some
>> people comparing fft lib that is available in python.
>>
>> If you modify those ops for that, pushing upstream those change would be
>> great.
>>
>> Fred
>>
>>
>>
>> On Tue, Apr 18, 2017 at 12:16 PM  wrote:
>>
> Hi,
>>>
>>> I have implemented a layer which uses functions theano.tensor.fft.rfft
>>> and theano.tensor.fft.irfft. What might be the best way to improve the
>>> speed of that layer on cpu? Installing FFTW, an optimized BLAS library?
>>>
>>> Thanks
>>> Cha.
>>>
>>> --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "theano-users" group.
>>>
>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to theano-users...@googlegroups.com.
>>
>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] Error when switching to the gpuarray backend

2017-04-19 Thread Frédéric Bastien
There is a problem with your installation of cudnn. Theano does not install
it automatically for you. Check cudnn installation guide.

cudnn isn't mandatory, which Theano flags do you use? Normally, it should
fall back to not using it.

Fred

On Thu, Apr 13, 2017 at 10:31 AM Master J  wrote:

> Hi,
> I am using theano 0.9 and I followed the guide in the warning below
> to switch to the gpuarray backend.
>
> WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be
> removed in the next release (v0.10).  Please switch to the gpuarray
> backend. You can get more information about how to switch at this URL:
>
> https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
>
> However, an error occurred when I run with 'device = cuda' in
> the .theanorc.txt.
>
> Can not use cuDNN on context None: cannot compile with cuDNN. We got this
> error:
> c:\users\j\appdata\local\temp\try_flags_vtfzt8.c:4:19: fatal error:
> cudnn.h: No such file or directory
> compilation terminated.
>
> I have tried some ways but all failed. Can someone help me?Thank you!
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] improving fft performance on cpu

2017-04-19 Thread Jesse Livezey
>From tests I've done, the MKL fft library is comparable and sometimes 
faster than the FFTW package. Both are much faster than the numpy fft. It's 
available in the accelerate package from Continuum (mkl conda package only 
has blas).

It also looks like intel has a free conda channel, which builds scipy and 
numpy against MKL
https://software.intel.com/en-us/forums/intel-distribution-for-python/topic/713736

On Wednesday, April 19, 2017 at 10:54:33 AM UTC-7, nouiz wrote:
>
> Blas won't help for fft. So you would need a faster fft library then what 
> we use and modify the perform() method of those ops to use that new lib.
>
> FFTW is one possible faster implementation. There is others. I can't 
> comment on which one would be better. Search the web, I recall seeing some 
> people comparing fft lib that is available in python.
>
> If you modify those ops for that, pushing upstream those change would be 
> great.
>
> Fred
>
>
>
> On Tue, Apr 18, 2017 at 12:16 PM  wrote:
>
>> Hi,
>>
>> I have implemented a layer which uses functions theano.tensor.fft.rfft 
>> and theano.tensor.fft.irfft. What might be the best way to improve the 
>> speed of that layer on cpu? Installing FFTW, an optimized BLAS library?
>>
>> Thanks
>> Cha.
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "theano-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to theano-users...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] Re: IfElse GPU version

2017-04-19 Thread Frédéric Bastien
It is more efficient then what you describe.

The condition is evaluate first and is:
- completly evaluated on CPU
- or transfered to the CPU.

Then we will evaluate one of the two branches depending of the result of
the condition. All those evaluation can be on the GPU. It won't transfer
them to the CPU.

The only inneficiency is that sometimes, both branches get completly
evaluated. This can be fixed by disabling some other optimization, but this
have its own problem. If you want to try that, use the Theano flag:
optimizer_excluding=inplace

The other non-efficiency is that if the else branch is taken, we will do a
copy of that value. But the copy should stay on the device device where the
original data is (so CPU or GPU).

Fred

On Fri, Mar 24, 2017 at 12:34 PM Šarūnas S.  wrote:

> I am using theano version 0.9.0.rc2.dev version.
>
>
>
>
> On Friday, 24 March 2017 17:32:33 UTC+1, Šarūnas S. wrote:
>>
>> In my graph I have a few IfElse nodes and I am wondering how and where
>> they are executed.
>>
>> At first I ran the code with linker=cvm in my THEANO_FLAGS but after
>> profiling it looked like the ifelse is being executed on the CPU. Then I
>> forced the linker=c to check whether the IfElse will go through and I got
>> the NotImplementedError: if{inplace, gpu} cannot produce C code. Btw
>> removing inline optimization did not help as it still gave the same error.
>>
>> So does IfElse have a GPU implementation? If yes how do I use it? Also,
>> does it do lazy evaluation or not?
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] Re: TypeError: Cannot convert Type TensorType(float64, matrix) (of Variable Elemwise{add,no_inplace}.0) into Type TensorType(float32, matrix)

2017-04-19 Thread Frédéric Bastien
This error probably come from using the updates parameter of
theano.function().

In it, you probably tell Theano that you want the new value of a shared
variable will be of dtype float64, while the original value is float32.

Adam comment is responsible most of the type for this type of problems.

You can use the Theano flag warn_float64=pdb to find where the upcast
happen in your code.

Fred

On Tue, Apr 18, 2017 at 3:50 AM Adam Becker  wrote:

> I encountered something similar a few days ago. Turned out float32 divided
> by int32 gave float64. This is consistent with numpy behavior, a bit weird,
> but true. No sure if related.
>
> In general, traversing the graph (prior to compilation) to find the
> problematic nodes can be helpful.
>
>
> On Sunday, April 16, 2017 at 10:44:49 PM UTC+8, Justin Wilson wrote:
>>
>> I've set THEANO_FLAGS such that floatX=float32 and type casted to float32 
>> throughout the code. Is there a way to set allow_convert = True so that can 
>> convert from float64 to float32 for Variable Elemwise{add,no_inplace}.0). 
>> I'm new to group and first post so let me know if any additional info would 
>> be helpful.
>>
>>
>> ---TypeError
>>  Traceback (most recent call 
>> last)/home/wilson/anaconda3/lib/python3.5/site-packages/theano/compile/pfunc.py
>>  in rebuild_collect_shared(outputs, inputs, replace, updates, 
>> rebuild_strict, copy_inputs_over, no_default_updates)192 
>> update_val = store_into.type.filter_variable(update_val,--> 193  
>> allow_convert=False)194  
>>except TypeError:
>> /home/wilson/anaconda3/lib/python3.5/site-packages/theano/tensor/type.py in 
>> filter_variable(self, other, allow_convert)234  
>> other=other,--> 235  self=self))236
>> TypeError: Cannot convert Type TensorType(float64, matrix) (of Variable 
>> Elemwise{add,no_inplace}.0) into Type TensorType(float32, matrix). You can 
>> try to manually convert Elemwise{add,no_inplace}.0 into a 
>> TensorType(float32, matrix).
>>
>> During handling of the above exception, another exception occurred:
>> TypeError Traceback (most recent call 
>> last) in () 78  79 t = 
>> time()---> 80 train_g = theano.function([X, Z], cost, updates=g_updates) 
>> 81 train_d = theano.function([X, Z], cost, updates=d_updates) 82 gen = 
>> theano.function([Z], gX)
>> /home/wilson/anaconda3/lib/python3.5/site-packages/theano/compile/function.py
>>  in function(inputs, outputs, mode, updates, givens, no_default_updates, 
>> accept_inplace, name, rebuild_strict, allow_input_downcast, profile, 
>> on_unused_input)324on_unused_input=on_unused_input,  
>>   325profile=profile,--> 326
>> output_keys=output_keys)327 # We need to add the flag check_aliased 
>> inputs if we have any mutable or328 # borrowed used defined inputs
>> /home/wilson/anaconda3/lib/python3.5/site-packages/theano/compile/pfunc.py 
>> in pfunc(params, outputs, mode, updates, givens, no_default_updates, 
>> accept_inplace, name, rebuild_strict, allow_input_downcast, profile, 
>> on_unused_input, output_keys)447 
>>  rebuild_strict=rebuild_strict,448   
>>copy_inputs_over=True,--> 449  
>> no_default_updates=no_default_updates)450 # extracting the arguments 
>>451 input_variables, cloned_extended_outputs, other_stuff = 
>> output_vars
>> /home/wilson/anaconda3/lib/python3.5/site-packages/theano/compile/pfunc.py 
>> in rebuild_collect_shared(outputs, inputs, replace, updates, rebuild_strict, 
>> copy_inputs_over, no_default_updates)206' 
>> function to remove broadcastable dimensions.')207 --> 208 
>> raise TypeError(err_msg, err_sug)209 assert update_val.type == 
>> store_into.type210
>> TypeError: ('An update must have the same type as the original shared 
>> variable (shared_var=, 
>> shared_var.type=TensorType(float32, matrix), 
>> update_val=Elemwise{add,no_inplace}.0, update_val.type=TensorType(float64, 
>> matrix)).', 'If the difference is related to the broadcast pattern, you can 
>> call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to 
>> remove broadcastable dimensions.')
>>
>> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed 

Re: [theano-users] Re: RuntimeError: Mixed dnn version. The header is version 5105 while the library is version 5110.

2017-04-19 Thread Frédéric Bastien
If after that, you still have the problem, search in your filesystem file
like cudnn.h and libcudnn.so. There is another place where cudnn is
installed and it conflict with your new installed version.

Fred

On Tue, Apr 18, 2017 at 10:52 AM Robert Lee  wrote:

> Yes I copied the cudnn files using the following two commands:
> $sudo cp lib64/* /usr/local/cuda/lib64/
> $sudo cp include/* /usr/local/cuda/include/
>
> When I initially had this problem I purged cuda and the nvidia drivers,
> then I renamed the '/usr/local/cuda' and '/usr/local/cuda-8.0' directories
> and reinstalled cuda and nvidia.  This was to make sure that the files in
> these directories would only  come from the latest installation.
>
>
>
> On Monday, 17 April 2017 21:19:00 UTC-7, Jesse Livezey wrote:
>>
>> Sounds like the cudnn header and libraries are not consistent. When you
>> install cudnn, did you move all of the files into the correct cuda folders?
>>
>> On Monday, April 17, 2017 at 8:30:03 PM UTC-7, Robert Lee wrote:
>>>
>>> I'm trying to get theano to work with keras.  My program runs fine with
>>> tensorflow but when I switch to theano I get the above error message.  My
>>> theano version is 0.9.0.  I'd appreciate any help in figuring this out.
>>>
>> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] Re: convolution using fft on same size image and filter

2017-04-19 Thread Frédéric Bastien
Did you speed compare it to CorrMM implementation?

Fred

On Tue, Apr 18, 2017 at 11:49 AM  wrote:

> I was able to pull that out. I may post later my solution if anybody is
> interested.
>
> Best,
> Cha.
>
>
> On Monday, April 17, 2017 at 2:17:20 PM UTC-4, c...@ditto.us.com wrote:
>>
>> Hi,
>>
>> I want to perform a convolution operation using fft. My filter and image
>> are same size i.e (nb_channel, nb_row, nb_col). Numpy version of what I
>> would like to do is below.
>>
>>
>> def conv2dfft_op(input, filter):
>> '''
>> Parameters
>> --
>> input: symbolic 3D tensor of shape
>> (stack size, nb row, nb col)
>> filter: symbolic 3D tensor of shape
>> (stack size, nb row, nb col)
>> '''
>>
>> # initialize the accumulator
>> conv_out = np.zeros(input.shape[1:]).astype('float32')
>>
>> # go over each channel and perform 2d convolution
>> for in_channel,f_channel in zip(input,filter):
>> # accumulate the result
>> conv_out +=
>> np.fft.irfft2(np.fft.rfft2(in_channel)*np.fft.rfft2(f_channel))
>> return conv_out
>>
>>
>> I would appreciate if anyone can help me to write an efficient Theano
>> version.
>>
>> Best,
>> Cha.
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] cuda_ndarray.cu can't be compiled (win10)

2017-04-19 Thread Frédéric Bastien
You are using the old Theano gpu back-end. Its installation on Windows was
very complicated. I strongly recommand to use the new gpu back-end. Its
installation on windows is much simpler. We also don't have time to help
with the old back-end anymore. See this doc to use the new back-end:

https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

Fred

On Thu, Apr 13, 2017 at 12:50 AM davidstarx 
wrote:

>
> down votefavorite
> 
>
> I builded and executed deviceQuery.exe with VS2015, and the result was
> Pass, but when I test theano with the code below, some errors occurred.
>
> from theano import function, config, shared, tensorimport numpyimport time
>
> vlen = 10 * 30 * 768  # 10 x #cores x # threads per core
> iters = 1000
>
> rng = numpy.random.RandomState(22)
> x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
> f = function([], tensor.exp(x))print(f.maker.fgraph.toposort())
> t0 = time.time()for i in range(iters):
> r = f()
> t1 = time.time()print("Looping %d times took %f seconds" % (iters, t1 - 
> t0))print("Result is %s" % (r,))if numpy.any([isinstance(x.op, 
> tensor.Elemwise) and
>   ('Gpu' not in type(x.op).__name__)
>   for x in f.maker.fgraph.toposort()]):
> print('Used the cpu')else:
> print('Used the gpu')
>
> Error:
>
> c1xx: fatal error C1083: Cannot open source file: 'mod.cu': No such file or 
> directory
> nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are 
> deprecated, and may be removed in a future release (Use 
> -Wno-deprecated-gpu-targets to suppress warning).
> mod.cu
> ['nvcc', '-shared', '-O3', '-LC:\\Users\\asus\\Anaconda3\\envs\\DL\\libs', 
> '-use_fast_math', '--compiler-bindir', 'C:\\Program Files (x86)\\Microsoft 
> Visual Studio 14.0\\VC\\bin\\x86_amd64', '-Xlinker', '/DEBUG', '-D 
> HAVE_ROUND', '-m64', '-Xcompiler', 
> '-DCUDA_NDARRAY_CUH=mc72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD',
>  
> '-I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\lib\\site-packages\\theano\\sandbox\\cuda"',
>  
> '-I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\lib\\site-packages\\numpy\\core\\include"',
>  '-I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\include"', 
> '-I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\lib\\site-packages\\theano\\gof"', 
> '-L"C:\\Users\\asus\\Anaconda3\\envs\\DL\\libs"', 
> '-L"C:\\Users\\asus\\Anaconda3\\envs\\DL"', '-o', 
> 'C:\\Users\\asus\\AppData\\Local\\Theano\\compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.5.3-64\\cuda_ndarray\\cuda_ndarray.pyd',
>  'mod.cu', '-lcublas', '-lpython35', '-lcudart']
> ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return 
> status', 2, 'for cmd', 'nvcc -shared -O3 
> -LC:\\Users\\asus\\Anaconda3\\envs\\DL\\libs -use_fast_math --compiler-bindir 
> C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\x86_amd64 
> -Xlinker /DEBUG -D HAVE_ROUND -m64 -Xcompiler 
> -DCUDA_NDARRAY_CUH=mc72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD
>  
> -I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\lib\\site-packages\\theano\\sandbox\\cuda"
>  
> -I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\lib\\site-packages\\numpy\\core\\include"
>  -I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\include" 
> -I"C:\\Users\\asus\\Anaconda3\\envs\\DL\\lib\\site-packages\\theano\\gof" 
> -L"C:\\Users\\asus\\Anaconda3\\envs\\DL\\libs" 
> -L"C:\\Users\\asus\\Anaconda3\\envs\\DL" -o 
> C:\\Users\\asus\\AppData\\Local\\Theano\\compiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.5.3-64\\cuda_ndarray\\cuda_ndarray.pyd
>  mod.cu -lcublas -lpython35 -lcudart')
> WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be 
> removed in the next release (v0.10).  Please switch to the gpuarray backend. 
> You can get more information about how to switch at this URL:
>  
> https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
>
> WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not 
> available  (error: cuda unavailable)
>
> It seems that cuda_ndarray.cu can't be compiled, but I can't figure out
> the reason.
>
> My .theanorc file
>
> [global]
>
> openmp=False
>
> device = gpu
>
> optimizer_including=cudnn
>
> floatX = float32
>
> allow_input_downcast=True
> [lib]
>
> cnmem = 0.8
> [blas]
>
> ldflags=
> [gcc]
>
> cxxflags=-IC:\Users\asus\Anaconda3\envs\DL\MinGW
> [nvcc]
>
> flags = -LC:\Users\asus\Anaconda3\envs\DL\libs
>
> compiler_bindir = C:\Program Files (x86)\Microsoft Visual Studio 
> 14.0\VC\bin\x86_amd64
>
> fastmath = True
>
> cuda version : 8.0
>
> cuDNN version : 5.1
>
> theano version : 0.9.0 (conda install theano)
>
> visual studio version : 2015
>
> operating system : win10 (64-bit)
>
> python version : 3.5.3 (64-bit)
>
> I have spent over 15 hours googling 

Re: [theano-users] why inc_subtensor doesn't work with me ?

2017-04-19 Thread Frédéric Bastien
I'm not able to tell the problem with this partial error. Can you give the
full error?

Fred

On Fri, Apr 14, 2017 at 4:16 AM Feras Almasri  wrote:

> def increment_odd(x):
> return T.inc_subtensor(x[1::2], 1.)
>
>
> x = T.vector()
>
> xv = np.zeros((4,), dtype=x.dtype)
> yv = increment_odd(x).eval({x:xv})
>
>
>
> Hello I'm implementing this simple code to test inc_subtensor, which give
> me this error
>
>>
>> RuntimeError: Error doing inplace add
>> Apply node that caused the error:
>> GpuIncSubtensor{InplaceInc;::}(GpuFromHost.0, GpuArrayConstant{1.0})
>> Toposort index: 1
>> Inputs types: [GpuArrayType(float32, (False,)),
>> GpuArrayType(float32, ())]
>> Inputs shapes: [(4,), ()]
>> Inputs strides: [(4,), ()]
>> Inputs values: [gpuarray.array([ 0., 0., 0., 0.], dtype=float32),
>> gpuarray.array(1.0, dtype=float32)]
>> Outputs clients:
>> [[HostFromGpu(gpuarray)(GpuIncSubtensor{InplaceInc;::}.0)]]
>
>
> So I tested set_subtensor and it worked with me. what is wrong in this
> implementation ?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] improving fft performance on cpu

2017-04-19 Thread Frédéric Bastien
Blas won't help for fft. So you would need a faster fft library then what
we use and modify the perform() method of those ops to use that new lib.

FFTW is one possible faster implementation. There is others. I can't
comment on which one would be better. Search the web, I recall seeing some
people comparing fft lib that is available in python.

If you modify those ops for that, pushing upstream those change would be
great.

Fred



On Tue, Apr 18, 2017 at 12:16 PM  wrote:

> Hi,
>
> I have implemented a layer which uses functions theano.tensor.fft.rfft
> and theano.tensor.fft.irfft. What might be the best way to improve the
> speed of that layer on cpu? Installing FFTW, an optimized BLAS library?
>
> Thanks
> Cha.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] TypeError: iteration over a 0-d array

2017-04-19 Thread Frédéric Bastien
I'm not able to help with the information provided. I will need at least
the full error message. If you also a script that reproduce that, it could
also help.

Fred

On Wed, Apr 19, 2017 at 3:15 AM Arthi Venkataraman 
wrote:

> Hi,
> Getting TypeError: iteration over a 0-d array  with Theano version
> '0.9.0.dev-388805f946685e86225cdf602eb8a4f0059f9667'
>
> Happens when calling the defined function.
> self.trainfunc =
> theano.function([inquery,inmemory,learningrate,yin,yin1,yin2,yin4],
> cost,updates=updates,allow_input_downcast = True)
>
> cost,v1,v2,v3 = mem_network.trainfunc(query,data_train,
> learningrate,yval1,yval,yval2,yval)
>
> Error does not come when running the same in debug mode as called below :
> mode =
> theano.compile.MonitorMode(post_func=detect_nan).excluding('local_elemwise_fusion',
> 'inplace')
> self.trainfunc =
> theano.function([inquery,inmemory,learningrate,yin,yin1,yin2,yin4],
> [cost,v1,v2,output],updates=updates,allow_input_downcast = True, mode=mode)
>
> There are no zero dimensional arrays in the call.
> These are the values of the parameters.
> query = np.zeros((sent_len),dtype=np.int)
>  yval1 = numpy.zeros((batch_size,sent_len,embsize),dtype=numpy.float64)  #
> Batchsize * Seqlen * Emb dim  3d
>   yval = numpy.zeros((batch_size,sent_len,embsize),dtype=numpy.float64)  #
> Batchsize * Seqlen * Emb dim 3d
>   yval2 = numpy.zeros((sent_len,vocabsize),dtype=numpy.float64)  # Seqlen
> * Vocabsize 2d
>
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] Optimization failure

2017-04-19 Thread Frédéric Bastien
Hi,

this seem to be a problem in your environment. Something try to enable
OpenMP, but your compiler seem to not support it. It seem an old g++
version. But something seem to have it enabled.

Do you mix multiple g++ in your environment?

Fred

On Wed, Apr 19, 2017 at 9:17 AM Siva Reddy Gangireddy <
sivareddy...@gmail.com> wrote:

> Hi,
>
> Optimization failure error. Any suggestions on this.
>
> 2017-04-19 16:10:16,895 warn: Optimization failure due to: constant_folding
> 2017-04-19 16:10:16,896 warn: node:
> Elemwise{Cast{float32}}(TensorConstant{(1, 1, 1) of 0})
> 2017-04-19 16:10:16,896 warn: TRACEBACK:
> 2017-04-19 16:10:16,896 warn: Traceback (most recent call last):
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/opt.py",
> line 1996, in process_node
> replacements = lopt.transform(node)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/tensor/opt.py",
> line 6497, in constant_folding
> no_recycling=[], impl=impl)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/op.py",
> line 935, in make_thunk
> no_recycling)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/op.py",
> line 839, in make_c_thunk
> output_storage=node_output_storage)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
> line 1190, in make_thunk
> keep_lock=keep_lock)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
> line 1131, in __compile__
> keep_lock=keep_lock)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
> line 1586, in cthunk_factory
> key=key, lnk=self, keep_lock=keep_lock)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cmodule.py",
> line 1159, in module_from_key
> module = lnk.compile_cmodule(location)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
> line 1489, in compile_cmodule
> preargs=preargs)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cmodule.py",
> line 2348, in compile_str
> return dlimport(lib_filename)
>   File
> "/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cmodule.py",
> line 302, in dlimport
> rval = __import__(module_name, {}, {}, [module_name])
> ImportError:
> /tmp/theano/compiledir_Linux-3.10-el7.x86_64-x86_64-with-centos-7.3.1611-Core-x86_64-3.6.0-64/tmp_ooo8vrt/m6d5ed1ac7ff4333b2cf57ce9d9852750.so:
> undefined symbol: GOMP_parallel
>
> ---
> Siva
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to theano-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Optimization failure

2017-04-19 Thread Siva Reddy Gangireddy
Hi,

Optimization failure error. Any suggestions on this.

2017-04-19 16:10:16,895 warn: Optimization failure due to: constant_folding
2017-04-19 16:10:16,896 warn: node: 
Elemwise{Cast{float32}}(TensorConstant{(1, 1, 1) of 0})
2017-04-19 16:10:16,896 warn: TRACEBACK:
2017-04-19 16:10:16,896 warn: Traceback (most recent call last):
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/opt.py",
 
line 1996, in process_node
replacements = lopt.transform(node)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/tensor/opt.py",
 
line 6497, in constant_folding
no_recycling=[], impl=impl)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/op.py",
 
line 935, in make_thunk
no_recycling)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/op.py",
 
line 839, in make_c_thunk
output_storage=node_output_storage)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
 
line 1190, in make_thunk
keep_lock=keep_lock)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
 
line 1131, in __compile__
keep_lock=keep_lock)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
 
line 1586, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cmodule.py",
 
line 1159, in module_from_key
module = lnk.compile_cmodule(location)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cc.py",
 
line 1489, in compile_cmodule
preargs=preargs)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cmodule.py",
 
line 2348, in compile_str
return dlimport(lib_filename)
  File 
"/scratch/elec/puhe/Modules/opt/Theano/Theano-bd1a12e/lib/python3.6/site-packages/Theano-0.9.0-py3.6.egg/theano/gof/cmodule.py",
 
line 302, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ImportError: 
/tmp/theano/compiledir_Linux-3.10-el7.x86_64-x86_64-with-centos-7.3.1611-Core-x86_64-3.6.0-64/tmp_ooo8vrt/m6d5ed1ac7ff4333b2cf57ce9d9852750.so:
 
undefined symbol: GOMP_parallel

---
Siva

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] TypeError: iteration over a 0-d array

2017-04-19 Thread Arthi Venkataraman
Hi, 
Getting TypeError: iteration over a 0-d array  with Theano version
'0.9.0.dev-388805f946685e86225cdf602eb8a4f0059f9667'

Happens when calling the defined function.
self.trainfunc = 
theano.function([inquery,inmemory,learningrate,yin,yin1,yin2,yin4], 
cost,updates=updates,allow_input_downcast = True) 

cost,v1,v2,v3 = mem_network.trainfunc(query,data_train, 
learningrate,yval1,yval,yval2,yval) 

Error does not come when running the same in debug mode as called below :
mode = 
theano.compile.MonitorMode(post_func=detect_nan).excluding('local_elemwise_fusion',
 
'inplace')
self.trainfunc = 
theano.function([inquery,inmemory,learningrate,yin,yin1,yin2,yin4], 
[cost,v1,v2,output],updates=updates,allow_input_downcast = True, mode=mode) 

There are no zero dimensional arrays in the call.
These are the values of the parameters.
query = np.zeros((sent_len),dtype=np.int)
 yval1 = numpy.zeros((batch_size,sent_len,embsize),dtype=numpy.float64)  # 
Batchsize * Seqlen * Emb dim  3d
  yval = numpy.zeros((batch_size,sent_len,embsize),dtype=numpy.float64)  # 
Batchsize * Seqlen * Emb dim 3d
  yval2 = numpy.zeros((sent_len,vocabsize),dtype=numpy.float64)  # Seqlen * 
Vocabsize 2d
  



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.