Difference between revisions of "Benchmarking: Deep Learning"

From Define Wiki
Jump to navigation Jump to search
(Formatted Benchmarking for NVIDIA Deep Learning)
 
 
Line 1: Line 1:
 
The QuickStart guide is 9 steps (out of which only 7 are focused on training) and the details can be found here: https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_mxnet/quickStartGuide
 
The QuickStart guide is 9 steps (out of which only 7 are focused on training) and the details can be found here: https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_mxnet/quickStartGuide
 
   
 
   
===== 1. Clone the repository. =====
+
===== Clone the repository. =====
 
<syntaxhighlight>
 
<syntaxhighlight>
 
git clone https://github.com/NVIDIA/DeepLearningExamples
 
git clone https://github.com/NVIDIA/DeepLearningExamples
 
cd DeepLearningExamples/MxNet/Classification/RN50v1.5
 
cd DeepLearningExamples/MxNet/Classification/RN50v1.5
 
</syntaxhighlight>
 
</syntaxhighlight>
===== 2. Build the ResNet50 MXNet NGC container. =====
+
===== Build the ResNet50 MXNet NGC container. =====
 
After Docker is setup, you can build the ResNet50 image with:
 
After Docker is setup, you can build the ResNet50 image with:
 
<syntaxhighlight>
 
<syntaxhighlight>
 
docker build . -t nvidia_rn50_mx
 
docker build . -t nvidia_rn50_mx
 
</syntaxhighlight>
 
</syntaxhighlight>
===== 3. Start an interactive session in the NGC container to run preprocessing/training/inference. =====
+
===== Start an interactive session in the NGC container to run preprocessing/training/inference. =====
 
<syntaxhighlight>
 
<syntaxhighlight>
 
nvidia-docker run --rm -it --ipc=host <path to dataset>:/data/imagenet/train-val-recordio-passthrough nvidia_rn50_mx
 
nvidia-docker run --rm -it --ipc=host <path to dataset>:/data/imagenet/train-val-recordio-passthrough nvidia_rn50_mx
 
</syntaxhighlight>
 
</syntaxhighlight>
===== 4. Download and preprocess the data. =====
+
===== Download and preprocess the data. =====
 
• Download the images from http://image-net.org/download-images.
 
• Download the images from http://image-net.org/download-images.
  
Line 25: Line 25:
 
   cd ..
 
   cd ..
 
</syntaxhighlight>
 
</syntaxhighlight>
===== 5. Extract the validation data and move the images to subfolders. ======
+
===== Extract the validation data and move the images to subfolders. =====
 
<syntaxhighlight>
 
<syntaxhighlight>
 
mkdir val && mv ILSVRC2012_img_val.tar val/ && cd val && tar -xvf ILSVRC2012_img_val.tar
 
mkdir val && mv ILSVRC2012_img_val.tar val/ && cd val && tar -xvf ILSVRC2012_img_val.tar
 
wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash
 
wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash
 
</syntaxhighlight>
 
</syntaxhighlight>
===== 6. Preprocess the dataset. =====
+
===== Preprocess the dataset. =====
 
<syntaxhighlight>
 
<syntaxhighlight>
 
./scripts/prepare_imagenet.sh <path to raw imagenet> <path where processed dataset will be created>
 
./scripts/prepare_imagenet.sh <path to raw imagenet> <path where processed dataset will be created>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===== 7. Start training. =====
+
===== Start training. =====
 
<syntaxhighlight>
 
<syntaxhighlight>
 
./runner -n <number of gpus> -b <batch size per GPU (default 192)>
 
./runner -n <number of gpus> -b <batch size per GPU (default 192)>
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 14:45, 14 January 2020

The QuickStart guide is 9 steps (out of which only 7 are focused on training) and the details can be found here: https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_mxnet/quickStartGuide

Clone the repository.
git clone https://github.com/NVIDIA/DeepLearningExamples
cd DeepLearningExamples/MxNet/Classification/RN50v1.5
Build the ResNet50 MXNet NGC container.

After Docker is setup, you can build the ResNet50 image with:

docker build . -t nvidia_rn50_mx
Start an interactive session in the NGC container to run preprocessing/training/inference.
nvidia-docker run --rm -it --ipc=host <path to dataset>:/data/imagenet/train-val-recordio-passthrough nvidia_rn50_mx
Download and preprocess the data.

• Download the images from http://image-net.org/download-images.

• Extract the training and validation data:

	  mkdir train && mv ILSVRC2012_img_train.tar train/ && cd train
	  tar -xvf ILSVRC2012_img_train.tar && rm -f ILSVRC2012_img_train.tar
	  find . -name "*.tar" | while read NAME ; do mkdir -p "${NAME%.tar}"; tar -xvf "${NAME}" -C "${NAME%.tar}"; rm -f "${NAME}"; done
  cd ..
Extract the validation data and move the images to subfolders.
mkdir val && mv ILSVRC2012_img_val.tar val/ && cd val && tar -xvf ILSVRC2012_img_val.tar
wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash
Preprocess the dataset.
./scripts/prepare_imagenet.sh <path to raw imagenet> <path where processed dataset will be created>
Start training.
./runner -n <number of gpus> -b <batch size per GPU (default 192)>