-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The function-gpu.yaml file for mmpose on pytorch (gpu with cu118) #8189
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe recent update introduces a new configuration file, Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- changelog.d/fragment.j2 (1 hunks)
- serverless/pytorch/mmpose/hrnet32/nuclio/function-gpu.yaml (1 hunks)
Files not summarized due to errors (1)
- serverless/pytorch/mmpose/hrnet32/nuclio/function-gpu.yaml: Error: Message exceeds token limit
Files skipped from review due to trivial changes (1)
- changelog.d/fragment.j2
Additional context used
yamllint
serverless/pytorch/mmpose/hrnet32/nuclio/function-gpu.yaml
[error] 209-209: trailing spaces
(trailing-spaces)
[error] 210-210: trailing spaces
(trailing-spaces)
Additional comments not posted (3)
serverless/pytorch/mmpose/hrnet32/nuclio/function-gpu.yaml (3)
1-7
: Metadata section looks good!The metadata section is correctly formatted and includes essential information such as name, namespace, and annotations.
201-207
: Triggers section looks good!The triggers section is correctly formatted and includes essential information such as the HTTP trigger and its attributes.
213-218
: Platform section looks good!The platform section is correctly formatted and includes essential information such as restart policy and mount mode.
resources: | ||
limits: | ||
nvidia.com/gpu: 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing spaces in the resources section.
The resources section is correctly formatted and includes essential information. However, there are trailing spaces that should be removed.
- resources:
- limits:
+ resources:
+ limits:
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
resources: | |
limits: | |
nvidia.com/gpu: 1 | |
resources: | |
limits: | |
nvidia.com/gpu: 1 |
Tools
yamllint
[error] 209-209: trailing spaces
(trailing-spaces)
[error] 210-210: trailing spaces
(trailing-spaces)
directives: | ||
preCopy: | ||
- kind: RUN | ||
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* | ||
- kind: WORKDIR | ||
value: /opt/nuclio | ||
- kind: RUN | ||
#value: pip install openmim torch==2.0.0+cpu torchvision==0.15.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | ||
#value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html | ||
value: pip install openmim torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --extra-index-url https://download.pytorch.org/whl/cu118 | ||
- kind: RUN | ||
value: mim install mmcv==2.0.1 mmdet==3.2.0 mmpose==1.2.0 | ||
- kind: RUN | ||
value: git clone -b v1.2.0 --depth=1 https://github.com/open-mmlab/mmpose.git | ||
- kind: ADD | ||
value: https://download.openmmlab.com/mmpose/v1/wholebody_2d_keypoint/ubody/td-hm_hrnet-w32_8xb64-210e_ubody-coco-256x192-7c227391_20230807.pth ./ | ||
- kind: ADD | ||
value: https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth ./ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build directives look good but add a comment for apt update
.
The build directives are correctly formatted and include essential commands. However, there is a potential security risk with the apt update
command. Adding a comment to explain its necessity would be helpful.
+ # Updating package lists and installing dependencies
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/*
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
directives: | |
preCopy: | |
- kind: RUN | |
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
- kind: WORKDIR | |
value: /opt/nuclio | |
- kind: RUN | |
#value: pip install openmim torch==2.0.0+cpu torchvision==0.15.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | |
#value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html | |
value: pip install openmim torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --extra-index-url https://download.pytorch.org/whl/cu118 | |
- kind: RUN | |
value: mim install mmcv==2.0.1 mmdet==3.2.0 mmpose==1.2.0 | |
- kind: RUN | |
value: git clone -b v1.2.0 --depth=1 https://github.com/open-mmlab/mmpose.git | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/wholebody_2d_keypoint/ubody/td-hm_hrnet-w32_8xb64-210e_ubody-coco-256x192-7c227391_20230807.pth ./ | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth ./ | |
directives: | |
preCopy: | |
- kind: RUN | |
+ # Updating package lists and installing dependencies | |
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
- kind: WORKDIR | |
value: /opt/nuclio | |
- kind: RUN | |
#value: pip install openmim torch==2.0.0+cpu torchvision==0.15.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | |
#value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html | |
value: pip install openmim torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --extra-index-url https://download.pytorch.org/whl/cu118 | |
- kind: RUN | |
value: mim install mmcv==2.0.1 mmdet==3.2.0 mmpose==1.2.0 | |
- kind: RUN | |
value: git clone -b v1.2.0 --depth=1 https://github.com/open-mmlab/mmpose.git | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/wholebody_2d_keypoint/ubody/td-hm_hrnet-w32_8xb64-210e_ubody-coco-256x192-7c227391_20230807.pth ./ | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth ./ |
spec: | ||
description: Whole Body points | ||
runtime: 'python:3.8' | ||
handler: main:handler | ||
eventTimeout: 30s | ||
|
||
build: | ||
image: cvat.pth.mmpose.hrnet32 | ||
baseImage: python:3.8 | ||
|
||
directives: | ||
preCopy: | ||
- kind: RUN | ||
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* | ||
- kind: WORKDIR | ||
value: /opt/nuclio | ||
- kind: RUN | ||
#value: pip install openmim torch==2.0.0+cpu torchvision==0.15.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | ||
#value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html | ||
value: pip install openmim torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --extra-index-url https://download.pytorch.org/whl/cu118 | ||
- kind: RUN | ||
value: mim install mmcv==2.0.1 mmdet==3.2.0 mmpose==1.2.0 | ||
- kind: RUN | ||
value: git clone -b v1.2.0 --depth=1 https://github.com/open-mmlab/mmpose.git | ||
- kind: ADD | ||
value: https://download.openmmlab.com/mmpose/v1/wholebody_2d_keypoint/ubody/td-hm_hrnet-w32_8xb64-210e_ubody-coco-256x192-7c227391_20230807.pth ./ | ||
- kind: ADD | ||
value: https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth ./ | ||
|
||
triggers: | ||
myHttpTrigger: | ||
maxWorkers: 2 | ||
kind: 'http' | ||
workerAvailabilityTimeoutMilliseconds: 10000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spec section looks good but remove commented-out lines.
The spec section is correctly formatted and includes essential information. However, there are some commented-out lines in the build directives that should be removed for clarity.
- #value: pip install openmim torch==2.0.0+cpu torchvision==0.15.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu
- #value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
spec: | |
description: Whole Body points | |
runtime: 'python:3.8' | |
handler: main:handler | |
eventTimeout: 30s | |
build: | |
image: cvat.pth.mmpose.hrnet32 | |
baseImage: python:3.8 | |
directives: | |
preCopy: | |
- kind: RUN | |
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
- kind: WORKDIR | |
value: /opt/nuclio | |
- kind: RUN | |
#value: pip install openmim torch==2.0.0+cpu torchvision==0.15.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | |
#value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html | |
value: pip install openmim torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --extra-index-url https://download.pytorch.org/whl/cu118 | |
- kind: RUN | |
value: mim install mmcv==2.0.1 mmdet==3.2.0 mmpose==1.2.0 | |
- kind: RUN | |
value: git clone -b v1.2.0 --depth=1 https://github.com/open-mmlab/mmpose.git | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/wholebody_2d_keypoint/ubody/td-hm_hrnet-w32_8xb64-210e_ubody-coco-256x192-7c227391_20230807.pth ./ | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth ./ | |
triggers: | |
myHttpTrigger: | |
maxWorkers: 2 | |
kind: 'http' | |
workerAvailabilityTimeoutMilliseconds: 10000 | |
spec: | |
description: Whole Body points | |
runtime: 'python:3.8' | |
handler: main:handler | |
eventTimeout: 30s | |
build: | |
image: cvat.pth.mmpose.hrnet32 | |
baseImage: python:3.8 | |
directives: | |
preCopy: | |
- kind: RUN | |
value: apt update && apt install -y git libgl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
- kind: WORKDIR | |
value: /opt/nuclio | |
- kind: RUN | |
value: pip install openmim torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --extra-index-url https://download.pytorch.org/whl/cu118 | |
- kind: RUN | |
value: mim install mmcv==2.0.1 mmdet==3.2.0 mmpose==1.2.0 | |
- kind: RUN | |
value: git clone -b v1.2.0 --depth=1 https://github.com/open-mmlab/mmpose.git | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/wholebody_2d_keypoint/ubody/td-hm_hrnet-w32_8xb64-210e_ubody-coco-256x192-7c227391_20230807.pth ./ | |
- kind: ADD | |
value: https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth ./ | |
triggers: | |
myHttpTrigger: | |
maxWorkers: 2 | |
kind: 'http' | |
workerAvailabilityTimeoutMilliseconds: 10000 |
A very simple/naive addition of function-gpu.yaml to enable mmpose on gpu. Tested on a Linux Mint 21.3 x86_64 machine.
Motivation and context
mmpose can be easily deployed with the serverless/deployed_cpu.sh script, but the function-gpu.yaml is absense for gpu easy deployment. I did a simple/naive function-gpu.yaml based on modifying the function.yaml
How has this been tested?
This yaml on is tested on a Linux Mint 21.3 x86_64 machine. The branch tested on is the develop branch, however it is cloned and deployed a few weeks ago, so there might be some inconsistencies.
Checklist
develop
branch- [ ] I have updated the documentation accordingly- [ ] I have added tests to cover my changes- [ ] I have linked related issues (see GitHub docs)- [ ] I have increased versions of npm packages if it is necessary(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
mmpose
to improve performance on compatible devices.