diff --git a/.github/workflows/e2e-test-pytorch-mnist.yaml b/.github/workflows/e2e-test-pytorch-mnist.yaml index dd715975166..75828142337 100644 --- a/.github/workflows/e2e-test-pytorch-mnist.yaml +++ b/.github/workflows/e2e-test-pytorch-mnist.yaml @@ -41,5 +41,7 @@ jobs: - "long-running-resume,from-volume-resume,median-stop" # others - "grid,bayesian-optimization,tpe,multivariate-tpe,cma-es,hyperband" + - "hyperopt-distribution" - "file-metrics-collector,pytorchjob-mnist" - "median-stop-with-json-format,file-metrics-collector-with-json-format" + \ No newline at end of file diff --git a/examples/v1beta1/hp-tuning/hyperopt-distribution.yaml b/examples/v1beta1/hp-tuning/hyperopt-distribution.yaml new file mode 100644 index 00000000000..c0455b19882 --- /dev/null +++ b/examples/v1beta1/hp-tuning/hyperopt-distribution.yaml @@ -0,0 +1,74 @@ +--- +apiVersion: kubeflow.org/v1beta1 +kind: Experiment +metadata: + namespace: kubeflow + name: hyperopt-distribution +spec: + objective: + type: minimize + goal: 0.05 + objectiveMetricName: loss + algorithm: + algorithmName: random + parallelTrialCount: 3 + maxTrialCount: 12 + maxFailedTrialCount: 3 + parameters: + - name: lr + parameterType: double + feasibleSpace: + min: "0.01" + max: "0.05" + step: "0.01" + distribution: normal + - name: momentum + parameterType: double + feasibleSpace: + min: "0.001" + max: "1" + distribution: uniform + - name: epochs + parameterType: int + feasibleSpace: + min: "1" + max: "3" + distribution: logUniform + - name: batch_size + parameterType: int + feasibleSpace: + min: "32" + max: "64" + distribution: logNormal + 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 + - name: epochs + description: Epochs + reference: epochs + - name: batchSize + description: Batch Size + reference: batch_size + trialSpec: + apiVersion: batch/v1 + kind: Job + spec: + template: + spec: + containers: + - name: training-container + image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest + command: + - "python3" + - "/opt/pytorch-mnist/mnist.py" + - "--epochs=${trialParameters.epochs}" + - "--batch-size=${trialParameters.batchSize}" + - "--lr=${trialParameters.learningRate}" + - "--momentum=${trialParameters.momentum}" + restartPolicy: Never \ No newline at end of file diff --git a/pkg/apis/manager/v1beta1/api.pb.go b/pkg/apis/manager/v1beta1/api.pb.go index 862db115141..65d45b25e7f 100644 --- a/pkg/apis/manager/v1beta1/api.pb.go +++ b/pkg/apis/manager/v1beta1/api.pb.go @@ -85,28 +85,28 @@ func (ParameterType) EnumDescriptor() ([]byte, []int) { type Distribution int32 const ( - Distribution_UNIFORM Distribution = 0 - Distribution_LOG_UNIFORM Distribution = 1 - Distribution_NORMAL Distribution = 2 - Distribution_LOG_NORMAL Distribution = 3 - Distribution_DISTRIBUTION_UNKNOWN Distribution = 4 + Distribution_DISTRIBUTION_UNSPECIFIED Distribution = 0 + Distribution_UNIFORM Distribution = 1 + Distribution_LOG_UNIFORM Distribution = 2 + Distribution_NORMAL Distribution = 3 + Distribution_LOG_NORMAL Distribution = 4 ) // Enum value maps for Distribution. var ( Distribution_name = map[int32]string{ - 0: "UNIFORM", - 1: "LOG_UNIFORM", - 2: "NORMAL", - 3: "LOG_NORMAL", - 4: "DISTRIBUTION_UNKNOWN", + 0: "DISTRIBUTION_UNSPECIFIED", + 1: "UNIFORM", + 2: "LOG_UNIFORM", + 3: "NORMAL", + 4: "LOG_NORMAL", } Distribution_value = map[string]int32{ - "UNIFORM": 0, - "LOG_UNIFORM": 1, - "NORMAL": 2, - "LOG_NORMAL": 3, - "DISTRIBUTION_UNKNOWN": 4, + "DISTRIBUTION_UNSPECIFIED": 0, + "UNIFORM": 1, + "LOG_UNIFORM": 2, + "NORMAL": 3, + "LOG_NORMAL": 4, } ) @@ -608,7 +608,7 @@ func (x *FeasibleSpace) GetDistribution() Distribution { if x != nil { return x.Distribution } - return Distribution_UNIFORM + return Distribution_DISTRIBUTION_UNSPECIFIED } // * @@ -3037,83 +3037,83 @@ var file_api_proto_rawDesc = []byte{ 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x43, 0x52, 0x45, 0x54, 0x45, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, - 0x49, 0x43, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x62, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x49, 0x46, 0x4f, 0x52, - 0x4d, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x4f, 0x47, 0x5f, 0x55, 0x4e, 0x49, 0x46, 0x4f, - 0x52, 0x4d, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x02, - 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x4f, 0x47, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x03, - 0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x04, 0x2a, 0x38, 0x0a, 0x0d, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x49, 0x4e, 0x49, - 0x4d, 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, 0x58, 0x49, 0x4d, 0x49, - 0x5a, 0x45, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, - 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x09, - 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x53, - 0x53, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x10, 0x03, - 0x32, 0xc6, 0x02, 0x0a, 0x09, 0x44, 0x42, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x6a, - 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x61, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, - 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x6a, 0x0a, - 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xe1, 0x01, 0x0a, 0x0a, 0x53, 0x75, - 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, - 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, - 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x12, 0x79, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, - 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xe0, 0x02, - 0x0a, 0x0d, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, - 0x6d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x49, 0x43, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x66, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x18, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, + 0x42, 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x49, 0x46, 0x4f, 0x52, 0x4d, 0x10, + 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x4f, 0x47, 0x5f, 0x55, 0x4e, 0x49, 0x46, 0x4f, 0x52, 0x4d, + 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x0e, + 0x0a, 0x0a, 0x4c, 0x4f, 0x47, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x38, + 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x4d, 0x49, 0x4e, 0x49, 0x4d, 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, + 0x58, 0x49, 0x4d, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, + 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, + 0x04, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x45, 0x41, 0x54, + 0x45, 0x52, 0x10, 0x03, 0x32, 0xc6, 0x02, 0x0a, 0x09, 0x44, 0x42, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x12, 0x6a, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x61, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x6f, 0x67, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x6a, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, + 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xe1, 0x01, + 0x0a, 0x0a, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x79, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x32, 0xe0, 0x02, 0x0a, 0x0d, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x6d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, + 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, + 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, - 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x58, - 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x85, 0x01, 0x0a, 0x1d, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x58, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x85, 0x01, 0x0a, + 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, + 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, - 0x75, 0x62, 0x65, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x61, 0x74, 0x69, 0x62, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x5f, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, + 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x61, 0x74, 0x69, + 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x76, + 0x31, 0x5f, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/apis/manager/v1beta1/api.proto b/pkg/apis/manager/v1beta1/api.proto index f3fabf977dc..b4e14e87314 100644 --- a/pkg/apis/manager/v1beta1/api.proto +++ b/pkg/apis/manager/v1beta1/api.proto @@ -101,11 +101,11 @@ enum ParameterType { * Distribution types for HyperParameter. */ enum Distribution { - UNIFORM = 0; - LOG_UNIFORM = 1; - NORMAL = 2; - LOG_NORMAL = 3; - DISTRIBUTION_UNKNOWN = 4; + DISTRIBUTION_UNSPECIFIED = 0; + UNIFORM = 1; + LOG_UNIFORM = 2; + NORMAL = 3; + LOG_NORMAL = 4; } /** diff --git a/pkg/apis/manager/v1beta1/python/api_pb2.py b/pkg/apis/manager/v1beta1/python/api_pb2.py index 3a95a64b82b..18a5d4e0807 100644 --- a/pkg/apis/manager/v1beta1/python/api_pb2.py +++ b/pkg/apis/manager/v1beta1/python/api_pb2.py @@ -14,7 +14,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tapi.proto\x12\x0c\x61pi.v1.beta1\"R\n\nExperiment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x04spec\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ExperimentSpecR\x04spec\"\x85\x04\n\x0e\x45xperimentSpec\x12T\n\x0fparameter_specs\x18\x01 \x01(\x0b\x32+.api.v1.beta1.ExperimentSpec.ParameterSpecsR\x0eparameterSpecs\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x39\n\talgorithm\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12\x46\n\x0e\x65\x61rly_stopping\x18\x04 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\x12\x30\n\x14parallel_trial_count\x18\x05 \x01(\x05R\x12parallelTrialCount\x12&\n\x0fmax_trial_count\x18\x06 \x01(\x05R\rmaxTrialCount\x12\x36\n\nnas_config\x18\x07 \x01(\x0b\x32\x17.api.v1.beta1.NasConfigR\tnasConfig\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"\xab\x01\n\rParameterSpec\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x42\n\x0eparameter_type\x18\x02 \x01(\x0e\x32\x1b.api.v1.beta1.ParameterTypeR\rparameterType\x12\x42\n\x0e\x66\x65\x61sible_space\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.FeasibleSpaceR\rfeasibleSpace\"\x9b\x01\n\rFeasibleSpace\x12\x10\n\x03max\x18\x01 \x01(\tR\x03max\x12\x10\n\x03min\x18\x02 \x01(\tR\x03min\x12\x12\n\x04list\x18\x03 \x03(\tR\x04list\x12\x12\n\x04step\x18\x04 \x01(\tR\x04step\x12>\n\x0c\x64istribution\x18\x05 \x01(\x0e\x32\x1a.api.v1.beta1.DistributionR\x0c\x64istribution\"\xc0\x01\n\rObjectiveSpec\x12/\n\x04type\x18\x01 \x01(\x0e\x32\x1b.api.v1.beta1.ObjectiveTypeR\x04type\x12\x12\n\x04goal\x18\x02 \x01(\x01R\x04goal\x12\x32\n\x15objective_metric_name\x18\x03 \x01(\tR\x13objectiveMetricName\x12\x36\n\x17\x61\x64\x64itional_metric_names\x18\x04 \x03(\tR\x15\x61\x64\x64itionalMetricNames\"\x85\x01\n\rAlgorithmSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12M\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\x1e.api.v1.beta1.AlgorithmSettingR\x11\x61lgorithmSettings\"<\n\x10\x41lgorithmSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x8d\x01\n\x11\x45\x61rlyStoppingSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12Q\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\".api.v1.beta1.EarlyStoppingSettingR\x11\x61lgorithmSettings\"@\n\x14\x45\x61rlyStoppingSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xd2\x01\n\tNasConfig\x12<\n\x0cgraph_config\x18\x01 \x01(\x0b\x32\x19.api.v1.beta1.GraphConfigR\x0bgraphConfig\x12\x42\n\noperations\x18\x02 \x01(\x0b\x32\".api.v1.beta1.NasConfig.OperationsR\noperations\x1a\x43\n\nOperations\x12\x35\n\toperation\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.OperationR\toperation\"p\n\x0bGraphConfig\x12\x1d\n\nnum_layers\x18\x01 \x01(\x05R\tnumLayers\x12\x1f\n\x0binput_sizes\x18\x02 \x03(\x05R\ninputSizes\x12!\n\x0coutput_sizes\x18\x03 \x03(\x05R\x0boutputSizes\"\xd2\x01\n\tOperation\x12%\n\x0eoperation_type\x18\x01 \x01(\tR\roperationType\x12O\n\x0fparameter_specs\x18\x02 \x01(\x0b\x32&.api.v1.beta1.Operation.ParameterSpecsR\x0eparameterSpecs\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"{\n\x05Trial\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12+\n\x04spec\x18\x02 \x01(\x0b\x32\x17.api.v1.beta1.TrialSpecR\x04spec\x12\x31\n\x06status\x18\x03 \x01(\x0b\x32\x19.api.v1.beta1.TrialStatusR\x06status\"\xfe\x02\n\tTrialSpec\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x61\n\x15parameter_assignments\x18\x03 \x01(\x0b\x32,.api.v1.beta1.TrialSpec.ParameterAssignmentsR\x14parameterAssignments\x12;\n\x06labels\x18\x04 \x03(\x0b\x32#.api.v1.beta1.TrialSpec.LabelsEntryR\x06labels\x1a[\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"?\n\x13ParameterAssignment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xed\x02\n\x0bTrialStatus\x12\x1d\n\nstart_time\x18\x01 \x01(\tR\tstartTime\x12\'\n\x0f\x63ompletion_time\x18\x02 \x01(\tR\x0e\x63ompletionTime\x12J\n\tcondition\x18\x03 \x01(\x0e\x32,.api.v1.beta1.TrialStatus.TrialConditionTypeR\tcondition\x12;\n\x0bobservation\x18\x04 \x01(\x0b\x32\x19.api.v1.beta1.ObservationR\x0bobservation\"\x8c\x01\n\x12TrialConditionType\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06KILLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x16\n\x12METRICSUNAVAILABLE\x10\x05\x12\x10\n\x0c\x45\x41RLYSTOPPED\x10\x06\x12\x0b\n\x07UNKNOWN\x10\x07\"=\n\x0bObservation\x12.\n\x07metrics\x18\x01 \x03(\x0b\x32\x14.api.v1.beta1.MetricR\x07metrics\"2\n\x06Metric\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x83\x01\n\x1bReportObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x45\n\x0fobservation_log\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"\x1b\n\x19ReportObservationLogReply\"J\n\x0eObservationLog\x12\x38\n\x0bmetric_logs\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.MetricLogR\nmetricLogs\"X\n\tMetricLog\x12\x1d\n\ntime_stamp\x18\x01 \x01(\tR\ttimeStamp\x12,\n\x06metric\x18\x02 \x01(\x0b\x32\x14.api.v1.beta1.MetricR\x06metric\"\x94\x01\n\x18GetObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x1f\n\x0bmetric_name\x18\x02 \x01(\tR\nmetricName\x12\x1d\n\nstart_time\x18\x03 \x01(\tR\tstartTime\x12\x19\n\x08\x65nd_time\x18\x04 \x01(\tR\x07\x65ndTime\"_\n\x16GetObservationLogReply\x12\x45\n\x0fobservation_log\x18\x01 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"<\n\x1b\x44\x65leteObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x1b\n\x19\x44\x65leteObservationLogReply\"\xe6\x01\n\x15GetSuggestionsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12\x34\n\x16\x63urrent_request_number\x18\x04 \x01(\x05R\x14\x63urrentRequestNumber\x12\x30\n\x14total_request_number\x18\x05 \x01(\x05R\x12totalRequestNumber\"\xa4\x04\n\x13GetSuggestionsReply\x12k\n\x15parameter_assignments\x18\x01 \x03(\x0b\x32\x36.api.v1.beta1.GetSuggestionsReply.ParameterAssignmentsR\x14parameterAssignments\x12\x39\n\talgorithm\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x03 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\x1a\x91\x02\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x12\x1d\n\ntrial_name\x18\x02 \x01(\tR\ttrialName\x12Z\n\x06labels\x18\x03 \x03(\x0b\x32\x42.api.v1.beta1.GetSuggestionsReply.ParameterAssignments.LabelsEntryR\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\\\n ValidateAlgorithmSettingsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\" \n\x1eValidateAlgorithmSettingsReply\"\xb3\x01\n\x1cGetEarlyStoppingRulesRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12,\n\x12\x64\x62_manager_address\x18\x03 \x01(\tR\x10\x64\x62ManagerAddress\"o\n\x1aGetEarlyStoppingRulesReply\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x01 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\"\x9a\x01\n\x11\x45\x61rlyStoppingRule\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x12<\n\ncomparison\x18\x03 \x01(\x0e\x32\x1c.api.v1.beta1.ComparisonTypeR\ncomparison\x12\x1d\n\nstart_step\x18\x04 \x01(\x05R\tstartStep\"n\n$ValidateEarlyStoppingSettingsRequest\x12\x46\n\x0e\x65\x61rly_stopping\x18\x01 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\"$\n\"ValidateEarlyStoppingSettingsReply\"6\n\x15SetTrialStatusRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x15\n\x13SetTrialStatusReply*U\n\rParameterType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\x07\n\x03INT\x10\x02\x12\x0c\n\x08\x44ISCRETE\x10\x03\x12\x0f\n\x0b\x43\x41TEGORICAL\x10\x04*b\n\x0c\x44istribution\x12\x0b\n\x07UNIFORM\x10\x00\x12\x0f\n\x0bLOG_UNIFORM\x10\x01\x12\n\n\x06NORMAL\x10\x02\x12\x0e\n\nLOG_NORMAL\x10\x03\x12\x18\n\x14\x44ISTRIBUTION_UNKNOWN\x10\x04*8\n\rObjectiveType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08MINIMIZE\x10\x01\x12\x0c\n\x08MAXIMIZE\x10\x02*J\n\x0e\x43omparisonType\x12\x16\n\x12UNKNOWN_COMPARISON\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\x08\n\x04LESS\x10\x02\x12\x0b\n\x07GREATER\x10\x03\x32\xc6\x02\n\tDBManager\x12j\n\x14ReportObservationLog\x12).api.v1.beta1.ReportObservationLogRequest\x1a\'.api.v1.beta1.ReportObservationLogReply\x12\x61\n\x11GetObservationLog\x12&.api.v1.beta1.GetObservationLogRequest\x1a$.api.v1.beta1.GetObservationLogReply\x12j\n\x14\x44\x65leteObservationLog\x12).api.v1.beta1.DeleteObservationLogRequest\x1a\'.api.v1.beta1.DeleteObservationLogReply2\xe1\x01\n\nSuggestion\x12X\n\x0eGetSuggestions\x12#.api.v1.beta1.GetSuggestionsRequest\x1a!.api.v1.beta1.GetSuggestionsReply\x12y\n\x19ValidateAlgorithmSettings\x12..api.v1.beta1.ValidateAlgorithmSettingsRequest\x1a,.api.v1.beta1.ValidateAlgorithmSettingsReply2\xe0\x02\n\rEarlyStopping\x12m\n\x15GetEarlyStoppingRules\x12*.api.v1.beta1.GetEarlyStoppingRulesRequest\x1a(.api.v1.beta1.GetEarlyStoppingRulesReply\x12X\n\x0eSetTrialStatus\x12#.api.v1.beta1.SetTrialStatusRequest\x1a!.api.v1.beta1.SetTrialStatusReply\x12\x85\x01\n\x1dValidateEarlyStoppingSettings\x12\x32.api.v1.beta1.ValidateEarlyStoppingSettingsRequest\x1a\x30.api.v1.beta1.ValidateEarlyStoppingSettingsReplyBAZ?github.com/kubeflow/katib/pkg/apis/manager/v1beta1;api_v1_beta1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tapi.proto\x12\x0c\x61pi.v1.beta1\"R\n\nExperiment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x04spec\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ExperimentSpecR\x04spec\"\x85\x04\n\x0e\x45xperimentSpec\x12T\n\x0fparameter_specs\x18\x01 \x01(\x0b\x32+.api.v1.beta1.ExperimentSpec.ParameterSpecsR\x0eparameterSpecs\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x39\n\talgorithm\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12\x46\n\x0e\x65\x61rly_stopping\x18\x04 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\x12\x30\n\x14parallel_trial_count\x18\x05 \x01(\x05R\x12parallelTrialCount\x12&\n\x0fmax_trial_count\x18\x06 \x01(\x05R\rmaxTrialCount\x12\x36\n\nnas_config\x18\x07 \x01(\x0b\x32\x17.api.v1.beta1.NasConfigR\tnasConfig\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"\xab\x01\n\rParameterSpec\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x42\n\x0eparameter_type\x18\x02 \x01(\x0e\x32\x1b.api.v1.beta1.ParameterTypeR\rparameterType\x12\x42\n\x0e\x66\x65\x61sible_space\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.FeasibleSpaceR\rfeasibleSpace\"\x9b\x01\n\rFeasibleSpace\x12\x10\n\x03max\x18\x01 \x01(\tR\x03max\x12\x10\n\x03min\x18\x02 \x01(\tR\x03min\x12\x12\n\x04list\x18\x03 \x03(\tR\x04list\x12\x12\n\x04step\x18\x04 \x01(\tR\x04step\x12>\n\x0c\x64istribution\x18\x05 \x01(\x0e\x32\x1a.api.v1.beta1.DistributionR\x0c\x64istribution\"\xc0\x01\n\rObjectiveSpec\x12/\n\x04type\x18\x01 \x01(\x0e\x32\x1b.api.v1.beta1.ObjectiveTypeR\x04type\x12\x12\n\x04goal\x18\x02 \x01(\x01R\x04goal\x12\x32\n\x15objective_metric_name\x18\x03 \x01(\tR\x13objectiveMetricName\x12\x36\n\x17\x61\x64\x64itional_metric_names\x18\x04 \x03(\tR\x15\x61\x64\x64itionalMetricNames\"\x85\x01\n\rAlgorithmSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12M\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\x1e.api.v1.beta1.AlgorithmSettingR\x11\x61lgorithmSettings\"<\n\x10\x41lgorithmSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x8d\x01\n\x11\x45\x61rlyStoppingSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12Q\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\".api.v1.beta1.EarlyStoppingSettingR\x11\x61lgorithmSettings\"@\n\x14\x45\x61rlyStoppingSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xd2\x01\n\tNasConfig\x12<\n\x0cgraph_config\x18\x01 \x01(\x0b\x32\x19.api.v1.beta1.GraphConfigR\x0bgraphConfig\x12\x42\n\noperations\x18\x02 \x01(\x0b\x32\".api.v1.beta1.NasConfig.OperationsR\noperations\x1a\x43\n\nOperations\x12\x35\n\toperation\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.OperationR\toperation\"p\n\x0bGraphConfig\x12\x1d\n\nnum_layers\x18\x01 \x01(\x05R\tnumLayers\x12\x1f\n\x0binput_sizes\x18\x02 \x03(\x05R\ninputSizes\x12!\n\x0coutput_sizes\x18\x03 \x03(\x05R\x0boutputSizes\"\xd2\x01\n\tOperation\x12%\n\x0eoperation_type\x18\x01 \x01(\tR\roperationType\x12O\n\x0fparameter_specs\x18\x02 \x01(\x0b\x32&.api.v1.beta1.Operation.ParameterSpecsR\x0eparameterSpecs\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"{\n\x05Trial\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12+\n\x04spec\x18\x02 \x01(\x0b\x32\x17.api.v1.beta1.TrialSpecR\x04spec\x12\x31\n\x06status\x18\x03 \x01(\x0b\x32\x19.api.v1.beta1.TrialStatusR\x06status\"\xfe\x02\n\tTrialSpec\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x61\n\x15parameter_assignments\x18\x03 \x01(\x0b\x32,.api.v1.beta1.TrialSpec.ParameterAssignmentsR\x14parameterAssignments\x12;\n\x06labels\x18\x04 \x03(\x0b\x32#.api.v1.beta1.TrialSpec.LabelsEntryR\x06labels\x1a[\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"?\n\x13ParameterAssignment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xed\x02\n\x0bTrialStatus\x12\x1d\n\nstart_time\x18\x01 \x01(\tR\tstartTime\x12\'\n\x0f\x63ompletion_time\x18\x02 \x01(\tR\x0e\x63ompletionTime\x12J\n\tcondition\x18\x03 \x01(\x0e\x32,.api.v1.beta1.TrialStatus.TrialConditionTypeR\tcondition\x12;\n\x0bobservation\x18\x04 \x01(\x0b\x32\x19.api.v1.beta1.ObservationR\x0bobservation\"\x8c\x01\n\x12TrialConditionType\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06KILLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x16\n\x12METRICSUNAVAILABLE\x10\x05\x12\x10\n\x0c\x45\x41RLYSTOPPED\x10\x06\x12\x0b\n\x07UNKNOWN\x10\x07\"=\n\x0bObservation\x12.\n\x07metrics\x18\x01 \x03(\x0b\x32\x14.api.v1.beta1.MetricR\x07metrics\"2\n\x06Metric\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x83\x01\n\x1bReportObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x45\n\x0fobservation_log\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"\x1b\n\x19ReportObservationLogReply\"J\n\x0eObservationLog\x12\x38\n\x0bmetric_logs\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.MetricLogR\nmetricLogs\"X\n\tMetricLog\x12\x1d\n\ntime_stamp\x18\x01 \x01(\tR\ttimeStamp\x12,\n\x06metric\x18\x02 \x01(\x0b\x32\x14.api.v1.beta1.MetricR\x06metric\"\x94\x01\n\x18GetObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x1f\n\x0bmetric_name\x18\x02 \x01(\tR\nmetricName\x12\x1d\n\nstart_time\x18\x03 \x01(\tR\tstartTime\x12\x19\n\x08\x65nd_time\x18\x04 \x01(\tR\x07\x65ndTime\"_\n\x16GetObservationLogReply\x12\x45\n\x0fobservation_log\x18\x01 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"<\n\x1b\x44\x65leteObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x1b\n\x19\x44\x65leteObservationLogReply\"\xe6\x01\n\x15GetSuggestionsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12\x34\n\x16\x63urrent_request_number\x18\x04 \x01(\x05R\x14\x63urrentRequestNumber\x12\x30\n\x14total_request_number\x18\x05 \x01(\x05R\x12totalRequestNumber\"\xa4\x04\n\x13GetSuggestionsReply\x12k\n\x15parameter_assignments\x18\x01 \x03(\x0b\x32\x36.api.v1.beta1.GetSuggestionsReply.ParameterAssignmentsR\x14parameterAssignments\x12\x39\n\talgorithm\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x03 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\x1a\x91\x02\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x12\x1d\n\ntrial_name\x18\x02 \x01(\tR\ttrialName\x12Z\n\x06labels\x18\x03 \x03(\x0b\x32\x42.api.v1.beta1.GetSuggestionsReply.ParameterAssignments.LabelsEntryR\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\\\n ValidateAlgorithmSettingsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\" \n\x1eValidateAlgorithmSettingsReply\"\xb3\x01\n\x1cGetEarlyStoppingRulesRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12,\n\x12\x64\x62_manager_address\x18\x03 \x01(\tR\x10\x64\x62ManagerAddress\"o\n\x1aGetEarlyStoppingRulesReply\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x01 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\"\x9a\x01\n\x11\x45\x61rlyStoppingRule\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x12<\n\ncomparison\x18\x03 \x01(\x0e\x32\x1c.api.v1.beta1.ComparisonTypeR\ncomparison\x12\x1d\n\nstart_step\x18\x04 \x01(\x05R\tstartStep\"n\n$ValidateEarlyStoppingSettingsRequest\x12\x46\n\x0e\x65\x61rly_stopping\x18\x01 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\"$\n\"ValidateEarlyStoppingSettingsReply\"6\n\x15SetTrialStatusRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x15\n\x13SetTrialStatusReply*U\n\rParameterType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\x07\n\x03INT\x10\x02\x12\x0c\n\x08\x44ISCRETE\x10\x03\x12\x0f\n\x0b\x43\x41TEGORICAL\x10\x04*f\n\x0c\x44istribution\x12\x1c\n\x18\x44ISTRIBUTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07UNIFORM\x10\x01\x12\x0f\n\x0bLOG_UNIFORM\x10\x02\x12\n\n\x06NORMAL\x10\x03\x12\x0e\n\nLOG_NORMAL\x10\x04*8\n\rObjectiveType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08MINIMIZE\x10\x01\x12\x0c\n\x08MAXIMIZE\x10\x02*J\n\x0e\x43omparisonType\x12\x16\n\x12UNKNOWN_COMPARISON\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\x08\n\x04LESS\x10\x02\x12\x0b\n\x07GREATER\x10\x03\x32\xc6\x02\n\tDBManager\x12j\n\x14ReportObservationLog\x12).api.v1.beta1.ReportObservationLogRequest\x1a\'.api.v1.beta1.ReportObservationLogReply\x12\x61\n\x11GetObservationLog\x12&.api.v1.beta1.GetObservationLogRequest\x1a$.api.v1.beta1.GetObservationLogReply\x12j\n\x14\x44\x65leteObservationLog\x12).api.v1.beta1.DeleteObservationLogRequest\x1a\'.api.v1.beta1.DeleteObservationLogReply2\xe1\x01\n\nSuggestion\x12X\n\x0eGetSuggestions\x12#.api.v1.beta1.GetSuggestionsRequest\x1a!.api.v1.beta1.GetSuggestionsReply\x12y\n\x19ValidateAlgorithmSettings\x12..api.v1.beta1.ValidateAlgorithmSettingsRequest\x1a,.api.v1.beta1.ValidateAlgorithmSettingsReply2\xe0\x02\n\rEarlyStopping\x12m\n\x15GetEarlyStoppingRules\x12*.api.v1.beta1.GetEarlyStoppingRulesRequest\x1a(.api.v1.beta1.GetEarlyStoppingRulesReply\x12X\n\x0eSetTrialStatus\x12#.api.v1.beta1.SetTrialStatusRequest\x1a!.api.v1.beta1.SetTrialStatusReply\x12\x85\x01\n\x1dValidateEarlyStoppingSettings\x12\x32.api.v1.beta1.ValidateEarlyStoppingSettingsRequest\x1a\x30.api.v1.beta1.ValidateEarlyStoppingSettingsReplyBAZ?github.com/kubeflow/katib/pkg/apis/manager/v1beta1;api_v1_beta1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -29,11 +29,11 @@ _globals['_PARAMETERTYPE']._serialized_start=5425 _globals['_PARAMETERTYPE']._serialized_end=5510 _globals['_DISTRIBUTION']._serialized_start=5512 - _globals['_DISTRIBUTION']._serialized_end=5610 - _globals['_OBJECTIVETYPE']._serialized_start=5612 - _globals['_OBJECTIVETYPE']._serialized_end=5668 - _globals['_COMPARISONTYPE']._serialized_start=5670 - _globals['_COMPARISONTYPE']._serialized_end=5744 + _globals['_DISTRIBUTION']._serialized_end=5614 + _globals['_OBJECTIVETYPE']._serialized_start=5616 + _globals['_OBJECTIVETYPE']._serialized_end=5672 + _globals['_COMPARISONTYPE']._serialized_start=5674 + _globals['_COMPARISONTYPE']._serialized_end=5748 _globals['_EXPERIMENT']._serialized_start=27 _globals['_EXPERIMENT']._serialized_end=109 _globals['_EXPERIMENTSPEC']._serialized_start=112 @@ -124,10 +124,10 @@ _globals['_SETTRIALSTATUSREQUEST']._serialized_end=5400 _globals['_SETTRIALSTATUSREPLY']._serialized_start=5402 _globals['_SETTRIALSTATUSREPLY']._serialized_end=5423 - _globals['_DBMANAGER']._serialized_start=5747 - _globals['_DBMANAGER']._serialized_end=6073 - _globals['_SUGGESTION']._serialized_start=6076 - _globals['_SUGGESTION']._serialized_end=6301 - _globals['_EARLYSTOPPING']._serialized_start=6304 - _globals['_EARLYSTOPPING']._serialized_end=6656 + _globals['_DBMANAGER']._serialized_start=5751 + _globals['_DBMANAGER']._serialized_end=6077 + _globals['_SUGGESTION']._serialized_start=6080 + _globals['_SUGGESTION']._serialized_end=6305 + _globals['_EARLYSTOPPING']._serialized_start=6308 + _globals['_EARLYSTOPPING']._serialized_end=6660 # @@protoc_insertion_point(module_scope) diff --git a/pkg/apis/manager/v1beta1/python/api_pb2.pyi b/pkg/apis/manager/v1beta1/python/api_pb2.pyi index 21cbb161d77..d5db79e671f 100644 --- a/pkg/apis/manager/v1beta1/python/api_pb2.pyi +++ b/pkg/apis/manager/v1beta1/python/api_pb2.pyi @@ -16,11 +16,11 @@ class ParameterType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): class Distribution(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () + DISTRIBUTION_UNSPECIFIED: _ClassVar[Distribution] UNIFORM: _ClassVar[Distribution] LOG_UNIFORM: _ClassVar[Distribution] NORMAL: _ClassVar[Distribution] LOG_NORMAL: _ClassVar[Distribution] - DISTRIBUTION_UNKNOWN: _ClassVar[Distribution] class ObjectiveType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -39,11 +39,11 @@ DOUBLE: ParameterType INT: ParameterType DISCRETE: ParameterType CATEGORICAL: ParameterType +DISTRIBUTION_UNSPECIFIED: Distribution UNIFORM: Distribution LOG_UNIFORM: Distribution NORMAL: Distribution LOG_NORMAL: Distribution -DISTRIBUTION_UNKNOWN: Distribution UNKNOWN: ObjectiveType MINIMIZE: ObjectiveType MAXIMIZE: ObjectiveType diff --git a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go index b77949ac9e5..6ed521a80eb 100644 --- a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go +++ b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go @@ -532,22 +532,12 @@ func convertParameterType(typ experimentsv1beta1.ParameterType) suggestionapi.Pa } func convertFeasibleSpace(fs experimentsv1beta1.FeasibleSpace) *suggestionapi.FeasibleSpace { - distribution := convertDistribution(fs.Distribution) - if distribution == suggestionapi.Distribution_DISTRIBUTION_UNKNOWN { - return &suggestionapi.FeasibleSpace{ - Max: fs.Max, - Min: fs.Min, - List: fs.List, - Step: fs.Step, - } - } - return &suggestionapi.FeasibleSpace{ Max: fs.Max, Min: fs.Min, List: fs.List, Step: fs.Step, - Distribution: distribution, + Distribution: convertDistribution(fs.Distribution), } } @@ -562,7 +552,7 @@ func convertDistribution(typ experimentsv1beta1.Distribution) suggestionapi.Dist case experimentsv1beta1.DistributionLogNormal: return suggestionapi.Distribution_LOG_NORMAL default: - return suggestionapi.Distribution_DISTRIBUTION_UNKNOWN + return suggestionapi.Distribution_DISTRIBUTION_UNSPECIFIED } } diff --git a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go index c4df08bbfaa..9dc81700a91 100644 --- a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go +++ b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go @@ -618,7 +618,7 @@ func TestConvertDistribution(t *testing.T) { }, { inDistribution: experimentsv1beta1.DistributionUnknown, - expectedDistribution: suggestionapi.Distribution_DISTRIBUTION_UNKNOWN, + expectedDistribution: suggestionapi.Distribution_DISTRIBUTION_UNSPECIFIED, testDescription: "Convert unknown distribution", }, } diff --git a/pkg/suggestion/v1beta1/hyperopt/base_service.py b/pkg/suggestion/v1beta1/hyperopt/base_service.py index c794ae6fb60..f023b274936 100644 --- a/pkg/suggestion/v1beta1/hyperopt/base_service.py +++ b/pkg/suggestion/v1beta1/hyperopt/base_service.py @@ -13,10 +13,12 @@ # limitations under the License. import logging +import math import hyperopt import numpy as np +from pkg.apis.manager.v1beta1.python import api_pb2 from pkg.suggestion.v1beta1.internal.constant import ( CATEGORICAL, DISCRETE, @@ -62,14 +64,87 @@ def create_hyperopt_domain(self): # hyperopt.hp.uniform('x2', -10, 10)} hyperopt_search_space = {} for param in self.search_space.params: - if param.type == INTEGER: - hyperopt_search_space[param.name] = hyperopt.hp.quniform( - param.name, float(param.min), float(param.max), float(param.step) - ) - elif param.type == DOUBLE: - hyperopt_search_space[param.name] = hyperopt.hp.uniform( - param.name, float(param.min), float(param.max) - ) + if param.type in [INTEGER, DOUBLE]: + if param.distribution == api_pb2.UNIFORM or param.distribution is None: + # Uniform distribution: values are sampled between min and max. + # If step is defined, we use the quantized version quniform. + if param.step: + hyperopt_search_space[param.name] = hyperopt.hp.quniform( + param.name, + float(param.min), + float(param.max), + float(param.step), + ) + elif param.type == INTEGER: + hyperopt_search_space[param.name] = hyperopt.hp.uniformint( + param.name, float(param.min), float(param.max) + ) + else: + hyperopt_search_space[param.name] = hyperopt.hp.uniform( + param.name, float(param.min), float(param.max) + ) + elif param.distribution == api_pb2.LOG_UNIFORM: + # Log-uniform distribution: used for parameters that vary exponentially. + # We convert min and max to their logarithmic scale using math.log, because + # the log-uniform distribution is applied over the logarithmic range. + if param.step: + hyperopt_search_space[param.name] = hyperopt.hp.qloguniform( + param.name, + math.log(float(param.min)), + math.log(float(param.max)), + float(param.step), + ) + else: + hyperopt_search_space[param.name] = hyperopt.hp.loguniform( + param.name, + math.log(float(param.min)), + math.log(float(param.max)), + ) + elif param.distribution == api_pb2.NORMAL: + # Normal distribution: used when values are centered around the mean (mu) + # and spread out by sigma. We calculate mu as the midpoint between + # min and max, and sigma as (max - min) / 6. This is based on the assumption + # that 99.7% of the values in a normal distribution fall within ±3 sigma. + mu = (float(param.min) + float(param.max)) / 2 + sigma = (float(param.max) - float(param.min)) / 6 + + if param.step: + hyperopt_search_space[param.name] = hyperopt.hp.qnormal( + param.name, + mu, + sigma, + float(param.step), + ) + else: + hyperopt_search_space[param.name] = hyperopt.hp.normal( + param.name, + mu, + sigma, + ) + elif param.distribution == api_pb2.LOG_NORMAL: + # Log-normal distribution: applies when the logarithm + # of the parameter follows a normal distribution. + # We convert min and max to logarithmic scale and calculate + # mu and sigma similarly to the normal distribution, + # but on the log-transformed values to ensure the distribution is correct. + log_min = math.log(float(param.min)) + log_max = math.log(float(param.max)) + mu = (log_min + log_max) / 2 + sigma = (log_max - log_min) / 6 + + if param.step: + hyperopt_search_space[param.name] = hyperopt.hp.qlognormal( + param.name, + mu, + sigma, + float(param.step), + ) + else: + hyperopt_search_space[param.name] = hyperopt.hp.lognormal( + param.name, + mu, + sigma, + ) elif param.type == CATEGORICAL or param.type == DISCRETE: hyperopt_search_space[param.name] = hyperopt.hp.choice( param.name, param.list diff --git a/pkg/suggestion/v1beta1/internal/constant.py b/pkg/suggestion/v1beta1/internal/constant.py index 98ee752d392..906a6ab4757 100644 --- a/pkg/suggestion/v1beta1/internal/constant.py +++ b/pkg/suggestion/v1beta1/internal/constant.py @@ -19,3 +19,8 @@ DOUBLE = "DOUBLE" CATEGORICAL = "CATEGORICAL" DISCRETE = "DISCRETE" + +UNIFORM = "UNIFORM" +LOG_UNIFORM = "LOG_UNIFORM" +NORMAL = "NORMAL" +LOG_NORMAL = "LOG_NORMAL" diff --git a/pkg/suggestion/v1beta1/internal/search_space.py b/pkg/suggestion/v1beta1/internal/search_space.py index 7e920d7c363..2a11ba2cb22 100644 --- a/pkg/suggestion/v1beta1/internal/search_space.py +++ b/pkg/suggestion/v1beta1/internal/search_space.py @@ -82,25 +82,36 @@ def __str__(self): @staticmethod def convert_parameter(p): + distribution = ( + p.feasible_space.distribution + if p.feasible_space.distribution != "" + and p.feasible_space.distribution is not None + and p.feasible_space.distribution != api.DISTRIBUTION_UNSPECIFIED + else None + ) + if p.parameter_type == api.INT: # Default value for INT parameter step is 1 - step = 1 - if p.feasible_space.step is not None and p.feasible_space.step != "": - step = p.feasible_space.step + step = p.feasible_space.step if p.feasible_space.step else 1 return HyperParameter.int( - p.name, p.feasible_space.min, p.feasible_space.max, step + p.name, p.feasible_space.min, p.feasible_space.max, step, distribution ) + elif p.parameter_type == api.DOUBLE: return HyperParameter.double( p.name, p.feasible_space.min, p.feasible_space.max, p.feasible_space.step, + distribution, ) + elif p.parameter_type == api.CATEGORICAL: return HyperParameter.categorical(p.name, p.feasible_space.list) + elif p.parameter_type == api.DISCRETE: return HyperParameter.discrete(p.name, p.feasible_space.list) + else: logger.error( "Cannot get the type for the parameter: %s (%s)", @@ -110,20 +121,20 @@ def convert_parameter(p): class HyperParameter(object): - def __init__(self, name, type_, min_, max_, list_, step): + def __init__(self, name, type_, min_, max_, list_, step, distribution=None): self.name = name self.type = type_ self.min = min_ self.max = max_ self.list = list_ self.step = step + self.distribution = distribution def __str__(self): - if self.type == constant.INTEGER or self.type == constant.DOUBLE: + if self.type in [constant.INTEGER, constant.DOUBLE]: return ( - "HyperParameter(name: {}, type: {}, min: {}, max: {}, step: {})".format( - self.name, self.type, self.min, self.max, self.step - ) + f"HyperParameter(name: {self.name}, type: {self.type}, min: {self.min}, " + f"max: {self.max}, step: {self.step}, distribution: {self.distribution})" ) else: return "HyperParameter(name: {}, type: {}, list: {})".format( @@ -131,12 +142,14 @@ def __str__(self): ) @staticmethod - def int(name, min_, max_, step): - return HyperParameter(name, constant.INTEGER, min_, max_, [], step) + def int(name, min_, max_, step, distribution=None): + return HyperParameter( + name, constant.INTEGER, min_, max_, [], step, distribution + ) @staticmethod - def double(name, min_, max_, step): - return HyperParameter(name, constant.DOUBLE, min_, max_, [], step) + def double(name, min_, max_, step, distribution=None): + return HyperParameter(name, constant.DOUBLE, min_, max_, [], step, distribution) @staticmethod def categorical(name, lst): diff --git a/pkg/webhook/v1beta1/experiment/validator/validator.go b/pkg/webhook/v1beta1/experiment/validator/validator.go index 9f0f1c3ff5b..4de47f67aed 100644 --- a/pkg/webhook/v1beta1/experiment/validator/validator.go +++ b/pkg/webhook/v1beta1/experiment/validator/validator.go @@ -284,7 +284,7 @@ func (g *DefaultValidator) validateParameters(parameters []experimentsv1beta1.Pa allErrs = append(allErrs, field.Invalid(parametersPath.Index(i).Child("feasibleSpace").Child("list"), param.FeasibleSpace.List, fmt.Sprintf("feasibleSpace.list is not supported for parameterType: %v", param.ParameterType))) } - if param.FeasibleSpace.Max == "" && param.FeasibleSpace.Min == "" { + if param.FeasibleSpace.Max == "" || param.FeasibleSpace.Min == "" { allErrs = append(allErrs, field.Required(parametersPath.Index(i).Child("feasibleSpace").Child("max"), fmt.Sprintf("feasibleSpace.max or feasibleSpace.min must be specified for parameterType: %v", param.ParameterType))) } diff --git a/test/unit/v1beta1/suggestion/test_hyperopt_service.py b/test/unit/v1beta1/suggestion/test_hyperopt_service.py index 30486efa5d4..23ee6e3ab85 100644 --- a/test/unit/v1beta1/suggestion/test_hyperopt_service.py +++ b/test/unit/v1beta1/suggestion/test_hyperopt_service.py @@ -20,6 +20,7 @@ from pkg.apis.manager.v1beta1.python import api_pb2 from pkg.suggestion.v1beta1.hyperopt.service import HyperoptService +from pkg.suggestion.v1beta1.internal.constant import LOG_UNIFORM class TestHyperopt(unittest.TestCase): @@ -176,6 +177,114 @@ def test_get_suggestion(self): parameter_type=api_pb2.DOUBLE, feasible_space=api_pb2.FeasibleSpace( max="5", min="1", list=[]) + ), + api_pb2.ParameterSpec( + name="param-5", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="5", min="1", list=[], step="0.5", distribution=api_pb2.LOG_UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-6", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="5", min="1", list=[], distribution=api_pb2.LOG_UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-7", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], step="0.8", distribution=api_pb2.UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-8", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], distribution=api_pb2.UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-9", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], step="0.8", distribution=api_pb2.NORMAL) + ), + api_pb2.ParameterSpec( + name="param-10", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], distribution=api_pb2.NORMAL) + ), + api_pb2.ParameterSpec( + name="param-11", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], step="0.8", distribution=api_pb2.LOG_NORMAL) + ), + api_pb2.ParameterSpec( + name="param-12", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], distribution=api_pb2.LOG_NORMAL) + ), + api_pb2.ParameterSpec( + name="param-13", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="5", min="1", list=[], distribution=api_pb2.UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-14", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="5", min="1", list=[], step="0.8", distribution=api_pb2.UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-15", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], distribution=api_pb2.LOG_UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-16", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="10", min="5", list=[], step="0.01", distribution=api_pb2.LOG_UNIFORM) + ), + api_pb2.ParameterSpec( + name="param-17", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="100", min="5", list=[], distribution=api_pb2.NORMAL) + ), + api_pb2.ParameterSpec( + name="param-18", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="100", min="5", list=[], step="0.01", distribution=api_pb2.NORMAL) + ), + api_pb2.ParameterSpec( + name="param-19", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="64", min="32", distribution=api_pb2.LOG_NORMAL) + ), + api_pb2.ParameterSpec( + name="param-20", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="64", min="32", step="0.01", distribution=api_pb2.LOG_NORMAL) + ), + api_pb2.ParameterSpec( + name="param-21", + parameter_type=api_pb2.DOUBLE, + feasible_space=api_pb2.FeasibleSpace( + max="64", min="32", step="0.01") + ), + api_pb2.ParameterSpec( + name="param-22", + parameter_type=api_pb2.INT, + feasible_space=api_pb2.FeasibleSpace( + max="64", min="32", step="0.01") ) ] )