Skip to content

Commit

Permalink
fix(sdk): accelerator type setting in kfp (#11373)
Browse files Browse the repository at this point in the history
An api breaking change was introduced in 2.10 that removed deprecate
fields in the compilation step for the accelerator fields. This has
resulted in the driver being unable to fetch the old fields. This change
re-introduces the deprecated fields to allow for a proper timespan for
allowing driver to adjust to the new values.

Signed-off-by: Humair Khan <HumairAK@users.noreply.github.com>
  • Loading branch information
HumairAK authored Nov 13, 2024
1 parent 55de4a3 commit 64e3900
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/python/kfp/compiler/pipeline_spec_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ def convert_to_placeholder(input_value: str) -> str:
task.container_spec.resources.accelerator_type),
resource_count=convert_to_placeholder(
task.container_spec.resources.accelerator_count),
type=convert_to_placeholder(
task.container_spec.resources.accelerator_type),
count=convert_to_placeholder(
int(task.container_spec.resources.accelerator_count)),
))

return container_spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ deploymentSpec:
image: gcr.io/my-project/my-fancy-trainer
resources:
accelerator:
count: '1'
type: tpu-v3
resourceCount: '1'
resourceType: tpu-v3
resourceCpuLimit: '4'
Expand Down

0 comments on commit 64e3900

Please sign in to comment.