You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
metrics_collection_mechanism: str="pull", # The newly added parameter
52
+
)
53
+
```
54
+
55
+
## Implementation
56
+
57
+
### Add New Parameter in `tune`
58
+
59
+
As is mentioned above, we decided to add `metrics_collection_mechanism` to the tune function in Python SDK. Also, we have some changes to be made:
60
+
61
+
1. Disable injection: set `katib.kubeflow.org/metrics-collector-injection` to `disabled` when the push-based way of metrics collection is adopted so as to disable the injection of the metrics collection sidecar container.
62
+
63
+
2. Configure the way of metrics collection: set the configuration `spec.metricsCollectionSpec.collector.kind`(specify the way of metrics collection) to `NoneCollector`.
64
+
65
+
### Code Injection in Webhook
66
+
67
+
We decided to implement a code replacing function in Experiment Mutating Webhook. When `spec.metricsCollectionSpec.collector.kind` is set to `NoneCollector`, the code replacing function will recognize the metrics output lines (e.g. print, log.Info, e.t.c.) and replace them with push-based metrics collection code which will be discussed in the next section. It’s a better decision compared with offering users a `katib_client.push`-like interface, for that users can’t use a yaml file to define this operation.
68
+
69
+
### Push-based Metrics Collection Code
70
+
71
+
The push-based metrics collection code is a function making a grpc call to the persistent API to store training metrics. It will be injected to container args in the Experiment Mutating Webhook and then be called inside the Trial Worker Pod to push metrics to Katib DB.
72
+
73
+
### Collection of Final Metrics
74
+
75
+
The final metrics of worker pods should be pushed to Katib DB directly in the push mode of metrics collection.
0 commit comments