Skip to content

Commit fa59dd5

Browse files
committed
[MaskRCNN/TF&PyT] Adding Ampere support
1 parent f838cf3 commit fa59dd5

File tree

76 files changed

+1345
-971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1345
-971
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:20.06-py3
16+
FROM ${FROM_IMAGE_NAME}
17+
18+
# Install Python dependencies
19+
RUN pip install --upgrade --no-cache-dir pip \
20+
&& pip install --no-cache-dir \
21+
mlperf-compliance==0.0.10 \
22+
opencv-python==3.4.1.15 \
23+
git+https://github.com/NVIDIA/dllogger \
24+
yacs
25+
26+
# Copy detectron code and build
27+
WORKDIR /workspace/object_detection
28+
RUN mkdir -p /datasets/data
29+
RUN mkdir /results
30+
COPY pytorch/. .
31+
RUN pip install -e .
32+
33+
RUN /opt/conda/bin/conda install -y numpy==1.17.4
34+
35+
ENV OMP_NUM_THREADS=1

PyTorch/Segmentation/MaskRCNN/README.md

Lines changed: 270 additions & 226 deletions
Large diffs are not rendered by default.
-54.7 KB
Binary file not shown.
1.6 KB
Loading

PyTorch/Segmentation/MaskRCNN/pytorch/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,24 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:19.05-py3
15+
ARG FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:20.06-py3
1616
FROM ${FROM_IMAGE_NAME}
1717

1818
# Install Python dependencies
1919
RUN pip install --upgrade --no-cache-dir pip \
2020
&& pip install --no-cache-dir \
2121
mlperf-compliance==0.0.10 \
2222
opencv-python==3.4.1.15 \
23+
git+https://github.com/NVIDIA/dllogger \
2324
yacs
2425

25-
WORKDIR /opt
26-
2726
# Copy detectron code and build
2827
WORKDIR /workspace/object_detection
2928
RUN mkdir -p /datasets/data
3029
RUN mkdir /results
3130
COPY . .
3231
RUN pip install -e .
3332

33+
RUN /opt/conda/bin/conda install -y numpy==1.17.4
34+
3435
ENV OMP_NUM_THREADS=1
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
MODEL:
2+
META_ARCHITECTURE: "GeneralizedRCNN"
3+
WEIGHT: "/data3/joc_checkpoints/pytorch/maskrcnn/R-50.pkl"
4+
BACKBONE:
5+
CONV_BODY: "R-50-FPN"
6+
OUT_CHANNELS: 256
7+
RPN:
8+
USE_FPN: True
9+
ANCHOR_STRIDE: (4, 8, 16, 32, 64)
10+
PRE_NMS_TOP_N_TRAIN: 2000
11+
PRE_NMS_TOP_N_TEST: 1000
12+
POST_NMS_TOP_N_TEST: 1000
13+
FPN_POST_NMS_TOP_N_TEST: 1000
14+
FPN_POST_NMS_TOP_N_TRAIN: 4000
15+
ROI_HEADS:
16+
USE_FPN: True
17+
ROI_BOX_HEAD:
18+
POOLER_RESOLUTION: 7
19+
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125)
20+
POOLER_SAMPLING_RATIO: 2
21+
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor"
22+
PREDICTOR: "FPNPredictor"
23+
ROI_MASK_HEAD:
24+
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125)
25+
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor"
26+
PREDICTOR: "MaskRCNNC4Predictor"
27+
POOLER_RESOLUTION: 14
28+
POOLER_SAMPLING_RATIO: 2
29+
RESOLUTION: 28
30+
SHARE_BOX_FEATURE_EXTRACTOR: False
31+
MASK_ON: True
32+
DATASETS:
33+
TRAIN: ("coco_2014_train", "coco_2014_valminusminival")
34+
TEST: ("coco_2014_minival",)
35+
DATALOADER:
36+
SIZE_DIVISIBILITY: 32
37+
SOLVER:
38+
BASE_LR: 0.005
39+
WEIGHT_DECAY: 0.0001
40+
STEPS: (33000, 44000)
41+
MAX_ITER: 1000
42+
IMS_PER_BATCH: 4
43+
WARMUP_ITERS: 625
44+
WARMUP_FACTOR: 0.000064
45+
WARMUP_METHOD: "mlperf_linear"
46+
TEST:
47+
IMS_PER_BATCH: 1
48+
PATHS_CATALOG: "maskrcnn_benchmark/config/paths_catalog_ci.py"
49+
OUTPUT_DIR: "."

