-
Notifications
You must be signed in to change notification settings - Fork 486
Support JSON format logs in file-metrics-collector
#1765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
google-oss-prow
merged 15 commits into
kubeflow:master
from
tenzen-y:support-json-format-in-file-metrics-collector
Apr 5, 2022
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c82fdf5
support JSON format logs in file-metrics-collector
tenzen-y 572f071
review: convert fileFormat to type FileSystemFileFormat
tenzen-y 0265372
Update cmd/metricscollector/v1beta1/file-metricscollector/main.go
tenzen-y c38dd5a
review: remove func (f FileSystemFileFormat) String()
tenzen-y 703bed8
review: get metricRegList only when the format is TEXT
tenzen-y d95f2a0
review: change var name in a script for e2e
tenzen-y 68ffbcc
review: explict specify the cloudml-hypyertune in the Dockerfile
tenzen-y 2c8aaa1
review: use reflect.DeepEqual instead of go-cmp.Diff
tenzen-y 8fb51d4
review: stop using 'JSON' directly in error statements
tenzen-y 6930468
review: install specific version cloudml-hypertune
tenzen-y 774dd4b
review: get objType in the updateStopRules function
tenzen-y 051952a
review: save optimalObjValue across multiple stopRules
tenzen-y 35cfcff
review: add warning messages to parseTimestamp func
tenzen-y 26f04ef
review: generate test files with go test command
tenzen-y cb456dd
review: change api for new feature
tenzen-y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 | ||
format: 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we didn't add
for idx, rule := range stopRules
under this function, howoptimalObjValue
will be saved across multiplestopRules
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops...
You're right, this implementation can't update the
optimalObjValue
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed in
124500b
.Could you please take another look? @andreyvelich