Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
doku:python [2023/08/25 07:32] – [Pytorch] jz | doku:python [2024/02/22 16:38] – katrin | ||
---|---|---|---|
Line 3: | Line 3: | ||
Previously we recommended using spack python packages, however we decided to deprecate this approach since it is much easier and user friendly to use ''' | Previously we recommended using spack python packages, however we decided to deprecate this approach since it is much easier and user friendly to use ''' | ||
- | The documentation is currently in the process of being revised. For now please either use the old information that is still available OR use the new quickstart guide below. | + | Have a look at the new **quickstart guide** below or the material from the python4hpc training: [[https:// |
- | ===== (Conda) Quickstart ===== | + | The old approach is now // |
- | To install a new environment start with creating an environment yaml file and store it in a safe location (ideally in your source code repository). This step is optional but we really recommend it so you and everyone in your team is able to produce the same python environment. | + | ===== Quickstart: Using Python with Conda ===== |
+ | |||
+ | To install a new environment, start with creating an **environment yaml file** and store it in a safe location (ideally in your source code repository). | ||
+ | |||
+ | This step is optional but we really | ||
+ | |||
+ | To find valid conda package names look at [[https:// | ||
+ | |||
+ | Example (add your own packages below dependencies): | ||
< | < | ||
name: my-env | name: my-env | ||
+ | channels: | ||
+ | - conda-forge | ||
+ | - defaults | ||
dependencies: | dependencies: | ||
- python=3.10 | - python=3.10 | ||
- | - tensorflow-gpu=2.6.0 | + | - tensorflow=2.15.0 |
</ | </ | ||
- | Afterwards you can then use conda like this: | + | You can the install your environment by using the following commands: |
< | < | ||
Line 44: | Line 55: | ||
#SBATCH --job-name=slurm_conda_example | #SBATCH --job-name=slurm_conda_example | ||
- | #SBATCH --time 00-00:05:00 | + | #SBATCH --time=00-00:05:00 |
#SBATCH --ntasks=2 | #SBATCH --ntasks=2 | ||
#SBATCH --mem=2GB | #SBATCH --mem=2GB | ||
Line 60: | Line 71: | ||
python --version | python --version | ||
</ | </ | ||
+ | |||
+ | ==== More info about Conda ==== | ||
+ | |||
+ | For more information about conda check-out the conda notebook of the python4HPC training material: [[https:// | ||
==== FAQ ==== | ==== FAQ ==== | ||
Line 226: | Line 241: | ||
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia | conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia | ||
</ | </ | ||
- | or alternatively use: | + | |
+ | |||
+ | As of 2023-08-25: you can also install the current pytorch version with an older cuda version via: | ||
< | < | ||
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c nvidia | conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c nvidia |