-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: add gpu support to container runtime #2914
Conversation
…jina into feat-docker-gpu-support
Codecov Report
@@ Coverage Diff @@
## master #2914 +/- ##
==========================================
+ Coverage 82.21% 88.82% +6.60%
==========================================
Files 106 138 +32
Lines 7064 9567 +2503
==========================================
+ Hits 5808 8498 +2690
+ Misses 1256 1069 -187
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
'device': [], | ||
'driver': '', | ||
} | ||
gpu_args = self.args.gpus[0] |
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.
if it is a list why to consider only first?
capabilities=[_gpus['capabilities']], | ||
) | ||
] | ||
|
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 gpus from args before doing the container run for better backwards compatibility with jinahub on older jina versions
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.
then add a test to make sure that the device request param is properly sent in the container runtime call
@@ -163,6 +164,36 @@ def _docker_run(self, replay: bool = False): | |||
'mode': 'rw', | |||
} | |||
|
|||
device_requests = [] | |||
if self.args.gpus: |
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.
maybe u can put this in an static method where u can do better unittesting of this logic
@@ -74,6 +74,38 @@ def _set_network_for_dind_linux(self): | |||
) | |||
client.close() | |||
|
|||
@staticmethod | |||
def _set_device_requests_for_gpu(gpu_args): |
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.
it should be a _get
?
@bwanglzu have u tried in the GPU server to see if it works? |
this pr close #2900
should allow us deploy a dockerized jina pod with local gpu devices, e.g.
for more info check out this link.