polyaxon 2.1.0rc9__py3-none-any.whl → 2.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- polyaxon/_auxiliaries/default_scheduling.py +17 -7
- polyaxon/_auxiliaries/init.py +14 -6
- polyaxon/_auxiliaries/sidecar.py +10 -8
- polyaxon/_cli/artifacts.py +96 -11
- polyaxon/_cli/components.py +96 -11
- polyaxon/_cli/config.py +31 -0
- polyaxon/_cli/dashboard.py +12 -2
- polyaxon/_cli/init.py +1 -1
- polyaxon/_cli/models.py +96 -11
- polyaxon/_cli/operations.py +133 -58
- polyaxon/_cli/project_versions.py +139 -6
- polyaxon/_cli/projects.py +23 -9
- polyaxon/_cli/run.py +43 -9
- polyaxon/_cli/services/agent.py +2 -2
- polyaxon/_cli/version.py +4 -1
- polyaxon/_client/mixin.py +39 -0
- polyaxon/_client/project.py +218 -23
- polyaxon/_client/run.py +84 -27
- polyaxon/_compiler/contexts/contexts.py +4 -0
- polyaxon/_compiler/contexts/ray_job.py +4 -2
- polyaxon/_compiler/resolver/agent.py +22 -10
- polyaxon/_compiler/resolver/runtime.py +7 -3
- polyaxon/_constants/metadata.py +1 -0
- polyaxon/_contexts/keys.py +1 -0
- polyaxon/_contexts/paths.py +1 -1
- polyaxon/_deploy/operators/compose.py +1 -27
- polyaxon/_deploy/schemas/auth.py +3 -3
- polyaxon/_deploy/schemas/celery.py +10 -8
- polyaxon/_deploy/schemas/deployment.py +148 -115
- polyaxon/_deploy/schemas/email.py +8 -8
- polyaxon/_deploy/schemas/ingress.py +7 -7
- polyaxon/_deploy/schemas/intervals.py +2 -7
- polyaxon/_deploy/schemas/operators.py +8 -8
- polyaxon/_deploy/schemas/proxy.py +9 -8
- polyaxon/_deploy/schemas/rbac.py +1 -1
- polyaxon/_deploy/schemas/root_user.py +5 -5
- polyaxon/_deploy/schemas/security_context.py +25 -15
- polyaxon/_deploy/schemas/service.py +75 -66
- polyaxon/_deploy/schemas/ssl.py +3 -3
- polyaxon/_deploy/schemas/ui.py +10 -6
- polyaxon/_docker/builder/builder.py +4 -1
- polyaxon/_docker/converter/base/containers.py +4 -7
- polyaxon/_docker/converter/base/env_vars.py +5 -5
- polyaxon/_docker/converter/base/mounts.py +2 -2
- polyaxon/_docker/docker_types.py +57 -30
- polyaxon/_env_vars/getters/owner_entity.py +4 -2
- polyaxon/_env_vars/getters/project.py +4 -2
- polyaxon/_env_vars/getters/run.py +5 -2
- polyaxon/_env_vars/keys.py +3 -0
- polyaxon/_flow/__init__.py +3 -2
- polyaxon/_flow/builds/__init__.py +8 -8
- polyaxon/_flow/cache/__init__.py +4 -4
- polyaxon/_flow/component/base.py +25 -18
- polyaxon/_flow/component/component.py +4 -3
- polyaxon/_flow/early_stopping/__init__.py +1 -1
- polyaxon/_flow/early_stopping/policies.py +12 -10
- polyaxon/_flow/environment/__init__.py +43 -25
- polyaxon/_flow/events/__init__.py +1 -1
- polyaxon/_flow/hooks/__init__.py +11 -11
- polyaxon/_flow/init/__init__.py +41 -25
- polyaxon/_flow/io/io.py +57 -47
- polyaxon/_flow/joins/__init__.py +5 -5
- polyaxon/_flow/matrix/bayes.py +23 -17
- polyaxon/_flow/matrix/grid_search.py +16 -7
- polyaxon/_flow/matrix/hyperband.py +10 -10
- polyaxon/_flow/matrix/hyperopt.py +14 -9
- polyaxon/_flow/matrix/iterative.py +14 -8
- polyaxon/_flow/matrix/mapping.py +4 -4
- polyaxon/_flow/matrix/params.py +138 -77
- polyaxon/_flow/matrix/random_search.py +10 -5
- polyaxon/_flow/matrix/tuner.py +4 -4
- polyaxon/_flow/mounts/artifacts_mounts.py +1 -1
- polyaxon/_flow/notifications/__init__.py +1 -1
- polyaxon/_flow/operations/base.py +10 -8
- polyaxon/_flow/operations/compiled_operation.py +5 -4
- polyaxon/_flow/operations/operation.py +57 -41
- polyaxon/_flow/optimization/__init__.py +2 -2
- polyaxon/_flow/params/params.py +10 -9
- polyaxon/_flow/plugins/__init__.py +19 -13
- polyaxon/_flow/run/dag.py +12 -9
- polyaxon/_flow/run/dask/dask.py +4 -4
- polyaxon/_flow/run/dask/replica.py +17 -11
- polyaxon/_flow/run/job.py +17 -11
- polyaxon/_flow/run/kubeflow/mpi_job.py +10 -5
- polyaxon/_flow/run/kubeflow/mx_job.py +25 -9
- polyaxon/_flow/run/kubeflow/paddle_job.py +16 -9
- polyaxon/_flow/run/kubeflow/pytorch_job.py +24 -17
- polyaxon/_flow/run/kubeflow/replica.py +17 -11
- polyaxon/_flow/run/kubeflow/scheduling_policy.py +7 -5
- polyaxon/_flow/run/kubeflow/tf_job.py +15 -8
- polyaxon/_flow/run/kubeflow/xgboost_job.py +9 -4
- polyaxon/_flow/run/ray/ray.py +9 -6
- polyaxon/_flow/run/ray/replica.py +25 -16
- polyaxon/_flow/run/resources.py +14 -13
- polyaxon/_flow/run/service.py +4 -4
- polyaxon/_flow/schedules/cron.py +4 -4
- polyaxon/_flow/schedules/interval.py +4 -4
- polyaxon/_flow/templates/__init__.py +3 -3
- polyaxon/_flow/termination/__init__.py +3 -3
- polyaxon/_fs/async_manager.py +1 -1
- polyaxon/_fs/fs.py +1 -1
- polyaxon/_fs/watcher.py +26 -27
- polyaxon/_k8s/converter/base/base.py +2 -1
- polyaxon/_k8s/converter/base/main.py +1 -0
- polyaxon/_k8s/converter/common/accelerators.py +7 -4
- polyaxon/_k8s/converter/converters/ray_job.py +4 -2
- polyaxon/_k8s/custom_resources/dask_job.py +3 -0
- polyaxon/_k8s/custom_resources/kubeflow/common.py +4 -1
- polyaxon/_k8s/custom_resources/ray_job.py +3 -0
- polyaxon/_k8s/custom_resources/setter.py +1 -1
- polyaxon/_k8s/executor/async_executor.py +2 -0
- polyaxon/_k8s/k8s_validation.py +1 -1
- polyaxon/_k8s/logging/async_monitor.py +82 -11
- polyaxon/_k8s/manager/async_manager.py +15 -0
- polyaxon/_k8s/manager/manager.py +16 -1
- polyaxon/_local_process/__init__.py +0 -0
- polyaxon/_local_process/agent.py +6 -0
- polyaxon/_local_process/converter/__init__.py +1 -0
- polyaxon/_local_process/converter/base/__init__.py +1 -0
- polyaxon/_local_process/converter/base/base.py +140 -0
- polyaxon/_local_process/converter/base/containers.py +66 -0
- polyaxon/_local_process/converter/base/env_vars.py +253 -0
- polyaxon/_local_process/converter/base/init.py +414 -0
- polyaxon/_local_process/converter/base/main.py +74 -0
- polyaxon/_local_process/converter/base/mounts.py +82 -0
- polyaxon/_local_process/converter/converters/__init__.py +8 -0
- polyaxon/_local_process/converter/converters/job.py +40 -0
- polyaxon/_local_process/converter/converters/service.py +41 -0
- polyaxon/_local_process/converter/mixins.py +38 -0
- polyaxon/_local_process/executor.py +132 -0
- polyaxon/_local_process/process_types.py +42 -0
- polyaxon/_polyaxonfile/specs/compiled_operation.py +1 -1
- polyaxon/_polyaxonfile/specs/libs/parser.py +1 -1
- polyaxon/_polyaxonfile/specs/libs/validator.py +1 -1
- polyaxon/_polyaxonfile/specs/operation.py +1 -1
- polyaxon/_polyaxonfile/specs/sections.py +8 -0
- polyaxon/_pql/manager.py +1 -1
- polyaxon/_runner/agent/async_agent.py +25 -11
- polyaxon/_runner/agent/base_agent.py +19 -10
- polyaxon/_runner/agent/sync_agent.py +24 -10
- polyaxon/_runner/converter/converter.py +12 -4
- polyaxon/_runner/executor.py +1 -1
- polyaxon/_schemas/agent.py +69 -37
- polyaxon/_schemas/authentication.py +4 -4
- polyaxon/_schemas/base.py +26 -2
- polyaxon/_schemas/checks.py +3 -3
- polyaxon/_schemas/cli.py +4 -6
- polyaxon/_schemas/client.py +20 -18
- polyaxon/_schemas/compatibility.py +4 -4
- polyaxon/_schemas/container_resources.py +1 -1
- polyaxon/_schemas/home.py +3 -3
- polyaxon/_schemas/installation.py +13 -9
- polyaxon/_schemas/lifecycle.py +23 -23
- polyaxon/_schemas/log_handler.py +2 -2
- polyaxon/_schemas/services.py +26 -14
- polyaxon/_schemas/types/artifacts.py +3 -3
- polyaxon/_schemas/types/dockerfile.py +14 -12
- polyaxon/_schemas/types/event.py +2 -2
- polyaxon/_schemas/types/file.py +3 -3
- polyaxon/_schemas/types/git.py +12 -4
- polyaxon/_schemas/types/tensorboard.py +14 -8
- polyaxon/_schemas/user.py +3 -3
- polyaxon/_schemas/version.py +2 -2
- polyaxon/_sdk/api/agents_v1_api.py +222 -43
- polyaxon/_sdk/api/artifacts_stores_v1_api.py +3 -3
- polyaxon/_sdk/api/auth_v1_api.py +13 -13
- polyaxon/_sdk/api/connections_v1_api.py +15 -15
- polyaxon/_sdk/api/dashboards_v1_api.py +15 -15
- polyaxon/_sdk/api/organizations_v1_api.py +85 -85
- polyaxon/_sdk/api/presets_v1_api.py +15 -15
- polyaxon/_sdk/api/project_dashboards_v1_api.py +29 -29
- polyaxon/_sdk/api/project_searches_v1_api.py +29 -29
- polyaxon/_sdk/api/projects_v1_api.py +284 -107
- polyaxon/_sdk/api/queues_v1_api.py +19 -19
- polyaxon/_sdk/api/runs_v1_api.py +313 -359
- polyaxon/_sdk/api/searches_v1_api.py +15 -15
- polyaxon/_sdk/api/service_accounts_v1_api.py +31 -31
- polyaxon/_sdk/api/tags_v1_api.py +17 -17
- polyaxon/_sdk/api/teams_v1_api.py +2854 -402
- polyaxon/_sdk/api/users_v1_api.py +254 -78
- polyaxon/_sdk/api/versions_v1_api.py +7 -7
- polyaxon/_sdk/async_client/api_client.py +4 -0
- polyaxon/_sdk/schemas/__init__.py +1 -1
- polyaxon/_sdk/schemas/v1_activity.py +8 -8
- polyaxon/_sdk/schemas/v1_agent.py +18 -16
- polyaxon/_sdk/schemas/v1_agent_state_response.py +4 -4
- polyaxon/_sdk/schemas/v1_agent_state_response_agent_state.py +10 -10
- polyaxon/_sdk/schemas/v1_agent_status_body_request.py +3 -3
- polyaxon/_sdk/schemas/v1_analytics_spec.py +4 -4
- polyaxon/_sdk/schemas/v1_artifact_tree.py +3 -3
- polyaxon/_sdk/schemas/v1_auth.py +1 -1
- polyaxon/_sdk/schemas/v1_cloning.py +3 -3
- polyaxon/_sdk/schemas/v1_connection_response.py +9 -9
- polyaxon/_sdk/schemas/v1_dashboard.py +9 -9
- polyaxon/_sdk/schemas/v1_dashboard_spec.py +5 -1
- polyaxon/_sdk/schemas/v1_entities_tags.py +2 -2
- polyaxon/_sdk/schemas/v1_entities_transfer.py +2 -2
- polyaxon/_sdk/schemas/v1_entity_notification_body.py +7 -7
- polyaxon/_sdk/schemas/v1_entity_stage_body_request.py +5 -5
- polyaxon/_sdk/schemas/v1_entity_status_body_request.py +5 -5
- polyaxon/_sdk/schemas/v1_events_response.py +2 -2
- polyaxon/_sdk/schemas/v1_list_activities_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_agents_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_bookmarks_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_connections_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_dashboards_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_organization_members_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_organizations_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_presets_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_project_versions_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_projects_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_queues_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_run_artifacts_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_run_connections_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_run_edges_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_runs_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_searches_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_service_accounts_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_tags_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_team_members_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_teams_response.py +4 -4
- polyaxon/_sdk/schemas/v1_list_token_response.py +4 -4
- polyaxon/_sdk/schemas/v1_operation_body.py +8 -8
- polyaxon/_sdk/schemas/v1_organization.py +16 -16
- polyaxon/_sdk/schemas/v1_organization_member.py +6 -6
- polyaxon/_sdk/schemas/v1_password_change.py +3 -3
- polyaxon/_sdk/schemas/v1_pipeline.py +3 -3
- polyaxon/_sdk/schemas/v1_preset.py +16 -9
- polyaxon/_sdk/schemas/v1_project.py +17 -17
- polyaxon/_sdk/schemas/v1_project_settings.py +12 -10
- polyaxon/_sdk/schemas/v1_project_version.py +20 -20
- polyaxon/_sdk/schemas/v1_queue.py +12 -12
- polyaxon/_sdk/schemas/v1_run.py +38 -38
- polyaxon/_sdk/schemas/v1_run_connection.py +3 -3
- polyaxon/_sdk/schemas/v1_run_edge.py +5 -5
- polyaxon/_sdk/schemas/v1_run_edge_lineage.py +3 -3
- polyaxon/_sdk/schemas/v1_run_edges_graph.py +1 -1
- polyaxon/_sdk/schemas/v1_run_reference_catalog.py +4 -4
- polyaxon/_sdk/schemas/v1_run_settings.py +9 -9
- polyaxon/_sdk/schemas/v1_search.py +10 -10
- polyaxon/_sdk/schemas/v1_search_spec.py +14 -14
- polyaxon/_sdk/schemas/v1_section_spec.py +12 -7
- polyaxon/_sdk/schemas/v1_service_account.py +9 -9
- polyaxon/_sdk/schemas/v1_settings_catalog.py +4 -3
- polyaxon/_sdk/schemas/v1_tag.py +6 -6
- polyaxon/_sdk/schemas/v1_team.py +11 -8
- polyaxon/_sdk/schemas/v1_team_member.py +6 -6
- polyaxon/_sdk/schemas/v1_team_settings.py +2 -2
- polyaxon/_sdk/schemas/v1_token.py +10 -10
- polyaxon/_sdk/schemas/v1_trial_start.py +6 -6
- polyaxon/_sdk/schemas/v1_user.py +6 -7
- polyaxon/_sdk/schemas/v1_user_access.py +17 -0
- polyaxon/_sdk/schemas/v1_user_email.py +1 -1
- polyaxon/_sdk/schemas/v1_user_singup.py +5 -5
- polyaxon/_sdk/schemas/v1_uuids.py +1 -1
- polyaxon/_sidecar/container/__init__.py +39 -20
- polyaxon/_sidecar/container/monitors/logs.py +10 -13
- polyaxon/_sidecar/ignore.py +0 -1
- polyaxon/_utils/cli_constants.py +2 -0
- polyaxon/_utils/fqn_utils.py +25 -2
- polyaxon/_utils/test_utils.py +2 -1
- polyaxon/pkg.py +1 -1
- polyaxon/schemas.py +1 -1
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/METADATA +43 -43
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/RECORD +269 -252
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/WHEEL +1 -1
- polyaxon/_sdk/schemas/v1_project_user_access.py +0 -10
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/LICENSE +0 -0
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/entry_points.txt +0 -0
- {polyaxon-2.1.0rc9.dist-info → polyaxon-2.6.0.dist-info}/top_level.txt +0 -0
polyaxon/_flow/matrix/bayes.py
CHANGED
@@ -5,8 +5,10 @@ from clipped.compact.pydantic import (
|
|
5
5
|
Field,
|
6
6
|
PositiveInt,
|
7
7
|
StrictInt,
|
8
|
-
|
9
|
-
|
8
|
+
field_validator,
|
9
|
+
model_validator,
|
10
|
+
validation_after,
|
11
|
+
validation_always,
|
10
12
|
)
|
11
13
|
from clipped.config.schema import skip_partial
|
12
14
|
from clipped.types.ref_or_obj import RefField
|
@@ -60,19 +62,21 @@ class UtilityFunctionConfig(BaseSchemaModel): # TODO: Rename to V1UtilityFuncti
|
|
60
62
|
acquisition_function: Optional[AcquisitionFunctions] = Field(
|
61
63
|
default=AcquisitionFunctions.UCB, alias="acquisitionFunction"
|
62
64
|
)
|
63
|
-
gaussian_process: Optional[GaussianProcessConfig] = Field(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
gaussian_process: Optional[GaussianProcessConfig] = Field(
|
66
|
+
alias="gaussianProcess", default=None
|
67
|
+
)
|
68
|
+
kappa: Optional[float] = None
|
69
|
+
eps: Optional[float] = None
|
70
|
+
num_warmup: Optional[int] = Field(alias="numWarmup", default=None)
|
71
|
+
num_iterations: Optional[int] = Field(alias="numIterations", default=None)
|
68
72
|
|
69
|
-
@
|
73
|
+
@model_validator(**validation_after)
|
70
74
|
@skip_partial
|
71
75
|
def validate_utility_function(cls, values):
|
72
76
|
validate_utility_function(
|
73
|
-
acquisition_function=
|
74
|
-
kappa=
|
75
|
-
eps=
|
77
|
+
acquisition_function=cls.get_value_for_key("acquisition_function", values),
|
78
|
+
kappa=cls.get_value_for_key("kappa", values),
|
79
|
+
eps=cls.get_value_for_key("eps", values),
|
76
80
|
)
|
77
81
|
return values
|
78
82
|
|
@@ -393,16 +397,18 @@ class V1Bayes(BaseSearchConfig):
|
|
393
397
|
_IDENTIFIER = V1MatrixKind.BAYES
|
394
398
|
|
395
399
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
396
|
-
utility_function: Optional[UtilityFunctionConfig] = Field(
|
400
|
+
utility_function: Optional[UtilityFunctionConfig] = Field(
|
401
|
+
alias="utilityFunction", default=None
|
402
|
+
)
|
397
403
|
num_initial_runs: Union[PositiveInt, RefField] = Field(alias="numInitialRuns")
|
398
404
|
max_iterations: Union[PositiveInt, RefField] = Field(alias="maxIterations")
|
399
405
|
metric: V1OptimizationMetric
|
400
406
|
params: Union[Dict[str, V1HpParam], RefField]
|
401
|
-
seed: Optional[Union[StrictInt, RefField]]
|
402
|
-
concurrency: Optional[Union[PositiveInt, RefField]]
|
403
|
-
tuner: Optional[Union[V1Tuner, RefField]]
|
407
|
+
seed: Optional[Union[StrictInt, RefField]] = None
|
408
|
+
concurrency: Optional[Union[PositiveInt, RefField]] = None
|
409
|
+
tuner: Optional[Union[V1Tuner, RefField]] = None
|
404
410
|
early_stopping: Optional[Union[List[V1EarlyStopping], RefField]] = Field(
|
405
|
-
alias="earlyStopping"
|
411
|
+
alias="earlyStopping", default=None
|
406
412
|
)
|
407
413
|
|
408
414
|
def create_iteration(self, iteration: Optional[int] = None) -> int:
|
@@ -414,7 +420,7 @@ class V1Bayes(BaseSearchConfig):
|
|
414
420
|
"""Return a boolean to indicate if we need to reschedule another iteration."""
|
415
421
|
return iteration < self.max_iterations
|
416
422
|
|
417
|
-
@
|
423
|
+
@field_validator("params", **validation_always)
|
418
424
|
@skip_partial
|
419
425
|
def validate_matrix(cls, params):
|
420
426
|
return validate_matrix(params)
|
@@ -1,7 +1,13 @@
|
|
1
1
|
from typing import Dict, List, Optional, Union
|
2
2
|
from typing_extensions import Literal
|
3
3
|
|
4
|
-
from clipped.compact.pydantic import
|
4
|
+
from clipped.compact.pydantic import (
|
5
|
+
Field,
|
6
|
+
PositiveInt,
|
7
|
+
field_validator,
|
8
|
+
validation_always,
|
9
|
+
validation_before,
|
10
|
+
)
|
5
11
|
from clipped.config.schema import skip_partial
|
6
12
|
from clipped.types.ref_or_obj import RefField
|
7
13
|
|
@@ -196,19 +202,22 @@ class V1GridSearch(BaseSearchConfig):
|
|
196
202
|
|
197
203
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
198
204
|
params: Union[Dict[str, V1HpParam], RefField]
|
199
|
-
num_runs: Optional[Union[PositiveInt, RefField]] = Field(
|
200
|
-
|
205
|
+
num_runs: Optional[Union[PositiveInt, RefField]] = Field(
|
206
|
+
alias="numRuns", default=None
|
207
|
+
)
|
208
|
+
concurrency: Optional[Union[PositiveInt, RefField]] = None
|
201
209
|
early_stopping: Optional[Union[List[V1EarlyStopping], RefField]] = Field(
|
202
|
-
alias="earlyStopping"
|
210
|
+
alias="earlyStopping", default=None
|
203
211
|
)
|
204
212
|
|
205
|
-
@
|
213
|
+
@field_validator("num_runs", "concurrency", **validation_before)
|
206
214
|
def check_values(cls, v, field):
|
215
|
+
key = cls.get_field_name(field)
|
207
216
|
if v and v < 1:
|
208
|
-
raise ValueError(f"{
|
217
|
+
raise ValueError(f"{key} must be greater than 1, received `{v}` instead.")
|
209
218
|
return v
|
210
219
|
|
211
|
-
@
|
220
|
+
@field_validator("params", **validation_always)
|
212
221
|
@skip_partial
|
213
222
|
def validate_matrix(cls, params):
|
214
223
|
return validate_matrix(params)
|
@@ -313,17 +313,17 @@ class V1Hyperband(BaseSearchConfig):
|
|
313
313
|
_IDENTIFIER = V1MatrixKind.HYPERBAND
|
314
314
|
|
315
315
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
316
|
-
params: Optional[Union[Dict[str, V1HpParam], RefField]]
|
317
|
-
max_iterations: Optional[PositiveInt] = Field(alias="maxIterations")
|
318
|
-
eta: Optional[Union[NonNegativeFloat, RefField]]
|
319
|
-
resource: Optional[V1OptimizationResource]
|
320
|
-
metric: Optional[V1OptimizationMetric]
|
321
|
-
resume: Optional[BoolOrRef]
|
322
|
-
seed: Optional[IntOrRef]
|
323
|
-
concurrency: Optional[Union[PositiveInt, RefField]]
|
324
|
-
tuner: Optional[V1Tuner]
|
316
|
+
params: Optional[Union[Dict[str, V1HpParam], RefField]] = None
|
317
|
+
max_iterations: Optional[PositiveInt] = Field(alias="maxIterations", default=None)
|
318
|
+
eta: Optional[Union[NonNegativeFloat, RefField]] = None
|
319
|
+
resource: Optional[V1OptimizationResource] = None
|
320
|
+
metric: Optional[V1OptimizationMetric] = None
|
321
|
+
resume: Optional[BoolOrRef] = None
|
322
|
+
seed: Optional[IntOrRef] = None
|
323
|
+
concurrency: Optional[Union[PositiveInt, RefField]] = None
|
324
|
+
tuner: Optional[V1Tuner] = None
|
325
325
|
early_stopping: Optional[Union[List[V1EarlyStopping], RefField]] = Field(
|
326
|
-
alias="earlyStopping"
|
326
|
+
alias="earlyStopping", default=None
|
327
327
|
)
|
328
328
|
|
329
329
|
_s_max: Optional[int] = PrivateAttr()
|
@@ -1,7 +1,12 @@
|
|
1
1
|
from typing import Dict, List, Optional, Union
|
2
2
|
from typing_extensions import Literal
|
3
3
|
|
4
|
-
from clipped.compact.pydantic import
|
4
|
+
from clipped.compact.pydantic import (
|
5
|
+
Field,
|
6
|
+
PositiveInt,
|
7
|
+
field_validator,
|
8
|
+
validation_before,
|
9
|
+
)
|
5
10
|
from clipped.types.ref_or_obj import IntOrRef, RefField
|
6
11
|
from clipped.utils.enums import PEnum
|
7
12
|
|
@@ -212,19 +217,19 @@ class V1Hyperopt(BaseSearchConfig):
|
|
212
217
|
_IDENTIFIER = V1MatrixKind.HYPEROPT
|
213
218
|
|
214
219
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
215
|
-
max_iterations: Optional[IntOrRef] = Field(alias="maxIterations")
|
220
|
+
max_iterations: Optional[IntOrRef] = Field(alias="maxIterations", default=None)
|
216
221
|
metric: V1OptimizationMetric
|
217
|
-
algorithm: Optional[V1HyperoptAlgorithms]
|
222
|
+
algorithm: Optional[V1HyperoptAlgorithms] = None
|
218
223
|
params: Union[Dict[str, V1HpParam], RefField]
|
219
|
-
num_runs: Union[PositiveInt, RefField] = Field(alias="numRuns")
|
220
|
-
seed: Optional[IntOrRef]
|
221
|
-
concurrency: Optional[Union[PositiveInt, RefField]]
|
222
|
-
tuner: Optional[V1Tuner]
|
224
|
+
num_runs: Union[PositiveInt, RefField] = Field(alias="numRuns", default=None)
|
225
|
+
seed: Optional[IntOrRef] = None
|
226
|
+
concurrency: Optional[Union[PositiveInt, RefField]] = None
|
227
|
+
tuner: Optional[V1Tuner] = None
|
223
228
|
early_stopping: Optional[Union[List[V1EarlyStopping], RefField]] = Field(
|
224
|
-
alias="earlyStopping"
|
229
|
+
alias="earlyStopping", default=None
|
225
230
|
)
|
226
231
|
|
227
|
-
@
|
232
|
+
@field_validator("num_runs", "concurrency", **validation_before)
|
228
233
|
def check_values(cls, v, field):
|
229
234
|
if v and v < 1:
|
230
235
|
raise ValueError(f"{field} must be greater than 1, received `{v}` instead.")
|
@@ -1,7 +1,12 @@
|
|
1
1
|
from typing import Dict, List, Optional, Union
|
2
2
|
from typing_extensions import Literal
|
3
3
|
|
4
|
-
from clipped.compact.pydantic import
|
4
|
+
from clipped.compact.pydantic import (
|
5
|
+
Field,
|
6
|
+
PositiveInt,
|
7
|
+
field_validator,
|
8
|
+
validation_before,
|
9
|
+
)
|
5
10
|
from clipped.types.ref_or_obj import IntOrRef, RefField
|
6
11
|
|
7
12
|
from polyaxon._flow.early_stopping import V1EarlyStopping
|
@@ -224,19 +229,20 @@ class V1Iterative(BaseSearchConfig):
|
|
224
229
|
_IDENTIFIER = V1MatrixKind.ITERATIVE
|
225
230
|
|
226
231
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
227
|
-
params: Optional[Union[Dict[str, V1HpParam], RefField]]
|
232
|
+
params: Optional[Union[Dict[str, V1HpParam], RefField]] = None
|
228
233
|
max_iterations: Union[PositiveInt, RefField] = Field(alias="maxIterations")
|
229
|
-
seed: Optional[IntOrRef]
|
230
|
-
concurrency: Optional[Union[PositiveInt, RefField]]
|
231
|
-
tuner: Optional[V1Tuner]
|
234
|
+
seed: Optional[IntOrRef] = None
|
235
|
+
concurrency: Optional[Union[PositiveInt, RefField]] = None
|
236
|
+
tuner: Optional[V1Tuner] = None
|
232
237
|
early_stopping: Optional[Union[List[V1EarlyStopping], RefField]] = Field(
|
233
|
-
alias="earlyStopping"
|
238
|
+
alias="earlyStopping", default=None
|
234
239
|
)
|
235
240
|
|
236
|
-
@
|
241
|
+
@field_validator("max_iterations", "concurrency", **validation_before)
|
237
242
|
def check_values(cls, v, field):
|
243
|
+
key = cls.get_field_name(field)
|
238
244
|
if v and v < 1:
|
239
|
-
raise ValueError(f"{
|
245
|
+
raise ValueError(f"{key} must be greater than 1, received `{v}` instead.")
|
240
246
|
return v
|
241
247
|
|
242
248
|
def create_iteration(self, iteration: Optional[int] = None) -> int:
|
polyaxon/_flow/matrix/mapping.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from typing import Dict, List, Optional, Union
|
2
2
|
from typing_extensions import Literal
|
3
3
|
|
4
|
-
from clipped.compact.pydantic import Field, PositiveInt,
|
4
|
+
from clipped.compact.pydantic import Field, PositiveInt, field_validator
|
5
5
|
from clipped.types.ref_or_obj import RefField
|
6
6
|
|
7
7
|
from polyaxon._contexts.params import is_template_ref
|
@@ -107,12 +107,12 @@ class V1Mapping(BaseSearchConfig):
|
|
107
107
|
|
108
108
|
kind: Literal[_IDENTIFIER] = _IDENTIFIER
|
109
109
|
values: Union[List[Dict], RefField]
|
110
|
-
concurrency: Optional[Union[PositiveInt, RefField]]
|
110
|
+
concurrency: Optional[Union[PositiveInt, RefField]] = None
|
111
111
|
early_stopping: Optional[Union[List[V1EarlyStopping], RefField]] = Field(
|
112
|
-
alias="earlyStopping"
|
112
|
+
alias="earlyStopping", default=None
|
113
113
|
)
|
114
114
|
|
115
|
-
@
|
115
|
+
@field_validator("concurrency")
|
116
116
|
def check_concurrency(cls, v):
|
117
117
|
if v and v < 1:
|
118
118
|
raise ValueError(
|