This is a distro of torch library enabled for OpenCL
- python 2.7 installed:
python
command should point to python 2.7, during build (this is necessary for building clBLAS ) - have an OpenCL-1.2 enabled GPU device available, and appropriate OpenCL-1.2 enabled drivers installed
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:
- easy option: remove ~/torch-cl completely, reinstall
- harder, hacky option:
- in the error message, you should see which submodule is broken. Let's say it is
extra/nn
- so edit
.git/modules/extra/nn/config
, and in theurl
part, changetorch
tohughperkins
- if it's not
extra/nn
, then modify the path of this file appropriatel - that's it!
- now rerun
git submodule update --init --recursive
, and the updates should pull down ok (otherwise raise an issue)
- in the error message, you should see which submodule is broken. Let's say it is
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()'
- Please raise an issue for any operations etc which you particularly need, or you feel are not working for some reason.
- (Ditto for any build errors)
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.
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:
- 22nd August:
- added
:maskedSelect
(thanks to Jacob Szuppe for showing me how to do this, using boost compute) - behind the scenes:
- added boost compute
- this opens the door to implementing a few other missing methods, basically anything involving various types of
scan
operation
- added
- 21st August:
- fixed unit test errors and warnings in
nn
module
- fixed unit test errors and warnings in
- 20th August:
- bunch of patches to get neuralconvo to work:
- in cltorch,
apply
,map
,map2
have now becomeapply_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 cutorch - updated Tester.lua in torch to the same as upstream main torch distro, so that
rnn
tests can run now - created
rocks-cl
rocks sources, to override upstream rocks for: rnn, torch7, nn, cutorch, cunn
- in cltorch,
- bunch of patches to get neuralconvo to work:
- 2nd May:
- Re-applied:
- 26th March:
- added TemporalConvolution2: same API and usage as TemporalConvolution, but faster on GPUs
- 26th March:
- Re-applied:
- 1st May:
- Re-applied:
- 10th March:
- @pawni (Nick Pawlowski) added SpatialUpSamplingNearest. Thank you Nick
- 20th February:
- @gloine (Jaehyung Lee) added support for non-batched input to ClassNLLCriterion. Thank you Jaehyung
- 27 March 2016:
- migrated from clBLAS 2.4 to clBLAS 2.11/develop. This migration is not set in stone, depends on how well that works. However, there is a bug in 2.4 for certain configurations of matrix multiplication, and its not obvious how to fix that, so maybe using 2.11/develop is the easiest way forward?
- 10th March:
- Re-applied:
- 30th April:
- distro-cl first created, to stabilize Torch distribution