This is a distro of torch library enabled for OpenCL
python
command should point to python 2.7, during build (this is necessary for building clBLAS )Please proceed as follows:
git clone --recursive https://github.com/hughperkins/distro -b distro-cl ~/torch-cl
cd ~/torch-cl
bash install-deps
./install.sh
Thats it! To test, you can do for example:
source ~/torch-cl/install/bin/torch-activate
luajit -l torch -e 'torch.test()'
luajit -l nn -e 'nn.test()'
luajit -l cltorch -e 'cltorch.test()'
luajit -l clnn -e 'clnn.test()'
If you're using CUDA, you can also run:
luajit -l cutorch -e 'cutorch.test()'
luajit -l cunn -e 'nn.testcuda()'
If you are using Ubuntu, and you dont need qt, itorch, or anything gui-like, then, instead of the line bash install-deps
in the above instructions,
you can do instead, according to your ubuntu version one of:
bash install-deps-nogui-ubuntu1404.sh
or:
bash install-deps-nogui-ubuntu1604.sh
This will install faster, since no qt packages will be installed.
Note that nn, torch, cutorch, and cunn are pinned, via the rocks-cl
repository in your ~/torch-cl/install/etc/luarocks/config.lua
file.
So, doing any of luarocks install nn
, luarocks install torch
, luarocks install cltorch
, luarocks install clnn
,
luarocks install cutorch
, or luarocks install cunn
should no longer break your installation (though they will, if you remove
the pinning). However, on the whole, the recommended way of updating distro-cl
is:
cd ~/torch-cl
git pull
git submodule update --init --recursive
./install.sh
If any errors like fatal: reference is not a tree
, you have two options:
extra/nn
.git/modules/extra/nn/config
, and in the url
part, change torch
to hughperkins
extra/nn
, then modify the path of this file appropriatelgit submodule update --init --recursive
, and the updates should pull down ok (otherwise raise an issue)To run, do:
source ~/torch-cl/install/bin/torch-activate
luajit -l torch -e 'torch.test()'
luajit -l nn -e 'nn.test()'
luajit -l cltorch -e 'cltorch.test()'
luajit -l clnn -e 'clnn.test()'
If you're using CUDA, you can also run:
luajit -l cutorch -e 'cutorch.test()'
luajit -l cunn -e 'nn.testcuda()'
It's a stabilized version of torch mainline. Torch mainline is kind of in permanent 'sid'-style experimental mode. This is great for rapidly evolving torch, but it kind of sucks to develop solid libraries against :-D This distro holds Torch stable, and allows for porting new features as and when, without getting emails at 4am because something has changed in Torch mainline, and broken clnn :-D
Yes. But hopefully stable. And working. Please file an issue for any features you want from upstream.
cunn
and cutorch
from this distro?Yes
Yes. I am running Ubuntu 16.04 :-)
Please file an issue.
They're all on the project pages (for now), ie:
The OpenCL is enabled by using the following two projects, which are installed implicitly by this distro:
An hcc implementation for Torch is in progress here:
:maskedSelect
(thanks to Jacob Szuppe for showing me how to do this, using boost compute)scan
operationnn
moduleapply
, map
, map2
have now become apply_on_gpu
, map_on_gpu
, map2_on_gpu2, and
apply` is now
the same as the cutorch version, ie copies to main memory, does the calcs on the cpu, then copies back to gpu,
for compatibility with cutorchrnn
tests can run nowrocks-cl
rocks sources, to override upstream rocks for: rnn, torch7, nn, cutorch, cunn