Torch: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Draft}}
{{Draft}}
[[Category:Software]]
[[Category:Software]]
Torch is available in the form of a module. In order to use it, you must first load the cuda module.
"[http://torch.ch/ Torch] is a scientific computing framework with wide support for machine learning algorithms that puts GPUs first. It is easy to use and efficient, thanks to an easy and fast scripting language, LuaJIT, and an underlying C/CUDA implementation."
 
Torch has a distant relationship to PyTorch.<ref>See https://stackoverflow.com/questions/44371560/what-is-the-relationship-between-pytorch-and-torch, https://www.quora.com/What-are-the-differences-between-Torch-and-Pytorch, and https://discuss.pytorch.org/t/torch-autograd-vs-pytorch-autograd/1671/4 for some attempts to explain the connection.</ref> PyTorch provides a [[Python]] interface to similar capabilities, but one is not directly dependent on the other. See [[PyTorch]] for instructions on using it.
 
Torch depends on [[CUDA]]. In order to use Torch you must first load a CUDA module, like so:


{{Command|module load cuda torch}}
{{Command|module load cuda torch}}
will give you the latest version available.


== Installing Lua packages ==
== Installing Lua packages ==
Line 12: Line 14:
{{Command|luarocks install --local --deps-mode{{=}}all <package name>}}
{{Command|luarocks install --local --deps-mode{{=}}all <package name>}}


By experience, we often find packages that do not install quite well through <tt>luarocks</tt>. If you have a package that is not installed in the default module and need help installing it, please contact our [[Technical support]]
By experience, we often find packages that do not install well with <tt>luarocks</tt>. If you have a package that is not installed in the default module and need help installing it, please contact our [[Technical support]].
 
<references />

Revision as of 18:52, 28 March 2018


This article is a draft

This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.

"Torch is a scientific computing framework with wide support for machine learning algorithms that puts GPUs first. It is easy to use and efficient, thanks to an easy and fast scripting language, LuaJIT, and an underlying C/CUDA implementation."

Torch has a distant relationship to PyTorch.[1] PyTorch provides a Python interface to similar capabilities, but one is not directly dependent on the other. See PyTorch for instructions on using it.

Torch depends on CUDA. In order to use Torch you must first load a CUDA module, like so:

Question.png
[name@server ~]$ module load cuda torch

Installing Lua packages

Torch comes with the Lua package manager, named luarocks. By design, luarocks will allow you to install new packages, but will not find the system packages. To install packages in your own folder, use the following:

Question.png
[name@server ~]$ luarocks install --local --deps-mode=all <package name>

By experience, we often find packages that do not install well with luarocks. If you have a package that is not installed in the default module and need help installing it, please contact our Technical support.