Torch: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Created page with "{{Draft}} Torch is available in the form of a module. In order to use it, you must first load the cuda module. {{Command|module load cuda torch}} will give you the latest...")
 
No edit summary
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Draft}}
<languages />


Torch is available in the form of a module. In order to use it, you must first load the cuda module.
{{Outdated}}


<translate>
<!--T:1-->
[[Category:Software]][[Category:AI and Machine Learning]]
"[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."
<!--T:2-->
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 software with similar functionality, but PyTorch is not dependent on Torch. See [[PyTorch]] for instructions on using it.
<!--T:3-->
Torch depends on [[CUDA]]. In order to use Torch you must first load a CUDA module, like so:
<!--T:4-->
{{Command|module load cuda torch}}
{{Command|module load cuda torch}}


will give you the latest version available.  
== Installing Lua packages == <!--T:5-->
Torch comes with the Lua package manager, named [https://luarocks.org/ luarocks]. Run
luarocks list
to see a list of installed packages.
 
<!--T:13-->
If you need some package which does not appear on the list, use the following to install it in your own folder:
 
<!--T:6-->
{{Command|luarocks install --local --deps-mode{{=}}all <package name>}}
 
<!--T:9-->
If after this installation you are having trouble finding the packages at runtime, then add the following command<ref> https://github.com/luarocks/luarocks/wiki/Using-LuaRocks#Rocks_trees_and_the_Lua_libraries_path </ref>  right before running "lua your_program.lua"
command:


== Installing Lua packages ==
<!--T:10-->
Torch comes with the Lua package manager, named [https://luarocks.org/ luarocks]. By design, <tt>luarocks</tt> will allow you to install new packages, but will not find the system packages. To install packages in your own folder, use the following:
eval $(luarocks path --bin)


{{Command|luarocks install --local --deps-mode=all <package name>}}
<!--T:11-->
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]].


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]]
<!--T:12-->
<references />
</translate>

Latest revision as of 15:18, 20 March 2024

Other languages:


Outdated

This page or section contains obsolete information and some statements may not be valid. The technical documentation is currently being updated by our support team.

"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 software with similar functionality, but PyTorch is not dependent on Torch. 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. Run

luarocks list

to see a list of installed packages.

If you need some package which does not appear on the list, use the following to install it in your own folder:

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

If after this installation you are having trouble finding the packages at runtime, then add the following command[2] right before running "lua your_program.lua" command:

eval $(luarocks path --bin)

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.