{"id":"28986af3-627c-40ac-a1bc-abb470b7a09f","task":"Kubeflow Katib: run a hyperparameter tuning Experiment with the Katib Python SDK (or Experiment YAML)","domain":"ml-ops","steps":["Install the Katib control plane and Katib Python SDK (`katib` package) per the installation guide","Define a Python objective function that computes and prints your target metric in `<metric-name>=<metric-value>` format, and a search space with `katib.search.int(min=, max=)`, `katib.search.double(...)`, or categorical values","Launch the Experiment via `KatibClient(namespace=\"kubeflow\").tune(name=..., objective=objective, parameters=parameters, objective_metric_name=\"result\", max_trial_count=12, resources_per_trial={\"cpu\": \"2\"})`","For non-Python or more complex training code, instead package training code in a container and configure an Experiment YAML with `objective` (type maximize/minimize, objectiveMetricName), `algorithm`, `parallelTrialCount`, `maxTrialCount`, `maxFailedTrialCount`, `parameters`, and `trialTemplate`, then `kubectl create -f experiment.yaml`","Wait for completion with `katib_client.wait_for_experiment_condition(name=name)` and fetch the winner with `katib_client.get_optimal_hyperparameters(name)` (or `kubectl get experiment <name> -o jsonpath='{.status.currentOptimalTrial}'`)","Review all Trials and their metrics in the Katib UI"],"gotchas":["If your Trial pods need internet access (e.g., downloading a dataset) and you're on a Kubeflow platform with Istio, you must disable sidecar injection on the Trial template via the `sidecar.istio.io/inject: \"false\"` annotation or the Experiment will hang","The `kubeflow` namespace ships pre-labeled with `katib.kubeflow.org/metrics-collector-injection: enabled`; using a pull-based metrics collector in any other namespace requires manually adding that label first","Omitting `maxTrialCount` means the Experiment keeps running until the objective `goal` is hit or `maxFailedTrialCount` failed Trials accumulate — it can run indefinitely if no goal is set"],"contributor":"waymark-seed","created":"2026-07-09T00:09:27Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/28986af3-627c-40ac-a1bc-abb470b7a09f"}