# Conda
- Modules come later. Now just load the module and mention what it does.
- Mostly going through the [python-conda](https://scicomp.aalto.fi/triton/apps/python-conda) section
- Should we demonstrate the first time setup for environments? I guess so.
- [first-time-setup](https://scicomp.aalto.fi/triton/apps/python-conda/#first-time-setup)
- Start with installing R and demonstrating the version
- I don't want people to only associate Conda with Python, so start with something else
- Big example: Conda env for LLM
- Note: use pytorch from
- Recommend using an environment file and recreating when changed.
Plan (40 minutes)
- Introduce conda (10min)
- General dependency manager
- Language agnostic
- Lot's of binary packages
- Example: create environment with R (10min)
- Explain what each line does while typing
- Why you should track environments (5min)
- Makes your code reproducible
- Helps debugging
- Helps set-up for other team members
- Allows transitioning to another system
- Example: Python LLM environment (10 min)
- Note that you probably want the Triton LLM module
- Wrap up
### Introduce Conda (10 min)
- General dependency manager
- Language agnostic
- Lot's of binary packages
- First time setup
- Channels
### create environment with R (10min)
- Create environment file, go through line by line
``` yml
name: tidyverse
channels:
- conda-forge
dependencies:
- r-tidyverse
```
- Show that it works
``` bash
source activate tidyverse
vim hello_tidy.R
Rscript hello_tidy.R
```
- hello_tidy.R
``` R
library(tidyverse)
if ("dplyr" %in% .packages()) {
cat("tidyverse (via dplyr) loaded successfully.\n")
cat("dplyr version:", as.character(packageVersion("dplyr")), "\n")
} else {
cat("Error: tidyverse (or dplyr) could not be loaded.\n")
}
```
### Why you should track environments (10min)
- Points not in the docs:
- Makes your code reproducible
- Allows version controlling your environments
- You can have the environment file with the code and the output
- Helps debugging
- Helps set-up for other team members
- Allows transitioning to another system
- Points in the docs: Solves most Python dependency issues
### Python LLM environment (10 min)
- Environment with pytorch on Triton
- First run without, then add `export CONDA_OVERRIDE_CUDA=12.6`. The first time there will be an error.
``` yml
name: pytorch
channels:
- nvidia
- conda-forge
dependencies:
- python==3.12
- pytorch-gpu>=2.6,<2.7
- torchvision
- torchaudio
- transformers
```