wandb 0.21.0__py3-none-win32.whl → 0.21.2__py3-none-win32.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.
- wandb/__init__.py +16 -14
- wandb/__init__.pyi +427 -450
- wandb/agents/pyagent.py +41 -12
- wandb/analytics/sentry.py +7 -2
- wandb/apis/importers/mlflow.py +1 -1
- wandb/apis/public/__init__.py +1 -1
- wandb/apis/public/api.py +525 -360
- wandb/apis/public/artifacts.py +207 -13
- wandb/apis/public/automations.py +19 -3
- wandb/apis/public/files.py +172 -33
- wandb/apis/public/history.py +67 -15
- wandb/apis/public/integrations.py +25 -2
- wandb/apis/public/jobs.py +90 -2
- wandb/apis/public/projects.py +130 -79
- wandb/apis/public/query_generator.py +11 -1
- wandb/apis/public/registries/_utils.py +14 -16
- wandb/apis/public/registries/registries_search.py +183 -304
- wandb/apis/public/reports.py +96 -15
- wandb/apis/public/runs.py +299 -105
- wandb/apis/public/sweeps.py +222 -22
- wandb/apis/public/teams.py +41 -4
- wandb/apis/public/users.py +45 -4
- wandb/automations/_generated/delete_automation.py +1 -3
- wandb/automations/_generated/enums.py +13 -11
- wandb/beta/workflows.py +66 -30
- wandb/bin/gpu_stats.exe +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/cli.py +127 -3
- wandb/env.py +8 -0
- wandb/errors/errors.py +4 -1
- wandb/integration/lightning/fabric/logger.py +3 -4
- wandb/integration/metaflow/__init__.py +6 -0
- wandb/integration/metaflow/data_pandas.py +74 -0
- wandb/integration/metaflow/data_pytorch.py +75 -0
- wandb/integration/metaflow/data_sklearn.py +76 -0
- wandb/integration/metaflow/errors.py +13 -0
- wandb/integration/metaflow/metaflow.py +167 -223
- wandb/integration/openai/fine_tuning.py +1 -2
- wandb/integration/weave/__init__.py +6 -0
- wandb/integration/weave/interface.py +49 -0
- wandb/integration/weave/weave.py +63 -0
- wandb/jupyter.py +5 -5
- wandb/plot/custom_chart.py +30 -7
- wandb/proto/v3/wandb_internal_pb2.py +281 -280
- wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v4/wandb_internal_pb2.py +280 -280
- wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v5/wandb_internal_pb2.py +280 -280
- wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v6/wandb_internal_pb2.py +280 -280
- wandb/proto/v6/wandb_telemetry_pb2.py +4 -4
- wandb/proto/wandb_deprecated.py +6 -0
- wandb/sdk/artifacts/_factories.py +17 -0
- wandb/sdk/artifacts/_generated/__init__.py +221 -13
- wandb/sdk/artifacts/_generated/artifact_by_id.py +17 -0
- wandb/sdk/artifacts/_generated/artifact_by_name.py +22 -0
- wandb/sdk/artifacts/_generated/artifact_collection_membership_file_urls.py +43 -0
- wandb/sdk/artifacts/_generated/artifact_created_by.py +47 -0
- wandb/sdk/artifacts/_generated/artifact_file_urls.py +22 -0
- wandb/sdk/artifacts/_generated/artifact_type.py +31 -0
- wandb/sdk/artifacts/_generated/artifact_used_by.py +43 -0
- wandb/sdk/artifacts/_generated/artifact_via_membership_by_name.py +26 -0
- wandb/sdk/artifacts/_generated/delete_artifact.py +28 -0
- wandb/sdk/artifacts/_generated/enums.py +5 -0
- wandb/sdk/artifacts/_generated/fetch_artifact_manifest.py +38 -0
- wandb/sdk/artifacts/_generated/fetch_registries.py +32 -0
- wandb/sdk/artifacts/_generated/fragments.py +279 -41
- wandb/sdk/artifacts/_generated/link_artifact.py +6 -0
- wandb/sdk/artifacts/_generated/operations.py +654 -51
- wandb/sdk/artifacts/_generated/registry_collections.py +34 -0
- wandb/sdk/artifacts/_generated/registry_versions.py +34 -0
- wandb/sdk/artifacts/_generated/unlink_artifact.py +25 -0
- wandb/sdk/artifacts/_graphql_fragments.py +3 -86
- wandb/sdk/artifacts/_internal_artifact.py +19 -8
- wandb/sdk/artifacts/_validators.py +14 -4
- wandb/sdk/artifacts/artifact.py +512 -618
- wandb/sdk/artifacts/artifact_file_cache.py +10 -6
- wandb/sdk/artifacts/artifact_manifest.py +10 -9
- wandb/sdk/artifacts/artifact_manifest_entry.py +9 -10
- wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +5 -3
- wandb/sdk/artifacts/storage_handlers/http_handler.py +1 -1
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +1 -1
- wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +1 -1
- wandb/sdk/data_types/audio.py +38 -10
- wandb/sdk/data_types/base_types/media.py +6 -56
- wandb/sdk/data_types/graph.py +48 -14
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -3
- wandb/sdk/data_types/helper_types/image_mask.py +1 -3
- wandb/sdk/data_types/histogram.py +34 -21
- wandb/sdk/data_types/html.py +35 -12
- wandb/sdk/data_types/image.py +104 -68
- wandb/sdk/data_types/molecule.py +32 -19
- wandb/sdk/data_types/object_3d.py +36 -17
- wandb/sdk/data_types/plotly.py +18 -5
- wandb/sdk/data_types/saved_model.py +4 -6
- wandb/sdk/data_types/table.py +59 -30
- wandb/sdk/data_types/video.py +53 -26
- wandb/sdk/integration_utils/auto_logging.py +2 -2
- wandb/sdk/interface/interface_queue.py +1 -4
- wandb/sdk/interface/interface_shared.py +26 -37
- wandb/sdk/interface/interface_sock.py +24 -14
- wandb/sdk/internal/internal_api.py +6 -0
- wandb/sdk/internal/job_builder.py +6 -0
- wandb/sdk/internal/settings_static.py +2 -3
- wandb/sdk/launch/agent/agent.py +8 -1
- wandb/sdk/launch/agent/run_queue_item_file_saver.py +2 -2
- wandb/sdk/launch/create_job.py +15 -2
- wandb/sdk/launch/inputs/internal.py +3 -4
- wandb/sdk/launch/inputs/schema.py +1 -0
- wandb/sdk/launch/runner/kubernetes_monitor.py +1 -0
- wandb/sdk/launch/runner/kubernetes_runner.py +323 -1
- wandb/sdk/launch/sweeps/scheduler.py +2 -3
- wandb/sdk/lib/asyncio_compat.py +19 -16
- wandb/sdk/lib/asyncio_manager.py +252 -0
- wandb/sdk/lib/deprecate.py +1 -7
- wandb/sdk/lib/disabled.py +1 -1
- wandb/sdk/lib/hashutil.py +27 -5
- wandb/sdk/lib/module.py +7 -13
- wandb/sdk/lib/printer.py +2 -2
- wandb/sdk/lib/printer_asyncio.py +3 -1
- wandb/sdk/lib/progress.py +0 -19
- wandb/sdk/lib/retry.py +185 -78
- wandb/sdk/lib/service/service_client.py +106 -0
- wandb/sdk/lib/service/service_connection.py +20 -26
- wandb/sdk/lib/service/service_token.py +30 -13
- wandb/sdk/mailbox/mailbox.py +13 -5
- wandb/sdk/mailbox/mailbox_handle.py +22 -13
- wandb/sdk/mailbox/response_handle.py +42 -106
- wandb/sdk/mailbox/wait_with_progress.py +7 -42
- wandb/sdk/wandb_init.py +77 -116
- wandb/sdk/wandb_login.py +19 -15
- wandb/sdk/wandb_metric.py +2 -0
- wandb/sdk/wandb_run.py +497 -469
- wandb/sdk/wandb_settings.py +145 -4
- wandb/sdk/wandb_setup.py +204 -124
- wandb/sdk/wandb_sweep.py +14 -13
- wandb/sdk/wandb_watch.py +4 -6
- wandb/sync/sync.py +10 -0
- wandb/util.py +58 -1
- wandb/wandb_run.py +1 -2
- {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/METADATA +1 -1
- {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/RECORD +145 -129
- wandb/sdk/interface/interface_relay.py +0 -38
- wandb/sdk/interface/router.py +0 -89
- wandb/sdk/interface/router_queue.py +0 -43
- wandb/sdk/interface/router_relay.py +0 -50
- wandb/sdk/interface/router_sock.py +0 -32
- wandb/sdk/lib/sock_client.py +0 -236
- wandb/vendor/pynvml/__init__.py +0 -0
- wandb/vendor/pynvml/pynvml.py +0 -4779
- {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/WHEEL +0 -0
- {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/entry_points.txt +0 -0
- {wandb-0.21.0.dist-info → wandb-0.21.2.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_settings.py
CHANGED
@@ -156,13 +156,21 @@ def _path_convert(*args: str) -> str:
|
|
156
156
|
return os.path.expanduser(os.path.join(*args))
|
157
157
|
|
158
158
|
|
159
|
+
CLIENT_ONLY_SETTINGS = (
|
160
|
+
"reinit",
|
161
|
+
"max_end_of_run_history_metrics",
|
162
|
+
"max_end_of_run_summary_metrics",
|
163
|
+
)
|
164
|
+
"""Python-only keys that are not fields on the settings proto."""
|
165
|
+
|
166
|
+
|
159
167
|
class Settings(BaseModel, validate_assignment=True):
|
160
168
|
"""Settings for the W&B SDK.
|
161
169
|
|
162
170
|
This class manages configuration settings for the W&B SDK,
|
163
171
|
ensuring type safety and validation of all settings. Settings are accessible
|
164
172
|
as attributes and can be initialized programmatically, through environment
|
165
|
-
variables (WANDB_ prefix), and
|
173
|
+
variables (`WANDB_ prefix`), and with configuration files.
|
166
174
|
|
167
175
|
The settings are organized into three categories:
|
168
176
|
1. Public settings: Core configuration options that users can safely modify to customize
|
@@ -230,7 +238,7 @@ class Settings(BaseModel, validate_assignment=True):
|
|
230
238
|
"""The type of console capture to be applied.
|
231
239
|
|
232
240
|
Possible values are:
|
233
|
-
|
241
|
+
"auto" - Automatically selects the console capture method based on the
|
234
242
|
system environment and settings.
|
235
243
|
|
236
244
|
"off" - Disables console capture.
|
@@ -469,6 +477,12 @@ class Settings(BaseModel, validate_assignment=True):
|
|
469
477
|
settings_system: Optional[str] = None
|
470
478
|
"""Path to the system-wide settings file."""
|
471
479
|
|
480
|
+
max_end_of_run_history_metrics: int = 10
|
481
|
+
"""Maximum number of history sparklines to display at the end of a run."""
|
482
|
+
|
483
|
+
max_end_of_run_summary_metrics: int = 10
|
484
|
+
"""Maximum number of summary metrics to display at the end of a run."""
|
485
|
+
|
472
486
|
show_colors: Optional[bool] = None
|
473
487
|
"""Whether to use colored output in the console.
|
474
488
|
|
@@ -955,6 +969,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
955
969
|
|
956
970
|
@model_validator(mode="after")
|
957
971
|
def validate_mutual_exclusion_of_branching_args(self) -> Self:
|
972
|
+
"""Check if `fork_from`, `resume`, and `resume_from` are mutually exclusive.
|
973
|
+
|
974
|
+
<!-- lazydoc-ignore: internal -->
|
975
|
+
"""
|
958
976
|
if (
|
959
977
|
sum(
|
960
978
|
o is not None
|
@@ -1002,6 +1020,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1002
1020
|
@field_validator("api_key", mode="after")
|
1003
1021
|
@classmethod
|
1004
1022
|
def validate_api_key(cls, value):
|
1023
|
+
"""Validate the API key.
|
1024
|
+
|
1025
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1026
|
+
"""
|
1005
1027
|
if value is not None and (len(value) > len(value.strip())):
|
1006
1028
|
raise UsageError("API key cannot start or end with whitespace")
|
1007
1029
|
return value
|
@@ -1009,6 +1031,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1009
1031
|
@field_validator("base_url", mode="after")
|
1010
1032
|
@classmethod
|
1011
1033
|
def validate_base_url(cls, value):
|
1034
|
+
"""Validate the base URL.
|
1035
|
+
|
1036
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1037
|
+
"""
|
1012
1038
|
validate_url(value)
|
1013
1039
|
# wandb.ai-specific checks
|
1014
1040
|
if re.match(r".*wandb\.ai[^\.]*$", value) and "api." not in value:
|
@@ -1023,6 +1049,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1023
1049
|
@field_validator("code_dir", mode="before")
|
1024
1050
|
@classmethod
|
1025
1051
|
def validate_code_dir(cls, value):
|
1052
|
+
"""Validate the code directory.
|
1053
|
+
|
1054
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1055
|
+
"""
|
1026
1056
|
# TODO: add native support for pathlib.Path
|
1027
1057
|
if isinstance(value, pathlib.Path):
|
1028
1058
|
return str(value)
|
@@ -1031,6 +1061,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1031
1061
|
@field_validator("console", mode="after")
|
1032
1062
|
@classmethod
|
1033
1063
|
def validate_console(cls, value, values):
|
1064
|
+
"""Validate the console capture method.
|
1065
|
+
|
1066
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1067
|
+
"""
|
1034
1068
|
if value != "auto":
|
1035
1069
|
return value
|
1036
1070
|
|
@@ -1039,6 +1073,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1039
1073
|
@field_validator("x_executable", mode="before")
|
1040
1074
|
@classmethod
|
1041
1075
|
def validate_x_executable(cls, value):
|
1076
|
+
"""Validate the Python executable path.
|
1077
|
+
|
1078
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1079
|
+
"""
|
1042
1080
|
# TODO: add native support for pathlib.Path
|
1043
1081
|
if isinstance(value, pathlib.Path):
|
1044
1082
|
return str(value)
|
@@ -1054,6 +1092,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1054
1092
|
@field_validator("x_file_stream_max_line_bytes", mode="after")
|
1055
1093
|
@classmethod
|
1056
1094
|
def validate_file_stream_max_line_bytes(cls, value):
|
1095
|
+
"""Validate the maximum line length for filestream JSONL files.
|
1096
|
+
|
1097
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1098
|
+
"""
|
1057
1099
|
if value is not None and value < 1:
|
1058
1100
|
raise ValueError("File stream max line bytes must be greater than 0")
|
1059
1101
|
return value
|
@@ -1061,6 +1103,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1061
1103
|
@field_validator("x_files_dir", mode="before")
|
1062
1104
|
@classmethod
|
1063
1105
|
def validate_x_files_dir(cls, value):
|
1106
|
+
"""Validate the files directory.
|
1107
|
+
|
1108
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1109
|
+
"""
|
1064
1110
|
# TODO: add native support for pathlib.Path
|
1065
1111
|
if isinstance(value, pathlib.Path):
|
1066
1112
|
return str(value)
|
@@ -1069,6 +1115,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1069
1115
|
@field_validator("fork_from", mode="before")
|
1070
1116
|
@classmethod
|
1071
1117
|
def validate_fork_from(cls, value, values) -> Optional[RunMoment]:
|
1118
|
+
"""Validate the fork_from field.
|
1119
|
+
|
1120
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1121
|
+
"""
|
1072
1122
|
run_moment = cls._runmoment_preprocessor(value)
|
1073
1123
|
|
1074
1124
|
if hasattr(values, "data"):
|
@@ -1093,6 +1143,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1093
1143
|
@field_validator("http_proxy", mode="after")
|
1094
1144
|
@classmethod
|
1095
1145
|
def validate_http_proxy(cls, value):
|
1146
|
+
"""Validate the HTTP proxy.
|
1147
|
+
|
1148
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1149
|
+
"""
|
1096
1150
|
if value is None:
|
1097
1151
|
return None
|
1098
1152
|
validate_url(value)
|
@@ -1101,6 +1155,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1101
1155
|
@field_validator("https_proxy", mode="after")
|
1102
1156
|
@classmethod
|
1103
1157
|
def validate_https_proxy(cls, value):
|
1158
|
+
"""Validate the HTTPS proxy.
|
1159
|
+
|
1160
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1161
|
+
"""
|
1104
1162
|
if value is None:
|
1105
1163
|
return None
|
1106
1164
|
validate_url(value)
|
@@ -1109,11 +1167,19 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1109
1167
|
@field_validator("ignore_globs", mode="after")
|
1110
1168
|
@classmethod
|
1111
1169
|
def validate_ignore_globs(cls, value):
|
1170
|
+
"""Validate the ignore globs.
|
1171
|
+
|
1172
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1173
|
+
"""
|
1112
1174
|
return tuple(value) if not isinstance(value, tuple) else value
|
1113
1175
|
|
1114
1176
|
@field_validator("program", mode="before")
|
1115
1177
|
@classmethod
|
1116
1178
|
def validate_program(cls, value):
|
1179
|
+
"""Validate the program path.
|
1180
|
+
|
1181
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1182
|
+
"""
|
1117
1183
|
# TODO: add native support for pathlib.Path
|
1118
1184
|
if isinstance(value, pathlib.Path):
|
1119
1185
|
return str(value)
|
@@ -1122,6 +1188,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1122
1188
|
@field_validator("program_abspath", mode="before")
|
1123
1189
|
@classmethod
|
1124
1190
|
def validate_program_abspath(cls, value):
|
1191
|
+
"""Validate the absolute program path.
|
1192
|
+
|
1193
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1194
|
+
"""
|
1125
1195
|
# TODO: add native support for pathlib.Path
|
1126
1196
|
if isinstance(value, pathlib.Path):
|
1127
1197
|
return str(value)
|
@@ -1130,6 +1200,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1130
1200
|
@field_validator("program_relpath", mode="before")
|
1131
1201
|
@classmethod
|
1132
1202
|
def validate_program_relpath(cls, value):
|
1203
|
+
"""Validate the relative program path.
|
1204
|
+
|
1205
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1206
|
+
"""
|
1133
1207
|
# TODO: add native support for pathlib.Path
|
1134
1208
|
if isinstance(value, pathlib.Path):
|
1135
1209
|
return str(value)
|
@@ -1138,6 +1212,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1138
1212
|
@field_validator("project", mode="after")
|
1139
1213
|
@classmethod
|
1140
1214
|
def validate_project(cls, value, values):
|
1215
|
+
"""Validate the project name.
|
1216
|
+
|
1217
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1218
|
+
"""
|
1141
1219
|
if value is None:
|
1142
1220
|
return None
|
1143
1221
|
invalid_chars_list = list("/\\#?%:")
|
@@ -1155,6 +1233,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1155
1233
|
@field_validator("resume", mode="before")
|
1156
1234
|
@classmethod
|
1157
1235
|
def validate_resume(cls, value):
|
1236
|
+
"""Validate the resume behavior.
|
1237
|
+
|
1238
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1239
|
+
"""
|
1158
1240
|
if value is False:
|
1159
1241
|
return None
|
1160
1242
|
if value is True:
|
@@ -1164,6 +1246,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1164
1246
|
@field_validator("resume_from", mode="before")
|
1165
1247
|
@classmethod
|
1166
1248
|
def validate_resume_from(cls, value, values) -> Optional[RunMoment]:
|
1249
|
+
"""Validate the resume_from field.
|
1250
|
+
|
1251
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1252
|
+
"""
|
1167
1253
|
run_moment = cls._runmoment_preprocessor(value)
|
1168
1254
|
|
1169
1255
|
if hasattr(values, "data"):
|
@@ -1186,6 +1272,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1186
1272
|
@field_validator("root_dir", mode="before")
|
1187
1273
|
@classmethod
|
1188
1274
|
def validate_root_dir(cls, value):
|
1275
|
+
"""Validate the root directory.
|
1276
|
+
|
1277
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1278
|
+
"""
|
1189
1279
|
# TODO: add native support for pathlib.Path
|
1190
1280
|
if isinstance(value, pathlib.Path):
|
1191
1281
|
return str(value)
|
@@ -1194,6 +1284,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1194
1284
|
@field_validator("run_id", mode="after")
|
1195
1285
|
@classmethod
|
1196
1286
|
def validate_run_id(cls, value, values):
|
1287
|
+
"""Validate the run ID.
|
1288
|
+
|
1289
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1290
|
+
"""
|
1197
1291
|
if value is None:
|
1198
1292
|
return None
|
1199
1293
|
|
@@ -1213,6 +1307,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1213
1307
|
@field_validator("settings_system", mode="after")
|
1214
1308
|
@classmethod
|
1215
1309
|
def validate_settings_system(cls, value):
|
1310
|
+
"""Validate the system settings file path.
|
1311
|
+
|
1312
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1313
|
+
"""
|
1216
1314
|
if value is None:
|
1217
1315
|
return None
|
1218
1316
|
elif isinstance(value, pathlib.Path):
|
@@ -1223,6 +1321,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1223
1321
|
@field_validator("x_service_wait", mode="after")
|
1224
1322
|
@classmethod
|
1225
1323
|
def validate_service_wait(cls, value):
|
1324
|
+
"""Validate the service wait time.
|
1325
|
+
|
1326
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1327
|
+
"""
|
1226
1328
|
if value < 0:
|
1227
1329
|
raise UsageError("Service wait time cannot be negative")
|
1228
1330
|
return value
|
@@ -1230,6 +1332,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1230
1332
|
@field_validator("start_method", mode="after")
|
1231
1333
|
@classmethod
|
1232
1334
|
def validate_start_method(cls, value):
|
1335
|
+
"""Validate the start method for subprocesses.
|
1336
|
+
|
1337
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1338
|
+
"""
|
1233
1339
|
if value is None:
|
1234
1340
|
return value
|
1235
1341
|
wandb.termwarn(
|
@@ -1248,6 +1354,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1248
1354
|
@field_validator("x_stats_gpu_device_ids", mode="before")
|
1249
1355
|
@classmethod
|
1250
1356
|
def validate_x_stats_gpu_device_ids(cls, value):
|
1357
|
+
"""Validate the GPU device IDs.
|
1358
|
+
|
1359
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1360
|
+
"""
|
1251
1361
|
if isinstance(value, str):
|
1252
1362
|
return json.loads(value)
|
1253
1363
|
return value
|
@@ -1255,6 +1365,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1255
1365
|
@field_validator("x_stats_neuron_monitor_config_path", mode="before")
|
1256
1366
|
@classmethod
|
1257
1367
|
def validate_x_stats_neuron_monitor_config_path(cls, value):
|
1368
|
+
"""Validate the path to the neuron-monitor config file.
|
1369
|
+
|
1370
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1371
|
+
"""
|
1258
1372
|
# TODO: add native support for pathlib.Path
|
1259
1373
|
if isinstance(value, pathlib.Path):
|
1260
1374
|
return str(value)
|
@@ -1263,6 +1377,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1263
1377
|
@field_validator("x_stats_open_metrics_endpoints", mode="before")
|
1264
1378
|
@classmethod
|
1265
1379
|
def validate_stats_open_metrics_endpoints(cls, value):
|
1380
|
+
"""Validate the OpenMetrics endpoints.
|
1381
|
+
|
1382
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1383
|
+
"""
|
1266
1384
|
if isinstance(value, str):
|
1267
1385
|
return json.loads(value)
|
1268
1386
|
return value
|
@@ -1270,6 +1388,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1270
1388
|
@field_validator("x_stats_open_metrics_filters", mode="before")
|
1271
1389
|
@classmethod
|
1272
1390
|
def validate_stats_open_metrics_filters(cls, value):
|
1391
|
+
"""Validate the OpenMetrics filters.
|
1392
|
+
|
1393
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1394
|
+
"""
|
1273
1395
|
if isinstance(value, str):
|
1274
1396
|
return json.loads(value)
|
1275
1397
|
return value
|
@@ -1277,6 +1399,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1277
1399
|
@field_validator("x_stats_open_metrics_http_headers", mode="before")
|
1278
1400
|
@classmethod
|
1279
1401
|
def validate_stats_open_metrics_http_headers(cls, value):
|
1402
|
+
"""Validate the OpenMetrics HTTP headers.
|
1403
|
+
|
1404
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1405
|
+
"""
|
1280
1406
|
if isinstance(value, str):
|
1281
1407
|
return json.loads(value)
|
1282
1408
|
return value
|
@@ -1284,6 +1410,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1284
1410
|
@field_validator("x_stats_sampling_interval", mode="after")
|
1285
1411
|
@classmethod
|
1286
1412
|
def validate_stats_sampling_interval(cls, value):
|
1413
|
+
"""Validate the stats sampling interval.
|
1414
|
+
|
1415
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1416
|
+
"""
|
1287
1417
|
if value < 0.1:
|
1288
1418
|
raise UsageError("Stats sampling interval cannot be less than 0.1 seconds")
|
1289
1419
|
return value
|
@@ -1291,6 +1421,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1291
1421
|
@field_validator("sweep_id", mode="after")
|
1292
1422
|
@classmethod
|
1293
1423
|
def validate_sweep_id(cls, value):
|
1424
|
+
"""Validate the sweep ID.
|
1425
|
+
|
1426
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1427
|
+
"""
|
1294
1428
|
if value is None:
|
1295
1429
|
return None
|
1296
1430
|
if len(value) == 0:
|
@@ -1304,6 +1438,10 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1304
1438
|
@field_validator("sweep_param_path", mode="before")
|
1305
1439
|
@classmethod
|
1306
1440
|
def validate_sweep_param_path(cls, value):
|
1441
|
+
"""Validate the sweep parameter path.
|
1442
|
+
|
1443
|
+
<!-- lazydoc-ignore-classmethod: internal -->
|
1444
|
+
"""
|
1307
1445
|
# TODO: add native support for pathlib.Path
|
1308
1446
|
if isinstance(value, pathlib.Path):
|
1309
1447
|
return str(value)
|
@@ -1503,6 +1641,7 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1503
1641
|
@computed_field # type: ignore[prop-decorator]
|
1504
1642
|
@property
|
1505
1643
|
def run_mode(self) -> Literal["run", "offline-run"]:
|
1644
|
+
"""The mode of the run. Can be either "run" or "offline-run"."""
|
1506
1645
|
return "run" if not self._offline else "offline-run"
|
1507
1646
|
|
1508
1647
|
@computed_field # type: ignore[prop-decorator]
|
@@ -1538,6 +1677,7 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1538
1677
|
@computed_field # type: ignore[prop-decorator]
|
1539
1678
|
@property
|
1540
1679
|
def sync_dir(self) -> str:
|
1680
|
+
"""The directory for storing the run's files."""
|
1541
1681
|
return _path_convert(
|
1542
1682
|
self.wandb_dir,
|
1543
1683
|
f"{self.run_mode}-{self.timespec}-{self.run_id}",
|
@@ -1552,11 +1692,13 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1552
1692
|
@computed_field # type: ignore[prop-decorator]
|
1553
1693
|
@property
|
1554
1694
|
def sync_symlink_latest(self) -> str:
|
1695
|
+
"""Path to the symlink to the most recent run's transaction log file."""
|
1555
1696
|
return _path_convert(self.wandb_dir, "latest-run")
|
1556
1697
|
|
1557
1698
|
@computed_field # type: ignore[prop-decorator]
|
1558
1699
|
@property
|
1559
1700
|
def timespec(self) -> str:
|
1701
|
+
"""The time specification for the run."""
|
1560
1702
|
return self._start_datetime
|
1561
1703
|
|
1562
1704
|
@computed_field # type: ignore[prop-decorator]
|
@@ -1729,8 +1871,7 @@ class Settings(BaseModel, validate_assignment=True):
|
|
1729
1871
|
"""Generate a protobuf representation of the settings."""
|
1730
1872
|
settings_proto = wandb_settings_pb2.Settings()
|
1731
1873
|
for k, v in self.model_dump(exclude_none=True).items():
|
1732
|
-
|
1733
|
-
if k in ("reinit",):
|
1874
|
+
if k in CLIENT_ONLY_SETTINGS:
|
1734
1875
|
continue
|
1735
1876
|
|
1736
1877
|
# Special case for x_stats_open_metrics_filters.
|