Skip to content

Commit

Permalink
[SDK] Enable resource specification for trial containers
Browse files Browse the repository at this point in the history
  • Loading branch information
droctothorpe committed Aug 2, 2023
1 parent c749d27 commit e0b9f5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/python/v1beta1/kubeflow/katib/api/katib_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def tune(
retain_trials: bool = False,
packages_to_install: List[str] = None,
pip_index_url: str = "https://pypi.org/simple",
resources: Optional[client.V1ResourceRequirements] = None,
):
"""Create HyperParameter Tuning Katib Experiment from the objective function.
Expand Down Expand Up @@ -182,6 +183,9 @@ def tune(
to the base image packages. These packages are installed before
executing the objective function.
pip_index_url: The PyPI url from which to install Python packages.
resources: An optional kubernetes.client.V1ResourceRequirements object that lets
you manully specify cpu and memory limits and requests for the trial container.
Additional details are available at https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1ResourceRequirements.md.
Raises:
ValueError: Objective function has invalid arguments.
Expand Down Expand Up @@ -297,6 +301,7 @@ def tune(
image=base_image,
command=["bash", "-c"],
args=[exec_script],
resources=resources,
)
],
),
Expand Down

0 comments on commit e0b9f5b

Please sign in to comment.