Skip to content

Commit

Permalink
Support setting the cache_size_limit parameter and support mmdet 3.0.0 (
Browse files Browse the repository at this point in the history
#707)

* Support setting the cache_size_limit parameter of dynamo in PyTorch 2.0

* update

* update

* fix

* fix

* update

* update

* update version
  • Loading branch information
hhaAndroid committed Apr 18, 2023
1 parent 1e266da commit 927e0a4
Show file tree
Hide file tree
Showing 62 changed files with 166 additions and 164 deletions.
23 changes: 17 additions & 6 deletions .circleci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
command: |
pip install -U openmim
mim install git+https://github.com/open-mmlab/mmengine.git@main
mim install 'mmcv >= 2.0.0rc4'
mim install 'mmcv >= 2.0.0'
mim install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/albu.txt
pip install -r requirements/tests.txt
Expand All @@ -90,16 +90,17 @@ jobs:
name: Run unittests
command: |
export LD_LIBRARY_PATH=/home/circleci/project/onnxruntime-linux-x64-1.8.1/lib:${LD_LIBRARY_PATH}
coverage run --branch --source mmyolo -m pytest tests/
coverage xml
coverage report -m
pytest tests/
# coverage run --branch --source mmyolo -m pytest tests/
# coverage xml
# coverage report -m
build_cuda:
parameters:
torch:
type: string
cuda:
type: enum
enum: ["10.1", "10.2", "11.1", "11.0"]
enum: ["10.1", "10.2", "11.0", "11.7"]
cudnn:
type: integer
default: 7
Expand All @@ -125,7 +126,7 @@ jobs:
command: |
docker exec mmyolo pip install -U openmim
docker exec mmyolo mim install -e /mmengine
docker exec mmyolo mim install 'mmcv >= 2.0.0rc4'
docker exec mmyolo mim install 'mmcv >= 2.0.0'
docker exec mmyolo pip install -e /mmdetection
docker exec mmyolo pip install -r requirements/albu.txt
docker exec mmyolo pip install -r requirements/tests.txt
Expand Down Expand Up @@ -168,6 +169,9 @@ workflows:
- lint
- build_cpu:
name: maximum_version_cpu
# mmdeploy not supported
# torch: 2.0.0
# torchvision: 0.15.1
torch: 1.12.1
torchvision: 0.13.1
python: 3.9.0
Expand All @@ -185,6 +189,13 @@ workflows:
cuda: "10.2"
requires:
- hold
- build_cuda:
name: maximum_version_gpu
torch: 2.0.0
cuda: "11.7"
cudnn: 8
requires:
- hold
merge_stage_test:
when:
not: << pipeline.parameters.lint_only >>
Expand Down
23 changes: 16 additions & 7 deletions configs/_base_/default_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@
load_from = None
resume = False

# file_client_args = dict(
# backend='petrel',
# path_mapping=dict({
# './data/': 's3://openmmlab/datasets/detection/',
# 'data/': 's3://openmmlab/datasets/detection/'
# }))
file_client_args = dict(backend='disk')
# Example to use different file client
# Method 1: simply set the data root and let the file I/O module
# automatically infer from prefix (not support LMDB and Memcache yet)

# data_root = 's3://openmmlab/datasets/detection/coco/'

# Method 2: Use `backend_args`, `file_client_args` in versions
# before MMDet 3.0.0rc6
# backend_args = dict(
# backend='petrel',
# path_mapping=dict({
# './data/': 's3://openmmlab/datasets/detection/',
# 'data/': 's3://openmmlab/datasets/detection/'
# }))

backend_args = None
9 changes: 5 additions & 4 deletions configs/_base_/det_p5_tta.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# TODO: Need to solve the problem of multiple file_client_args parameters
# _file_client_args = dict(
# TODO: Need to solve the problem of multiple backend_args parameters
# _backend_args = dict(
# backend='petrel',
# path_mapping=dict({
# './data/': 's3://openmmlab/datasets/detection/',
# 'data/': 's3://openmmlab/datasets/detection/'
# }))
_file_client_args = dict(backend='disk')

_backend_args = None

tta_model = dict(
type='mmdet.DetTTAModel',
Expand Down Expand Up @@ -37,7 +38,7 @@
]

tta_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_file_client_args),
dict(type='LoadImageFromFile', backend_args=_backend_args),
dict(
type='TestTimeAug',
transforms=[
Expand Down
2 changes: 1 addition & 1 deletion configs/deploy/model/yolov5_s-static.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_base_ = '../../yolov5/yolov5_s-v61_syncbn_8xb16-300e_coco.py'

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='LetterResize',
scale=_base_.img_scale,
Expand Down
2 changes: 1 addition & 1 deletion configs/deploy/model/yolov6_s-static.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_base_ = '../../yolov6/yolov6_s_syncbn_fast_8xb32-400e_coco.py'

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='LetterResize',
scale=_base_.img_scale,
Expand Down
4 changes: 2 additions & 2 deletions configs/ppyoloe/ppyoloe_plus_s_fast_8xb8-80e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
max_per_img=300))

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(type='PPYOLOERandomDistort'),
dict(type='mmdet.Expand', mean=(103.53, 116.28, 123.675)),
Expand Down Expand Up @@ -157,7 +157,7 @@
pipeline=train_pipeline))

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='mmdet.FixShapeResize',
width=img_scale[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
max_per_img=100)

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Mosaic',
Expand Down Expand Up @@ -73,7 +73,7 @@
]

