Skip to content

Commit

Permalink
fix what AI have fixed :)
Browse files Browse the repository at this point in the history
  • Loading branch information
punkerpunker committed Jan 28, 2025
1 parent bbb6e83 commit 6560ee2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,16 @@ func (p pytorchOperatorResourceHandler) BuildResource(ctx context.Context, taskC
}

jobSpec := kubeflowv1.PyTorchJobSpec{}
if *workerReplicaSpec.Replicas <= 0 {
replicaSpecs := map[commonOp.ReplicaType]*commonOp.ReplicaSpec{
kubeflowv1.PyTorchJobReplicaTypeMaster: masterReplicaSpec,
}
if workerReplicaSpec != nil {
replicaSpecs[kubeflowv1.PyTorchJobReplicaTypeWorker] = workerReplicaSpec
}
jobSpec = kubeflowv1.PyTorchJobSpec{
PyTorchReplicaSpecs: replicaSpecs,
RunPolicy: runPolicy,
}
replicaSpecs := map[commonOp.ReplicaType]*commonOp.ReplicaSpec{
kubeflowv1.PyTorchJobReplicaTypeMaster: masterReplicaSpec,
}
if *workerReplicaSpec.Replicas > 0 {
replicaSpecs[kubeflowv1.PyTorchJobReplicaTypeWorker] = workerReplicaSpec
}

jobSpec = kubeflowv1.PyTorchJobSpec{
PyTorchReplicaSpecs: replicaSpecs,
RunPolicy: runPolicy,
}

if elasticPolicy != nil {
Expand Down

0 comments on commit 6560ee2

Please sign in to comment.