Skip to content
Snippets Groups Projects
README.md 1.51 KiB
Newer Older
  • Learn to ignore specific revisions
  • Xuan Gu's avatar
    Xuan Gu committed
    
    ### Seting paths
    
    ```
    MODEL_NAME=nnunet_for_pytorch
    MODEL_VERSION=21.11.0
    MODEL_BASE=/proj/nsc_testing/xuan/containers/nvidia_pytorch_21.11-py3.sif
    CONTAINER_DIR=/proj/nsc_testing/xuan/containers/${MODEL_NAME}_${MODEL_VERSION}.sif
    DEF_DIR=/proj/nsc_testing/xuan/berzelius-benchmarks/NVIDIA/DeepLearningExamples/PyTorch/Segmentation/nnUNet/${MODEL_NAME}_${MODEL_VERSION}.def
    WORK_DIR=/proj/nsc_testing/xuan/berzelius-benchmarks/NVIDIA/DeepLearningExamples/PyTorch/Segmentation/nnUNet
    ```
    ### Building the container
    
    ```
    apptainer build $MODEL_BASE  docker://nvcr.io/nvidia/pytorch:21.11-py3
    apptainer build $CONTAINER_DIR $DEF_DIR
    ```
    
    
    ### Downloading and preprocessing the data
    
    ```
    apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python download.py --task 01  
    apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR  python /workspace/nnunet_pyt/preprocess.py --task 01 --dim 2
    ```
    
    
    
    ### Running benchmarking 
    
    ```
    apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python scripts/benchmark.py --mode train --gpus 1 --dim 2 --batch_size 256 --amp
    apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python scripts/benchmark.py --mode predict --gpus 1 --dim 2 --batch_size 256 --amp
    ```
    
    ### Running benchmarking using batch jobs
    
    ```
    bash submit_benchmark_jobs.sh
    ```