train_pipeline_stage2 = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='mmdet.RandomResize',
Expand All @@ -92,7 +92,7 @@
batch_size=train_batch_size_per_gpu, dataset=dict(pipeline=train_pipeline))

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='mmdet.Resize', scale=(960, 960), keep_ratio=True),
dict(type='mmdet.Pad', size=(960, 960), pad_val=dict(img=(114, 114, 114))),
dict(type='LoadAnnotations', with_bbox=True, _scope_='mmdet'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
)

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True, box_type='qbox'),
dict(
type='mmrotate.ConvertBoxType',
Expand All @@ -191,7 +191,7 @@
]

val_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='mmdet.Resize', scale=img_scale, keep_ratio=True),
dict(type='mmdet.Pad', size=img_scale, pad_val=dict(img=(114, 114, 114))),
dict(
Expand All @@ -209,7 +209,7 @@
]

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='mmdet.Resize', scale=img_scale, keep_ratio=True),
dict(type='mmdet.Pad', size=img_scale, pad_val=dict(img=(114, 114, 114))),
dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# =======================Unmodified in most cases==================

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True, box_type='qbox'),
dict(
type='mmrotate.ConvertBoxType',
Expand Down Expand Up @@ -77,7 +77,7 @@
]

train_pipeline_stage2 = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True, box_type='qbox'),
dict(
type='mmrotate.ConvertBoxType',
Expand Down
6 changes: 3 additions & 3 deletions configs/rtmdet/rtmdet_l_syncbn_fast_8xb32-300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
)

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Mosaic',
Expand All @@ -175,7 +175,7 @@
]

train_pipeline_stage2 = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='mmdet.RandomResize',
Expand All @@ -191,7 +191,7 @@
]

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='YOLOv5KeepRatioResize', scale=img_scale),
dict(
type='LetterResize',
Expand Down
4 changes: 2 additions & 2 deletions configs/rtmdet/rtmdet_s_syncbn_fast_8xb32-300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
bbox_head=dict(head_module=dict(widen_factor=widen_factor)))

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Mosaic',
Expand All @@ -60,7 +60,7 @@
]

train_pipeline_stage2 = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='mmdet.RandomResize',
Expand Down
2 changes: 1 addition & 1 deletion configs/rtmdet/rtmdet_tiny_syncbn_fast_8xb32-300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
bbox_head=dict(head_module=dict(widen_factor=widen_factor)))

train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Mosaic',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
]

pre_transform = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
# only change this
dict(type='mmdet.LoadAnnotations', with_bbox=True)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# ===============================Unmodified in most cases====================
pre_transform = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='LoadAnnotations',
with_bbox=True,
Expand Down
4 changes: 2 additions & 2 deletions configs/yolov5/voc/yolov5_s-v61_fast_1xb64-50e_voc.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
collate_fn=dict(type='yolov5_collate'))

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='YOLOv5KeepRatioResize', scale=img_scale),
dict(
type='LetterResize',
Expand Down Expand Up @@ -250,7 +250,7 @@
]

tta_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='TestTimeAug',
transforms=[
Expand Down
4 changes: 2 additions & 2 deletions configs/yolov5/yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='YOLOv5KeepRatioResize', scale=img_scale),
dict(
type='LetterResize',
Expand Down Expand Up @@ -118,7 +118,7 @@
]

tta_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='TestTimeAug',
transforms=[
Expand Down
2 changes: 1 addition & 1 deletion configs/yolov5/yolov5_s-v61_fast_1xb12-40e_608x352_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
_base_.train_dataloader.dataset.pipeline = train_pipeline

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='YOLOv5KeepRatioResize', scale=img_scale),
dict(
type='LetterResize',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_base_ = 'yolov5_s-v61_syncbn_8xb16-300e_coco.py'

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='LetterResize',
scale=_base_.img_scale,
Expand Down
4 changes: 2 additions & 2 deletions configs/yolov5/yolov5_s-v61_syncbn_8xb16-300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
]

pre_transform = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True)
]

Expand Down Expand Up @@ -211,7 +211,7 @@
pipeline=train_pipeline))

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='YOLOv5KeepRatioResize', scale=img_scale),
dict(
type='LetterResize',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# ===============================Unmodified in most cases====================
pre_transform = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(
type='LoadAnnotations',
with_bbox=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
]

pre_transform = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='LoadAnnotations', with_bbox=True)
]

Expand Down Expand Up @@ -238,7 +238,7 @@
pipeline=train_pipeline))

test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=_base_.file_client_args),
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
dict(type='YOLOv5KeepRatioResize', scale=img_scale),
dict(
type='LetterResize',
Expand Down
Loading

0 comments on commit 927e0a4

Please sign in to comment.