提交 bc0c3b4e authored 作者: nouiz's avatar nouiz

Merge pull request #613 from delallea/minor

Minor stuff (including a fix for a bug recently introduced)
...@@ -10,12 +10,12 @@ Bug fixes ...@@ -10,12 +10,12 @@ Bug fixes
* In Sparse sandbox, fix the grad of theano.sparse.sandbox.sp.row_scale. * In Sparse sandbox, fix the grad of theano.sparse.sandbox.sp.row_scale.
It did not return the right number of elements. (Frederic B.) It did not return the right number of elements. (Frederic B.)
* set_subtensor(x[int vector], new_value) when moved to the GPU * set_subtensor(x[int vector], new_value) when moved to the GPU
where transformed into inc_subtensor on the GPU. Now we have a slow was transformed into inc_subtensor on the GPU. Now we have a correct
GPU implementation. (but slow) GPU implementation.
Note: set_subtensor(x[slice[,...]], new_value) was working correctly Note 1: set_subtensor(x[slice[,...]], new_value) was working correctly
in all case as well as inc_subtensor(*, *). in all cases as well as inc_subtensor(*, *).
Note2: If your code have this behavior, we print a warning by default. Note 2: If your code was affected by the incorrect behavior, we now print
(Frederic B.) a warning by default (Frederic B.)
* Fixed an issue whereby config values were used as default arguments, * Fixed an issue whereby config values were used as default arguments,
with those defaults then stuck at old values if the config variables were with those defaults then stuck at old values if the config variables were
changed during program execution. (David W-F) changed during program execution. (David W-F)
...@@ -65,25 +65,24 @@ New Features ...@@ -65,25 +65,24 @@ New Features
(Frederic B., Simon McGregor) (Frederic B., Simon McGregor)
* MRG random now raises an error with a clear message when the passed shape * MRG random now raises an error with a clear message when the passed shape
contains dimensions with bad value like 0. (Frédéric B. reported by Ian G.) contains dimensions with bad value like 0. (Frédéric B. reported by Ian G.)
* "CudaNdarray[*] = ndarray" work in more case (Frederic B.) * "CudaNdarray[*] = ndarray" works in more cases (Frederic B.)
* "CudaNdarray[*] += ndarray" work in more case (Frederic B.) * "CudaNdarray[*] += ndarray" works in more cases (Frederic B.)
* We add dimensions to CudaNdarray to automatically broadcast more frequently. * We add dimensions to CudaNdarray to automatically broadcast more frequently.
(Frederic B.) (Frederic B.)
* theano.tensor.argsort that wrap numpy.argsort (Hani Almousli). * theano.tensor.argsort that wraps numpy.argsort (Hani Almousli).
* New theano flag cmodule.warn_no_version. Default False. If True, * New theano flag cmodule.warn_no_version. Default False. If True,
will print a warning when compiling one or more Op with c code that will print a warning when compiling one or more Op with C code that
can't be cached as there is no c_code_cache_version() function to at can't be cached because there is no c_code_cache_version() function
least of of those Ops. (Frederic B.) associated to at least one of those Ops. (Frederic B.)
* CPU alloc now always generate c code (Pascal L.) * CPU alloc now always generate C code (Pascal L.)
* New Theano flag cmodule.warn_no_version=False. When True, warn when an op * New Theano flag cmodule.warn_no_version=False. When True, warn when an op
with c code is not versionned. This force to recompile it everytimes. with C code is not versioned (which forces to recompile it everytimes).
(Frédéric B.) (Frédéric B.)
* Made a few Ops with c code versionned to reduce compilation time. * Made a few Ops with C code versioned to reduce compilation time.
(Frédéric B, Pascal L.) (Frédéric B, Pascal L.)
* C code reuses preallocated outputs (only done by Scan) (Pascal L.)
* c code reuse preallocated output(only done by Scan) (Pascal L.) * Garbage collection of intermediate results during Theano function calls
* gc of intermediate result during theano function call for op with c code for Ops with C code (Pascal L.)
(Pascal L.)
Sparse Sparse
* Implement theano.sparse.mul(sparse1, sparse2) when both inputs don't * Implement theano.sparse.mul(sparse1, sparse2) when both inputs don't
...@@ -278,7 +277,7 @@ New features: ...@@ -278,7 +277,7 @@ New features:
* theano.sandbox.cuda.cuda_ndarray.cuda_ndarray.mem_info() return free and total gpu memory (Frederic) * theano.sandbox.cuda.cuda_ndarray.cuda_ndarray.mem_info() return free and total gpu memory (Frederic)
* Theano flags compiledir_format. Keep the same default as before: compiledir_%(platform)s-%(processor)s-%(python_version)s. (Josh Bleecher Snyder) * Theano flags compiledir_format. Keep the same default as before: compiledir_%(platform)s-%(processor)s-%(python_version)s. (Josh Bleecher Snyder)
* We also support the "theano_version" substitution. * We also support the "theano_version" substitution.
* IntDiv c code (faster and allow this elemwise to be fused with other elemwise) (Pascal) * IntDiv C code (faster and allow this elemwise to be fused with other elemwise) (Pascal)
* Internal filter_variable mechanism in Type. (Pascal, Ian) * Internal filter_variable mechanism in Type. (Pascal, Ian)
* Ifelse works on sparse. * Ifelse works on sparse.
* It makes use of gpu shared variable more transparent with theano.function updates and givens parameter. * It makes use of gpu shared variable more transparent with theano.function updates and givens parameter.
...@@ -347,7 +346,7 @@ Crashes fixed: ...@@ -347,7 +346,7 @@ Crashes fixed:
* Fix runtime crash in gemm, dot22. FB * Fix runtime crash in gemm, dot22. FB
* Fix on 32bits computer: make sure all shape are int64.(Olivier) * Fix on 32bits computer: make sure all shape are int64.(Olivier)
* Fix to deque on python 2.4 (Olivier) * Fix to deque on python 2.4 (Olivier)
* Fix crash when not using c code (or using DebugMode) (not used by * Fix crash when not using C code (or using DebugMode) (not used by
default) with numpy 1.6*. Numpy has a bug in the reduction code that default) with numpy 1.6*. Numpy has a bug in the reduction code that
made it crash. (Pascal) made it crash. (Pascal)
* Crashes of blas functions (Gemv on CPU; Ger, Gemv and Gemm on GPU) * Crashes of blas functions (Gemv on CPU; Ger, Gemv and Gemm on GPU)
......
...@@ -563,13 +563,13 @@ import theano and print the config variable, as in: ...@@ -563,13 +563,13 @@ import theano and print the config variable, as in:
Bool value, default: False Bool value, default: False
If True, will print a warning when compiling one or more Op with c If True, will print a warning when compiling one or more Op with C
code that can't be cached as there is no c_code_cache_version() code that can't be cached because there is no c_code_cache_version()
function to at least of of those Ops. function associated to at least one of those Ops.
.. attribute:: config.cmodule.mac_framework_link .. attribute:: config.cmodule.mac_framework_link
Bool value, default: False Bool value, default: False
If set to True, breaks certain mac installations with the infamous If set to True, breaks certain MacOS installations with the infamous
Bus Error. Bus Error.
...@@ -317,7 +317,7 @@ AddConfigVar('warn.subtensor_merge_bug', ...@@ -317,7 +317,7 @@ AddConfigVar('warn.subtensor_merge_bug',
AddConfigVar('warn.gpu_set_subtensor1', AddConfigVar('warn.gpu_set_subtensor1',
"Warn if previous versions of Theano (before 0.6) could have given " "Warn if previous versions of Theano (before 0.6) could have given "
"incorrect results when moving to the gpu" "incorrect results when moving to the gpu "
"set_subtensor(x[int vector], new_value)", "set_subtensor(x[int vector], new_value)",
BoolParam(warn_default('0.6')), BoolParam(warn_default('0.6')),
in_c_key=False) in_c_key=False)
......
...@@ -27,14 +27,17 @@ from theano.gof.cc import hash_from_code ...@@ -27,14 +27,17 @@ from theano.gof.cc import hash_from_code
import compilelock import compilelock
from theano.configparser import AddConfigVar, BoolParam from theano.configparser import AddConfigVar, BoolParam
AddConfigVar('cmodule.mac_framework_link', AddConfigVar('cmodule.mac_framework_link',
("If set to True, breaks certain mac installations with the infamous " "If set to True, breaks certain MacOS installations with the infamous "
"Bus Error"), "Bus Error",
BoolParam(False)) BoolParam(False))
AddConfigVar('cmodule.warn_no_version', AddConfigVar('cmodule.warn_no_version',
"If True, will print a warning when compiling one or more Op with" "If True, will print a warning when compiling one or more Op "
"c code that can't be cached as there is no c_code_cache_version" "with C code that can't be cached because there is no "
"() function to at least of of those Ops.", "c_code_cache_version() function associated to at least one of "
"those Ops.",
BoolParam(False)) BoolParam(False))
...@@ -969,7 +972,7 @@ class ModuleCache(object): ...@@ -969,7 +972,7 @@ class ModuleCache(object):
if isinstance(k, theano.Op)] if isinstance(k, theano.Op)]
_logger.warning("not all the" _logger.warning("not all the"
" following op(s) implement" " following op(s) implement"
" c_code_cache_version(). This make them" " c_code_cache_version(). This makes them"
" recompiled for each process." + str(ops)) " recompiled for each process." + str(ops))
# Map the new module to its KeyData object. Note that # Map the new module to its KeyData object. Note that
...@@ -1437,7 +1440,7 @@ class GCC_compiler(object): ...@@ -1437,7 +1440,7 @@ class GCC_compiler(object):
#TODO: Do not do the dlimport in this function #TODO: Do not do the dlimport in this function
if include_dirs is None: if include_dirs is None:
preargs = [] include_dirs = []
if lib_dirs is None: if lib_dirs is None:
lib_dirs = [] lib_dirs = []
if libs is None: if libs is None:
......
...@@ -1939,10 +1939,10 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp): ...@@ -1939,10 +1939,10 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
return Apply(self, [x_, y_, ilist_], [x_.type()]) return Apply(self, [x_, y_, ilist_], [x_.type()])
# CudaNdarray_Subscript() don't support Advanced slicing. # CudaNdarray_Subscript() doesn't support Advanced slicing.
# But we can't use the parent version that loop on each indices # But we can't use the parent version that loops on each index
# as we also need to loop when set_instead_of_inc is True and the # as we also need to loop when set_instead_of_inc is True and the
# parent don't loop in that case. # parent doesn't loop in that case.
def perform(self, node, inp, out_): def perform(self, node, inp, out_):
# TODO opt to make this inplace # TODO opt to make this inplace
x, y, idx = inp x, y, idx = inp
...@@ -1950,7 +1950,7 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp): ...@@ -1950,7 +1950,7 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
if not self.inplace: if not self.inplace:
x = x.copy() x = x.copy()
if self.set_instead_of_inc: if self.set_instead_of_inc:
# CudaNdarray __setitem__ don't do broadcast nor support # CudaNdarray __setitem__ doesn't do broadcast nor support
# list of index. # list of index.
assert y.ndim <= x.ndim # Should be guaranteed by `make_node` assert y.ndim <= x.ndim # Should be guaranteed by `make_node`
if y.ndim == x.ndim: if y.ndim == x.ndim:
......
...@@ -1066,7 +1066,7 @@ CudaNdarray_inplace_elemwise(PyObject* py_self, PyObject * py_other, operator_t ...@@ -1066,7 +1066,7 @@ CudaNdarray_inplace_elemwise(PyObject* py_self, PyObject * py_other, operator_t
PyErr_SetString( PyErr_SetString(
PyExc_ValueError, PyExc_ValueError,
"CudaNdarray_inplace_elemwise cannot work inplace on" "CudaNdarray_inplace_elemwise cannot work inplace on"
" un-initialized array when the new value have more then" " un-initialized array when the new value have more than"
" 0 or 1 broadcastable dimensions"); " 0 or 1 broadcastable dimensions");
Py_XDECREF(new_other); Py_XDECREF(new_other);
return 0; return 0;
...@@ -2799,9 +2799,9 @@ int CudaNdarray_CopyFromCudaNdarray(CudaNdarray * self, ...@@ -2799,9 +2799,9 @@ int CudaNdarray_CopyFromCudaNdarray(CudaNdarray * self,
if (self->nd < other->nd) if (self->nd < other->nd)
{ {
PyErr_Format(PyExc_NotImplementedError, PyErr_Format(PyExc_NotImplementedError,
"CudaNdarray_CopyFromCudaNdarray: The destination need more or the" "CudaNdarray_CopyFromCudaNdarray: The number of dimensions of the "
" same number of dimensions then the source. Got %d and %d.", "destination needs to be >= the number of dimensions of the "
self->nd, other->nd); "source. Got %d and %d.", self->nd, other->nd);
return -1; return -1;
} }
else if (self->nd != other->nd) else if (self->nd != other->nd)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论