Repository navigation
Accept the AI Runtime GPU types in ssh connect --accelerator
#7833
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
base: main
Are you sure you want to change the base?
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 @@ | ||
| * `databricks ssh connect --accelerator` now accepts every AI Runtime GPU type the CLI knows, including `GPU_1xH100`, `GPU_8xB300` and `GPU_1xRTX6000`. ([#7833](https://github.com/databricks/cli/pull/7833)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package aircmd | |
| import ( | ||
| "errors" | ||
| "fmt" | ||
| "slices" | ||
| "strings" | ||
| ) | ||
|
|
||
|
|
@@ -18,12 +19,24 @@ const ( | |
| gpuType1xRTX6000 gpuType = "GPU_1xRTX6000" | ||
| ) | ||
|
|
||
| // KnownGPUTypes lists the accelerator types this CLI accepts, in the order they are shown | ||
| // to users. `ssh connect --accelerator` validates against the same list, so the two entry | ||
| // points to AI Runtime GPUs agree on the types they offer. | ||
| func KnownGPUTypes() []string { | ||
| return []string{ | ||
| string(gpuType1xA10), | ||
| string(gpuType1xH100), | ||
| string(gpuType8xH100), | ||
| string(gpuType8xB300), | ||
| string(gpuType1xRTX6000), | ||
| } | ||
| } | ||
|
|
||
| // parseGPUType resolves a YAML accelerator_type string to a gpuType. The match is | ||
| // exact: the server's lookup is case-sensitive. The error lists no types because | ||
| // which ones a workspace can use comes from the server, not this CLI. | ||
| func parseGPUType(value string) (gpuType, error) { | ||
| switch gpuType(value) { | ||
| case gpuType1xA10, gpuType8xH100, gpuType1xH100, gpuType8xB300, gpuType1xRTX6000: | ||
|
Contributor
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. @caroline-db I thought you already removed this list from the CLI client code in favor of the server-side GPU type list. Is this one still used? |
||
| if slices.Contains(KnownGPUTypes(), value) { | ||
| return gpuType(value), nil | ||
| } | ||
| return "", fmt.Errorf("%q is not a recognized accelerator type", value) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,11 +17,13 @@ import ( | |
| "os/signal" | ||
| "path/filepath" | ||
| "regexp" | ||
| "slices" | ||
| "strconv" | ||
| "strings" | ||
| "syscall" | ||
| "time" | ||
|
|
||
| aircmd "github.com/databricks/cli/cmd/air" | ||
| "github.com/databricks/cli/experimental/ssh/internal/keys" | ||
| "github.com/databricks/cli/experimental/ssh/internal/proxy" | ||
| "github.com/databricks/cli/experimental/ssh/internal/sshconfig" | ||
|
|
@@ -165,8 +167,9 @@ func (o *ClientOptions) Validate() error { | |
| if o.UsagePolicyID != "" && o.ClusterID != "" { | ||
| return errors.New("--usage-policy-id flag can only be used with serverless compute (--name flag)") | ||
| } | ||
| if o.Accelerator != "" && o.Accelerator != "GPU_1xA10" && o.Accelerator != "GPU_8xH100" { | ||
| return fmt.Errorf("invalid accelerator value: %q, expected %q or %q", o.Accelerator, "GPU_1xA10", "GPU_8xH100") | ||
| // The same GPU types `databricks air` accepts; the workspace still decides which it offers. | ||
| if o.Accelerator != "" && !slices.Contains(aircmd.KnownGPUTypes(), o.Accelerator) { | ||
|
Contributor
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. The validation is more nuanced: Not all environment versions work with all GPU types. For example, B300 requires v6+. Can you change the validation here to check each environment-version × accelerator combination? Even better: move the validation to server side (AI Training) and then we can add more GPU types any time without asking the users to upgrade CLI. |
||
| return fmt.Errorf("invalid accelerator value: %q, expected one of %s", o.Accelerator, strings.Join(aircmd.KnownGPUTypes(), ", ")) | ||
| } | ||
| if o.ConnectionName != "" && !connectionNameRegex.MatchString(o.ConnectionName) { | ||
| return fmt.Errorf("connection name %q must consist of letters, numbers, dashes, and underscores", o.ConnectionName) | ||
|
|
||
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.
can we call AICM's ListComputeOptions to get the list of gpu types available to the user in their workspace? AIR CLI does this already.
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.
When Jobs provisions the SSH session, AICM’s CreateSession already checks whether the workspace can use the requested GPU. Do we really need the check in CLI using one additional RPC call?