Skip to content

Commit 74e8423

Browse files
training: replace capacityUnitCount with gpuCount per service decision
Service decided against capacityUnitCount terminology. The MFE contract now exposes gpuCount at properties level for partial-GPU allocation on GPU clusters. CPU clusters continue to use full SKUs via instanceCount only.
1 parent fa1a593 commit 74e8423

6 files changed

Lines changed: 15 additions & 19 deletions

File tree

cli/azd/extensions/azure.ai.training/internal/cmd/init_template.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ environment: <user to add>
7575
compute: <user to add>
7676
7777
# Optional: choose one of the two ways to size the job.
78-
# capacity_unit_counttotal cores across the allocation (1, 2, 4, 8 or multiple of 8).
79-
# The service picks the smallest SKU that fits and slices nodes as needed (partial SKU).
80-
# resources.instance_count — whole nodes of the compute cluster's full SKU.
78+
# gpu_countnumber of GPUs to allocate (partial SKU on GPU clusters only).
79+
# The service picks the smallest GPU SKU that fits and slices nodes as needed.
80+
# resources.instance_count — whole nodes of the compute cluster's full SKU (CPU or GPU).
8181
# Default when nothing is set: instance_count = 1.
82-
# capacity_unit_count: 4
82+
# gpu_count: 2
8383
resources:
8484
instance_count: 1
8585

cli/azd/extensions/azure.ai.training/internal/cmd/job_show.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,9 @@ func printComputeSection(d *jobDetails) {
481481
if c.InstanceCount > 0 {
482482
fmt.Fprintf(w, "Nodes:\t%d\n", c.InstanceCount)
483483
}
484-
// Capacity Units: prefer the top-level CapacityUnitCount from Get Job,
485-
// then whatever run history reports, then the SKU-level GPU count.
486-
if d.Job.Properties.CapacityUnitCount > 0 {
487-
fmt.Fprintf(w, "Capacity Units:\t%d\n", d.Job.Properties.CapacityUnitCount)
488-
} else if c.CapacityUnitCount > 0 {
489-
fmt.Fprintf(w, "Capacity Units:\t%d\n", c.CapacityUnitCount)
484+
// GPUs: prefer the top-level GPUCount from Get Job, otherwise use what run history reports.
485+
if d.Job.Properties.GPUCount > 0 {
486+
fmt.Fprintf(w, "GPUs:\t%d\n", d.Job.Properties.GPUCount)
490487
} else if c.GPUCount > 0 {
491488
fmt.Fprintf(w, "GPUs:\t%d\n", c.GPUCount)
492489
}

cli/azd/extensions/azure.ai.training/internal/cmd/job_submit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func buildJobResource(def *utils.JobDefinition) *models.JobResource {
162162
Command: def.Command,
163163
EnvironmentImageReference: def.Environment,
164164
ComputeID: def.Compute,
165-
CapacityUnitCount: def.CapacityUnitCount,
165+
GPUCount: def.GPUCount,
166166
Priority: def.Priority,
167167
UserAssignedIdentityID: def.Identity,
168168
CodeID: def.Code,
@@ -212,9 +212,9 @@ func buildJobResource(def *utils.JobDefinition) *models.JobResource {
212212

213213
// Resources — only instance_count survives on the wire. instance_type, slaTier and the
214214
// AISuperComputer sub-block are now inferred by the service from the compute cluster;
215-
// priority is a top-level CommandJob field; partial-SKU is expressed via top-level
216-
// capacity_unit_count. Accept instance_count from either the structured resources block
217-
// or the flat top-level field.
215+
// priority is a top-level CommandJob field; partial GPU allocation is expressed via the
216+
// top-level gpu_count field. Accept instance_count from either the structured resources
217+
// block or the flat top-level field.
218218
if def.Resources != nil && def.Resources.InstanceCount > 0 {
219219
job.Resources = &models.ResourceConfig{
220220
InstanceCount: def.Resources.InstanceCount,

cli/azd/extensions/azure.ai.training/internal/utils/yaml_parser.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type JobDefinition struct {
2929
Distribution *DistributionDefinition `yaml:"distribution"`
3030
Resources *ResourceDefinition `yaml:"resources"`
3131
InstanceCount int `yaml:"instance_count"`
32-
CapacityUnitCount int `yaml:"capacity_unit_count"`
32+
GPUCount int `yaml:"gpu_count"`
3333
Priority string `yaml:"priority"`
3434
EnvironmentVariables map[string]string `yaml:"environment_variables"`
3535
Identity string `yaml:"identity"`
@@ -80,8 +80,8 @@ type ServiceDefinition struct {
8080
// ResourceDefinition represents the compute resource configuration in a YAML job definition.
8181
// Only instance_count is honored; instance_type, slaTier, priority and the AISuperComputer
8282
// properties block have been removed — the service now infers the SKU from the compute
83-
// cluster, priority is a top-level job field, and users specify partial capacity via the
84-
// top-level capacity_unit_count field.
83+
// cluster, priority is a top-level job field, and users specify partial GPU allocations
84+
// via the top-level gpu_count field (GPU clusters only).
8585
type ResourceDefinition struct {
8686
InstanceCount int `yaml:"instance_count"`
8787
}

cli/azd/extensions/azure.ai.training/pkg/models/history.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ type RunHistoryCompute struct {
5454
VMSize string `json:"vmSize,omitempty"`
5555
InstanceType string `json:"instanceType,omitempty"`
5656
InstanceCount int `json:"instanceCount,omitempty"`
57-
CapacityUnitCount int `json:"capacityUnitCount,omitempty"`
5857
GPUCount int `json:"gpuCount,omitempty"`
5958
Priority string `json:"priority,omitempty"`
6059
}

cli/azd/extensions/azure.ai.training/pkg/models/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type CommandJob struct {
2323
EnvironmentImageReference string `json:"environmentImageReference,omitempty"`
2424
CodeID string `json:"codeId,omitempty"`
2525
ComputeID string `json:"computeId,omitempty"`
26-
CapacityUnitCount int `json:"capacityUnitCount,omitempty"`
26+
GPUCount int `json:"gpuCount,omitempty"`
2727
Priority string `json:"priority,omitempty"`
2828
UserAssignedIdentityID string `json:"userAssignedIdentityId,omitempty"`
2929
Inputs map[string]JobInput `json:"inputs,omitempty"`

0 commit comments

Comments
 (0)