-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support JSON format logs in file-metrics-collector
- Loading branch information
Showing
27 changed files
with
770 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
examples/v1beta1/early-stopping/median-stop-with-json-format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# This is example with median stopping early stopping rule with logs in JSON format. | ||
# It has bad feasible space for learning rate to show more early stopped Trials. | ||
apiVersion: kubeflow.org/v1beta1 | ||
kind: Experiment | ||
metadata: | ||
namespace: kubeflow | ||
name: median-stop-with-json-format | ||
spec: | ||
objective: | ||
type: maximize | ||
goal: 0.99 | ||
objectiveMetricName: accuracy | ||
additionalMetricNames: | ||
- loss | ||
metricsCollectorSpec: | ||
source: | ||
fileSystemPath: | ||
path: "/katib/mnist.json" | ||
kind: File | ||
fileFormat: JSON | ||
collector: | ||
kind: File | ||
algorithm: | ||
algorithmName: random | ||
earlyStopping: | ||
algorithmName: medianstop | ||
algorithmSettings: | ||
- name: min_trials_required | ||
value: "1" | ||
- name: start_step | ||
value: "2" | ||
parallelTrialCount: 2 | ||
maxTrialCount: 15 | ||
maxFailedTrialCount: 3 | ||
parameters: | ||
- name: lr | ||
parameterType: double | ||
feasibleSpace: | ||
min: "0.01" | ||
max: "0.5" | ||
- name: num-epochs | ||
parameterType: int | ||
feasibleSpace: | ||
min: "3" | ||
max: "4" | ||
trialTemplate: | ||
retain: true | ||
primaryContainerName: training-container | ||
trialParameters: | ||
- name: learningRate | ||
description: Learning rate for the training model | ||
reference: lr | ||
- name: numberEpochs | ||
description: Number of epochs to train the model | ||
reference: num-epochs | ||
trialSpec: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: training-container | ||
image: docker.io/kubeflowkatib/pytorch-mnist:latest | ||
command: | ||
- "python3" | ||
- "/opt/pytorch-mnist/mnist.py" | ||
- "--epochs=${trialParameters.numberEpochs}" | ||
- "--log-path=/katib/mnist.json" | ||
- "--lr=${trialParameters.learningRate}" | ||
- "--logger=hypertune" | ||
restartPolicy: Never |
63 changes: 63 additions & 0 deletions
63
examples/v1beta1/metrics-collector/file-metrics-collector-with-json-format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: kubeflow.org/v1beta1 | ||
kind: Experiment | ||
metadata: | ||
namespace: kubeflow | ||
name: file-metrics-collector-with-json-format | ||
spec: | ||
objective: | ||
type: maximize | ||
goal: 0.99 | ||
objectiveMetricName: accuracy | ||
additionalMetricNames: | ||
- loss | ||
metricsCollectorSpec: | ||
source: | ||
fileSystemPath: | ||
path: "/katib/mnist.json" | ||
kind: File | ||
fileFormat: JSON | ||
collector: | ||
kind: File | ||
algorithm: | ||
algorithmName: random | ||
parallelTrialCount: 3 | ||
maxTrialCount: 12 | ||
maxFailedTrialCount: 3 | ||
parameters: | ||
- name: lr | ||
parameterType: double | ||
feasibleSpace: | ||
min: "0.01" | ||
max: "0.03" | ||
- name: momentum | ||
parameterType: double | ||
feasibleSpace: | ||
min: "0.3" | ||
max: "0.7" | ||
trialTemplate: | ||
primaryContainerName: training-container | ||
trialParameters: | ||
- name: learningRate | ||
description: Learning rate for the training model | ||
reference: lr | ||
- name: momentum | ||
description: Momentum for the training model | ||
reference: momentum | ||
trialSpec: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: training-container | ||
image: docker.io/kubeflowkatib/pytorch-mnist:latest | ||
command: | ||
- "python3" | ||
- "/opt/pytorch-mnist/mnist.py" | ||
- "--epochs=2" | ||
- "--log-path=/katib/mnist.json" | ||
- "--lr=${trialParameters.learningRate}" | ||
- "--momentum=${trialParameters.momentum}" | ||
- "--logger=hypertune" | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.