-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add a MIG example #182
base: main
Are you sure you want to change the base?
Add a MIG example #182
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Run as a deployment with 4 replicas | ||
# Each replica shares a mig-enabled GPU with a profile of '1g.5gb'. | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: gpu-test-mig | ||
|
||
--- | ||
apiVersion: resource.k8s.io/v1alpha3 | ||
kind: ResourceClaimTemplate | ||
metadata: | ||
namespace: gpu-test-mig | ||
name: mig-devices | ||
spec: | ||
spec: | ||
devices: | ||
requests: | ||
- name: mig-1g-5gb | ||
deviceClassName: mig.nvidia.com | ||
selectors: | ||
- cel: | ||
expression: "device.attributes['gpu.nvidia.com'].profile == '1g.5gb'" | ||
constraints: | ||
- requests: [] | ||
matchAttribute: "gpu.nvidia.com/parentUUID" | ||
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need for this with just a single MIG device request -- this pulls together the different requests and ensures the allocations come from the same underlying GPU |
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: gpu-test-mig | ||
name: pod | ||
labels: | ||
app: gpu-test-mig | ||
spec: | ||
replicas: 4 | ||
selector: | ||
matchLabels: | ||
app: pod | ||
template: | ||
metadata: | ||
labels: | ||
app: pod | ||
spec: | ||
resourceClaims: | ||
- name: mig-ts-gpu | ||
resourceClaimTemplateName: mig-devices | ||
Comment on lines
+46
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this below the list of containers |
||
containers: | ||
- name: ctr | ||
image: ubuntu:22.04 | ||
command: ["bash", "-c"] | ||
args: ["nvidia-smi -L; trap 'exit 0' TERM; sleep 9999 & wait"] | ||
resources: | ||
claims: | ||
- name: mig-ts-gpu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't use the name |
||
request: mig-1g-5gb |
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.