PyTorch/Segmentation/MaskRCNN/pytorch/configs/e2e_mask_rcnn_R_50_FPN_1x.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ DATALOADER:
3737
SOLVER:
3838
BASE_LR: 0.04
3939
WEIGHT_DECAY: 0.0001
40-
STEPS: (36000, 48000)
41-
MAX_ITER: 50000
40+
STEPS: (33000, 44000)
41+
MAX_ITER: 45000
4242
IMS_PER_BATCH: 32
4343
TEST:
4444
IMS_PER_BATCH: 8
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
MODEL:
2+
META_ARCHITECTURE: "GeneralizedRCNN"
3+
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50"
4+
BACKBONE:
5+
CONV_BODY: "R-50-FPN"
6+
OUT_CHANNELS: 256
7+
RPN:
8+
USE_FPN: True
9+
ANCHOR_STRIDE: (4, 8, 16, 32, 64)
10+
PRE_NMS_TOP_N_TRAIN: 2000
11+
PRE_NMS_TOP_N_TEST: 1000
12+
POST_NMS_TOP_N_TEST: 1000
13+
FPN_POST_NMS_TOP_N_TEST: 1000
14+
FPN_POST_NMS_TOP_N_TRAIN: 8000
15+
ROI_HEADS:
16+
USE_FPN: True
17+
ROI_BOX_HEAD:
18+
POOLER_RESOLUTION: 7
19+
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125)
20+
POOLER_SAMPLING_RATIO: 2
21+
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor"
22+
PREDICTOR: "FPNPredictor"
23+
ROI_MASK_HEAD:
24+
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125)
25+
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor"
26+
PREDICTOR: "MaskRCNNC4Predictor"
27+
POOLER_RESOLUTION: 14
28+
POOLER_SAMPLING_RATIO: 2
29+
RESOLUTION: 28
30+
SHARE_BOX_FEATURE_EXTRACTOR: False
31+
MASK_ON: True
32+
DATASETS:
33+
TRAIN: ("coco_2014_train", "coco_2014_valminusminival")
34+
TEST: ("coco_2014_minival",)
35+
DATALOADER:
36+
SIZE_DIVISIBILITY: 32
37+
SOLVER:
38+
BASE_LR: 0.08
39+
WEIGHT_DECAY: 0.0001
40+
STEPS: (18000,24000)
41+
MAX_ITER: 27500
42+
IMS_PER_BATCH: 64
43+
WARMUP_FACTOR: 0.0001
44+
WARMUP_ITERS: 800
45+
WARMUP_METHOD: "mlperf_linear"
46+
TEST:
47+
IMS_PER_BATCH: 8
48+
DTYPE: "tf32"

PyTorch/Segmentation/MaskRCNN/pytorch/maskrcnn_benchmark/config/defaults.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,5 @@
325325
_C.PER_EPOCH_EVAL = False
326326
_C.MIN_BBOX_MAP = 0.377
327327
_C.MIN_MASK_MAP = 0.342
328+
329+
_C.SAVE_CHECKPOINT = True

PyTorch/Segmentation/MaskRCNN/pytorch/maskrcnn_benchmark/config/paths_catalog_ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class DatasetCatalog(object):
9-
DATA_DIR = "/data/coco/coco-2014"
9+
DATA_DIR = "/data2/coco/coco-2014"
1010
DATASETS = {
1111
"coco_2014_train": {
1212
"img_dir": "coco_train2014",

0 commit comments

Comments
 (0)