File size: 1,849 Bytes
6d1bbc7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Set up negbiodb-ml conda environment on Cayuga HPC.
# Run once from a Cayuga login or interactive node.
#
# Usage:
#   bash slurm/setup_env.sh
#
# What it installs:
#   - Python 3.11 + PyTorch 2.2.2 (CUDA 12.1)
#   - torch-geometric (with scatter/sparse wheels for cu121)
#   - rdkit, pandas, pyarrow, scikit-learn, tqdm
#   - negbiodb package (editable install)

set -euo pipefail

NEGBIODB=${SCRATCH_DIR:-/path/to/scratch}/negbiodb
CONDA_SH=${CONDA_PREFIX:-/path/to/conda}/miniconda3/etc/profile.d/conda.sh
ENV_NAME=negbiodb-ml

source "$CONDA_SH"

if conda env list | grep -q "^${ENV_NAME} "; then
    echo "Conda environment '$ENV_NAME' already exists. Activating..."
else
    echo "Creating conda environment: $ENV_NAME"
    conda create -n "$ENV_NAME" python=3.11 -y
fi
conda activate "$ENV_NAME"

echo "Installing PyTorch 2.2.2 (CUDA 12.1)..."
pip install torch==2.2.2 --index-url https://download.pytorch.org/whl/cu121

echo "Installing torch-geometric..."
pip install torch-geometric

echo "Installing torch-scatter and torch-sparse (CUDA 12.1 wheels)..."
pip install torch-scatter torch-sparse \
    -f https://data.pyg.org/whl/torch-2.2.2+cu121.html

echo "Installing core dependencies..."
pip install rdkit pandas pyarrow scikit-learn tqdm pyyaml requests mlcroissant

echo "Installing negbiodb package (editable)..."
pip install -e "$NEGBIODB/"

echo "Verifying installation..."
python -c "
import torch
print(f'torch: {torch.__version__}')
print(f'CUDA available: {torch.cuda.is_available()}')
import torch_geometric
print(f'torch_geometric: {torch_geometric.__version__}')
from negbiodb.models.graphdta import GraphDTA, smiles_to_graph
g = smiles_to_graph('CCO')
print(f'smiles_to_graph test: {g}')
print('Setup complete!')
"

echo ""
echo "Environment '$ENV_NAME' ready."
echo "Activate with: conda activate $ENV_NAME"