Skip to content

Commit

Permalink
Add support for v6e
Browse files Browse the repository at this point in the history
  • Loading branch information
nstogner committed Oct 16, 2024
1 parent 4fdcca6 commit 3e7cb9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tpu-provisioner/internal/cloud/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const (
V4PodSliceAccelerator = "tpu-v4-podslice"
V5ePodSliceAccelerator = "tpu-v5-lite-podslice"
V5pPodSliceAccelerator = "tpu-v5p-slice"
V6eSliceAccelerator = "tpu-v6e-slice"

// Resource type labels
GoogleTPUResource = "google.com/tpu"
Expand Down Expand Up @@ -438,7 +439,7 @@ func tpuTopologyToNodeCount(accelerator, topo string) (int, error) {
switch accelerator {
case V4PodSliceAccelerator, V5pPodSliceAccelerator:
expectedDims = 3
case V5ePodSliceAccelerator:
case V5ePodSliceAccelerator, V6eSliceAccelerator:
expectedDims = 2
default:
return 0, fmt.Errorf("invalid accelerator: %v", accelerator)
Expand Down Expand Up @@ -475,6 +476,8 @@ func tpuMachineType(accel string, tpuRequest int) (string, error) {
return fmt.Sprintf("ct5lp-hightpu-%vt", tpuRequest), nil
case V5pPodSliceAccelerator: // v5p
return fmt.Sprintf("ct5p-hightpu-%vt", tpuRequest), nil
case V6eSliceAccelerator: // v6e
return fmt.Sprintf("ct6e-standard-%vt", tpuRequest), nil
}

return "", fmt.Errorf("invalid accelerator: %v", accel)
Expand Down
10 changes: 10 additions & 0 deletions tpu-provisioner/internal/cloud/gke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ func Test_tpuTopologyToNodeCount(t *testing.T) {
topo: "not-a-topo",
err: true,
},
{
accel: "tpu-v6e-slice",
topo: "16x16",
count: 64,
},
{
accel: "tpu-v6e-slice",
topo: "1x1x1",
err: true,
},
}

for _, c := range cases {
Expand Down

0 comments on commit 3e7cb9b

Please sign in to comment.