提交 2d7e59ca authored 作者: nouiz's avatar nouiz

Merge pull request #14 from dwf/install_fixes

Fixes to CentOS instructions, etc.
...@@ -79,9 +79,10 @@ Linux ...@@ -79,9 +79,10 @@ Linux
CentOS 6 CentOS 6
~~~~~~~~ ~~~~~~~~
:ref:`install_centos6` on how to install Theano on CentOS 6 :ref:`install_centos6` provides instructions on how to install Theano on CentOS
made by us. It cover how to install Theano on the CPU with the 6, written by the Theano developers. It covers how to install Theano (for
distribution packages atlas, a free fast implementation of Blas. CPU-based computation only) with the distribution-packaged ATLAS, a free fast
implementation of BLAS.
.. Cent OS 6 .. Cent OS 6
...@@ -178,8 +179,8 @@ The following command will update Theano and Numpy/Scipy (warning bellow): ...@@ -178,8 +179,8 @@ The following command will update Theano and Numpy/Scipy (warning bellow):
If you installed numpy/scipy with yum/apt-get, updating numpy/scipy If you installed numpy/scipy with yum/apt-get, updating numpy/scipy
this way is not always a good idea. This can make Theano crash due to this way is not always a good idea. This can make Theano crash due to
problem with Blas (We will try to fix them). But, this can also result problem with BLAS (We will try to fix them). But, this can also result
in slower version of Theano and Numpy. To fix the crash, you can in slower version of Theano and NumPy. To fix the crash, you can
delete Theano cache like this: delete Theano cache like this:
.. code-block:: bash .. code-block:: bash
......
...@@ -2,99 +2,99 @@ ...@@ -2,99 +2,99 @@
.. _install_centos6: .. _install_centos6:
Easy Installation of Theano optimized on CentOS 6 Easy Installation of an optimized Theano on CentOS 6
================================================= ====================================================
.. note:: .. note::
It is possible to have a faster installation of Theano. But this It is possible to have a faster installation of Theano than the one these
make the installation more complicated or request that you buy instructions will provide, but this will make the installation more
software. So this is a simple installation instruction that give a complicated and/or may require that you buy software. This is a simple set
relatively well optimized version that use only free of installation instructions that will leave you with a relatively
software. With more work or with money, you can have a faster well-optimized version that uses only free software. With more work or by
installation. investing money (i.e. buying a license to a proprietary BLAS
implementation), it is possible to gain further performance.
The differences between those faster version are related to blas
libraries.
.. note:: .. note::
This procedure make Theano use only 1 thread for all blas These instructions will result in Theano using only 1 thread for all BLAS
function. See note 1 about faster version. The other blas function calls. See the note above; other BLAS implementations can employ
libraries can work in parallel. multithreading to speed up computation.
.. note:: .. note::
If you are under a proxy, you must do some extra configuration step If you are behind a proxy, you must do some extra configuration steps
bedofore staring the installation. You must set the environment before starting the installation. You must set the environment
variable ``http_proxy`` to the proxy like this under bash: variable ``http_proxy`` to the proxy address. Using bash this is
accomplished with the command
``export http_proxy="http://user:pass@my.site:port/"`` ``export http_proxy="http://user:pass@my.site:port/"``
You can also give the ``--proxy=[user:pass@]url:port`` parameter You can also provide the ``--proxy=[user:pass@]url:port`` parameter
to pip. [user:pass@] is optional. to pip. The ``[user:pass@]`` portion is optional.
.. note:: .. note::
We use pip for 2 reasons. First to allow "import module; We use ``pip`` for 2 reasons. First, it allows "``import module;
module.test()" to work correctly. Second, the installation of numpy module.test()``" to work correctly. Second, the installation of NumPy
1.6 or 1.6.1 with easy_intall raise an import error at the end of 1.6 or 1.6.1 with ``easy_install`` raises an ImportError at the end of
the installation. To my knowledge we can ignore this error, but the installation. To my knowledge we can ignore this error, but
this is not completly safe. easy_install with numpy 1.5.1 don't this is not completely safe. ``easy_install`` with NumPy 1.5.1 does not
have this error. raise this error.
Installation step Installation steps
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
1) sudo yum install python-devel python-nose python-setuptools gcc 1) ``sudo yum install python-devel python-nose python-setuptools gcc
gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel``
2) sudo easy_install pip 2) ``sudo easy_install pip``
3) sudo pip install numpy==1.6.1 3) ``sudo pip install numpy==1.6.1``
4) sudo pip install scipy==0.10.1 4) ``sudo pip install scipy==0.10.1``
5) sudo pip install Theano 5) ``sudo pip install Theano``
Tests newly installed package Test the newly installed packages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1) Numpy (~30s): python -c "import numpy;numpy.test()" 1) NumPy (~30s): ``python -c "import numpy; numpy.test()"``
2) Scipy (~1m): python -c "import scipy;scipy.test()" 2) SciPy (~1m): ``python -c "import scipy; scipy.test()"``
3) Theano (~30m): python -c "import theano;theano.test()" 3) Theano (~30m): ``python -c "import theano; theano.test()"``
Speed test Theano/Blas Speed test Theano/BLAS
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
It is recommended to test the Theano/Blas integration. There is many It is recommended to test your Theano/BLAS integration. There are many versions
version of Blas that exist and there can be up to 10x speed of BLAS that exist and there can be up to 10x speed difference between them.
difference. Also, having Theano link directly to blas instead of Also, having Theano link directly against BLAS instead of using NumPy/SciPy as
using numpy/scipy as an intermediate lower the overhead. This is an intermediate layer reduces the computational overhead. This is
important for blas call to ger, gemv and small gemm (automaticaled important for BLAS calls to ``ger``, ``gemv`` and small ``gemm`` operations
when needed when you use dot()). To run Theano/Blas speed test: (automatically called when needed when you use ``dot()``). To run the
Theano/BLAS speed test:
.. code-block:: bash .. code-block:: bash
python /usr/lib/python2.*/site-packages/theano/misc/check_blas.py python /usr/lib/python2.*/site-packages/theano/misc/check_blas.py
This will print a table with with different version of blas/number of This will print a table with different versions of BLAS/numbers of
thread on multiple CPUs and GPUs. It will also print some Theano/numpy threads on multiple CPUs and GPUs. It will also print some Theano/NumPy
configuration. Thenit will print the run time for your configuration information. Then, it will print the running time of the same
installation. Try to find a CPU close to yours and check if the benchmarks for your installation. Try to find a CPU similar to yours in
timming is not too far. the table, and check that the single-threaded timings are roughly the same.
Updating Theano Updating Theano
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
If you followed this instruction installation, you can execute this to If you followed these installation instructions, you can execute this command
update only Theano: to update only Theano:
.. code-block:: bash .. code-block:: bash
sudo pip install --upgrade --no-deps theano sudo pip install --upgrade --no-deps theano
If you want to also update numpy/scipy, you can run this: If you want to also update NumPy/SciPy, you can run this:
.. code-block:: bash .. code-block:: bash
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论