Skip to content
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

Sharding GPU support #289

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions aws/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ locals {
prefix = values.prefix
tags = values.tags
specs = {
cpus = data.aws_ec2_instance_type.instance_type[values.prefix].default_vcpus
ram = data.aws_ec2_instance_type.instance_type[values.prefix].memory_size
gpus = try(one(data.aws_ec2_instance_type.instance_type[values.prefix].gpus).count, 0)
mig = lookup(values, "mig", null)
cpus = data.aws_ec2_instance_type.instance_type[values.prefix].default_vcpus
ram = data.aws_ec2_instance_type.instance_type[values.prefix].memory_size
gpus = try(one(data.aws_ec2_instance_type.instance_type[values.prefix].gpus).count, 0)
mig = lookup(values, "mig", null)
shard = lookup(values, "shard", null)
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions azure/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ locals {
prefix = values.prefix
tags = values.tags
specs = {
cpus = local.vmsizes[values.type].vcpus
ram = local.vmsizes[values.type].ram
gpus = local.vmsizes[values.type].gpus
mig = lookup(values, "mig", null)
cpus = local.vmsizes[values.type].vcpus
ram = local.vmsizes[values.type].ram
gpus = local.vmsizes[values.type].gpus
mig = lookup(values, "mig", null)
shard = lookup(values, "shard", null)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/configuration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ output "bastions" {
for host, values in var.inventory: host => values
if contains(values.tags, var.bastion_tag) && contains(values.tags, "public") && (!contains(values.tags, "pool"))
}
}
}
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ the operating system and service software
```
This is only functional with [MIG supported GPUs](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/index.html#supported-gpus),
and with x86-64 processors (see [NVIDIA/mig-parted issue #30](https://github.com/NVIDIA/mig-parted/issues/30)).
6. `shard`: total number of [Sharding](https://slurm.schedmd.com/gres.html#Sharding) on the node. Sharding allows sharing the same GPU on multiple jobs. The total number of shards is evenly distributed across all GPUs on the node.

For some cloud providers, it possible to define additional attributes.
The following sections present the available attributes per provider.
Expand Down
9 changes: 5 additions & 4 deletions gcp/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ locals {
prefix = values.prefix
tags = values.tags
specs = {
cpus = data.external.machine_type[values["prefix"]].result["vcpus"]
ram = data.external.machine_type[values["prefix"]].result["ram"]
gpus = try(data.external.machine_type[values["prefix"]].result["gpus"], lookup(values, "gpu_count", 0))
mig = lookup(values, "mig", null)
cpus = data.external.machine_type[values["prefix"]].result["vcpus"]
ram = data.external.machine_type[values["prefix"]].result["ram"]
gpus = try(data.external.machine_type[values["prefix"]].result["gpus"], lookup(values, "gpu_count", 0))
mig = lookup(values, "mig", null)
shard = lookup(values, "shard", null)
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions openstack/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ locals {
prefix = values.prefix
tags = values.tags
specs = {
cpus = data.openstack_compute_flavor_v2.flavors[values.prefix].vcpus
ram = data.openstack_compute_flavor_v2.flavors[values.prefix].ram
gpus = sum([
cpus = data.openstack_compute_flavor_v2.flavors[values.prefix].vcpus
ram = data.openstack_compute_flavor_v2.flavors[values.prefix].ram
gpus = sum([
parseint(lookup(data.openstack_compute_flavor_v2.flavors[values.prefix].extra_specs, "resources:VGPU", "0"), 10),
parseint(split(":", lookup(data.openstack_compute_flavor_v2.flavors[values.prefix].extra_specs, "pci_passthrough:alias", "gpu:0"))[1], 10)
])
mig = lookup(values, "mig", null)
mig = lookup(values, "mig", null)
shard = lookup(values, "shard", null)
}
}
}
Expand All @@ -146,4 +147,4 @@ locals {
host => merge(module.configuration.inventory[host], {id=openstack_compute_instance_v2.instances[host].id})
if contains(module.configuration.inventory[host].tags, "public")
}
}
}
Loading