Validate positive range for log-scale distribution parameters#2679
Validate positive range for log-scale distribution parameters#2679saivedant169 wants to merge 1 commit into
Conversation
A parameter with a logUniform or logNormal distribution and a non-positive min or max is currently admitted by the webhook and then crashes the suggestion service at math.log (hyperopt create_hyperopt_domain and skopt's hardcoded log-uniform prior) with a math domain error. validateParameters now rejects logUniform and logNormal parameters whose min or max parses to a value <= 0, so the experiment is refused at admission with a clear field error instead of crashing the suggestion pod. Signed-off-by: Saivedant Hava <saivedant169@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@saivedant169: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@andreyvelich this one has been open about a week without a look. The red checks are the flaky ones (the trial-controller |
What this PR does / why we need it
Fixes #2678.
A parameter with a
logUniformorlogNormaldistribution and a non-positiveminormaxis currently admitted by the webhook and then crashes the suggestion service atmath.log(hyperoptcreate_hyperopt_domain, and skopt's hardcoded log-uniform prior) withValueError: math domain error.validateParametersnow rejectslogUniform/logNormalparameters whoseminormaxparses to a value<= 0, with a clear field error, so the experiment is refused at admission instead of crashing the suggestion pod. This matches how the validator already rejects other invalidfeasibleSpacevalues, and follows the same fail-at-admission approach as #2666.The check only fires when the value parses as a float and is
<= 0, so non-numeric min/max are left to the existing handling.Test
Added a
TestValidateParameterscase (non-positive min forlogUniform)./kind bug