Download scripts/packets/patch-sets-all.slurm.sh from thanminh01/WSI_Packets: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/datasets/thanminh01/WSI_Packets/resolve/main/scripts/packets/patch-sets-all.slurm.sh
- Command line
-
hf download hf://datasets/thanminh01/WSI_Packets/scripts/packets/patch-sets-all.slurm.sh
-
curl -L -o patch-sets-all.slurm.sh https://huggingface.co/datasets/thanminh01/WSI_Packets/resolve/main/scripts/packets/patch-sets-all.slurm.sh
1.62 kB
| #SBATCH --job-name=patch-sets-all | |
| #SBATCH -p grete:interactive | |
| #SBATCH --gres=gpu:2g.20gb:1 | |
| #SBATCH -c 40 | |
| #SBATCH --mem=160G | |
| #SBATCH -t 12:00:00 | |
| #SBATCH --open-mode=append | |
| #SBATCH --output=%x-%j.out | |
| #SBATCH --error=%x-%j.err | |
| # Ranked patch sets (100 patches per slide) for several datasets at once: one stream per dataset and encoder, all three scales each. | |
| # The code runs on the CPU; the GPU slice is only there because the partition requires one. | |
| # usage: sbatch --export=ALL,DATASETS="UBC-OCEAN PANDA TCGA-OT" patch-sets-all.slurm.sh | |
| # Finished files are skipped, so a rerun resumes. Output: $PKG/patch-sets-out/<DATASET>/. | |
| set -uo pipefail | |
| PKG="${SLURM_SUBMIT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" | |
| WS="${PROJECT_DIR:-/projects/extern/kisski/kisski-imm/dir.project}/thanm_WSI" | |
| source "${WSI_VENV:-$WS/env/WSI-Embedding}/bin/activate" | |
| export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 HF_HOME="$WS/hf_cache" HF_HUB_DIR="$WS/hf_cache/hub" EMB_ROOT="$WS/embeddings" | |
| export OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 | |
| export TOP1_ROOT="${TOP1_ROOT:-$WS/embedding-acquire/hpc-search-port/packets/repo/TTA-WSI/data/packets}" | |
| DATASETS="${DATASETS:?set DATASETS}" | |
| cd "$PKG/repo" | |
| echo "start $(date '+%F %T %z') datasets $DATASETS top1 root $TOP1_ROOT" | |
| for ds in $DATASETS; do | |
| OUT="$PKG/patch-sets-out/$ds" | |
| mkdir -p "$OUT" | |
| for enc in conch_v1 keep musk; do | |
| ( python -u experiments/miscellaneous/packets/patch_sets.py --encoder "$enc" --datasets "$ds" --out-dir "$OUT" --threads 4 > "$OUT/$enc.log" 2>&1; echo "$(date -Is) $ds $enc exit $?" ) & | |
| done | |
| done | |
| wait | |
| echo "ALL DONE $(date '+%F %T %z')" | |