wandb 0.20.2rc20250616__py3-none-macosx_11_0_arm64.whl → 0.21.1__py3-none-macosx_11_0_arm64.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 +450 -472
- wandb/agents/pyagent.py +41 -12
- wandb/analytics/sentry.py +7 -2
- wandb/apis/importers/mlflow.py +1 -1
- wandb/apis/internal.py +3 -0
- wandb/apis/paginator.py +17 -4
- wandb/apis/public/__init__.py +1 -1
- wandb/apis/public/api.py +606 -359
- wandb/apis/public/artifacts.py +214 -16
- wandb/apis/public/automations.py +19 -3
- wandb/apis/public/files.py +177 -38
- 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 +161 -69
- wandb/apis/public/query_generator.py +11 -1
- wandb/apis/public/registries/registries_search.py +7 -15
- wandb/apis/public/reports.py +147 -13
- wandb/apis/public/runs.py +315 -128
- wandb/apis/public/sweeps.py +222 -22
- wandb/apis/public/teams.py +41 -4
- wandb/apis/public/users.py +45 -4
- wandb/automations/__init__.py +10 -10
- wandb/automations/_filters/run_metrics.py +0 -2
- wandb/automations/_utils.py +0 -2
- wandb/automations/actions.py +0 -2
- wandb/automations/automations.py +0 -2
- wandb/automations/events.py +0 -2
- wandb/beta/workflows.py +66 -30
- wandb/bin/gpu_stats +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/cli.py +80 -1
- wandb/env.py +8 -0
- wandb/errors/errors.py +4 -1
- wandb/integration/catboost/catboost.py +6 -2
- wandb/integration/kfp/kfp_patch.py +3 -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/errors.py +13 -0
- wandb/integration/metaflow/metaflow.py +205 -190
- wandb/integration/openai/fine_tuning.py +1 -2
- wandb/integration/sb3/sb3.py +3 -3
- wandb/integration/ultralytics/callback.py +6 -2
- wandb/jupyter.py +5 -5
- wandb/plot/__init__.py +2 -0
- wandb/plot/bar.py +30 -29
- wandb/plot/confusion_matrix.py +75 -71
- wandb/plot/custom_chart.py +30 -7
- wandb/plot/histogram.py +26 -25
- wandb/plot/line.py +33 -32
- wandb/plot/line_series.py +100 -103
- wandb/plot/pr_curve.py +33 -32
- wandb/plot/roc_curve.py +38 -38
- wandb/plot/scatter.py +27 -27
- wandb/proto/v3/wandb_internal_pb2.py +366 -385
- wandb/proto/v3/wandb_settings_pb2.py +2 -2
- wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v4/wandb_internal_pb2.py +352 -356
- wandb/proto/v4/wandb_settings_pb2.py +2 -2
- wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v5/wandb_internal_pb2.py +352 -356
- wandb/proto/v5/wandb_settings_pb2.py +2 -2
- wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
- wandb/proto/v6/wandb_internal_pb2.py +352 -356
- wandb/proto/v6/wandb_settings_pb2.py +2 -2
- wandb/proto/v6/wandb_telemetry_pb2.py +4 -4
- wandb/proto/wandb_deprecated.py +6 -0
- wandb/sdk/artifacts/_generated/__init__.py +12 -1
- wandb/sdk/artifacts/_generated/input_types.py +20 -2
- wandb/sdk/artifacts/_generated/link_artifact.py +21 -0
- wandb/sdk/artifacts/_generated/operations.py +9 -0
- wandb/sdk/artifacts/_internal_artifact.py +19 -8
- wandb/sdk/artifacts/_validators.py +48 -2
- wandb/sdk/artifacts/artifact.py +269 -96
- wandb/sdk/data_types/audio.py +38 -10
- wandb/sdk/data_types/base_types/media.py +15 -63
- wandb/sdk/data_types/base_types/wb_value.py +6 -6
- 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 +7 -9
- wandb/sdk/data_types/table.py +99 -70
- wandb/sdk/data_types/trace_tree.py +12 -12
- wandb/sdk/data_types/video.py +53 -26
- wandb/sdk/integration_utils/auto_logging.py +2 -2
- wandb/sdk/interface/interface.py +8 -19
- wandb/sdk/interface/interface_shared.py +7 -16
- wandb/sdk/internal/datastore.py +18 -18
- wandb/sdk/internal/handler.py +3 -5
- wandb/sdk/internal/internal_api.py +60 -0
- wandb/sdk/internal/job_builder.py +6 -0
- wandb/sdk/internal/sender.py +23 -3
- wandb/sdk/internal/sender_config.py +9 -0
- wandb/sdk/launch/_project_spec.py +3 -3
- wandb/sdk/launch/agent/agent.py +11 -4
- wandb/sdk/launch/agent/job_status_tracker.py +3 -1
- wandb/sdk/launch/agent/run_queue_item_file_saver.py +2 -2
- wandb/sdk/launch/create_job.py +3 -1
- 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 +328 -1
- wandb/sdk/launch/sweeps/scheduler.py +2 -3
- wandb/sdk/launch/utils.py +3 -3
- wandb/sdk/lib/asyncio_compat.py +3 -0
- wandb/sdk/lib/console_capture.py +66 -19
- wandb/sdk/lib/deprecate.py +1 -7
- wandb/sdk/lib/disabled.py +1 -1
- wandb/sdk/lib/hashutil.py +14 -1
- wandb/sdk/lib/module.py +7 -13
- wandb/sdk/lib/progress.py +0 -19
- wandb/sdk/lib/sock_client.py +0 -4
- wandb/sdk/wandb_init.py +67 -93
- wandb/sdk/wandb_login.py +18 -14
- wandb/sdk/wandb_metric.py +2 -0
- wandb/sdk/wandb_require.py +0 -1
- wandb/sdk/wandb_run.py +429 -527
- wandb/sdk/wandb_settings.py +364 -74
- wandb/sdk/wandb_setup.py +28 -28
- wandb/sdk/wandb_sweep.py +14 -13
- wandb/sdk/wandb_watch.py +4 -6
- wandb/sync/sync.py +10 -0
- wandb/util.py +57 -0
- wandb/wandb_run.py +1 -2
- {wandb-0.20.2rc20250616.dist-info → wandb-0.21.1.dist-info}/METADATA +1 -1
- {wandb-0.20.2rc20250616.dist-info → wandb-0.21.1.dist-info}/RECORD +137 -137
- wandb/sdk/wandb_metadata.py +0 -623
- wandb/vendor/pynvml/__init__.py +0 -0
- wandb/vendor/pynvml/pynvml.py +0 -4779
- {wandb-0.20.2rc20250616.dist-info → wandb-0.21.1.dist-info}/WHEEL +0 -0
- {wandb-0.20.2rc20250616.dist-info → wandb-0.21.1.dist-info}/entry_points.txt +0 -0
- {wandb-0.20.2rc20250616.dist-info → wandb-0.21.1.dist-info}/licenses/LICENSE +0 -0
wandb/agents/pyagent.py
CHANGED
@@ -9,6 +9,7 @@ import logging
|
|
9
9
|
import os
|
10
10
|
import queue
|
11
11
|
import socket
|
12
|
+
import sys
|
12
13
|
import threading
|
13
14
|
import time
|
14
15
|
import traceback
|
@@ -222,17 +223,10 @@ class Agent:
|
|
222
223
|
self._run_status[run_id] = RunStatus.DONE
|
223
224
|
elif self._run_status[run_id] == RunStatus.ERRORED:
|
224
225
|
exc = self._exceptions[run_id]
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
)
|
230
|
-
exc_traceback_formatted = traceback.format_exception(
|
231
|
-
exc_type, exc_value, exc_traceback
|
232
|
-
)
|
233
|
-
exc_repr = "".join(exc_traceback_formatted)
|
234
|
-
logger.error(f"Run {run_id} errored:\n{exc_repr}")
|
235
|
-
wandb.termerror(f"Run {run_id} errored:\n{exc_repr}")
|
226
|
+
# Extract to reduce a decision point to avoid ruff c901
|
227
|
+
log_str, term_str = _get_exception_logger_and_term_strs(exc)
|
228
|
+
logger.error(f"Run {run_id} errored:\n{log_str}")
|
229
|
+
wandb.termerror(f"Run {run_id} errored:{term_str}")
|
236
230
|
if os.getenv(wandb.env.AGENT_DISABLE_FLAPPING) == "true":
|
237
231
|
self._exit_flag = True
|
238
232
|
return
|
@@ -299,7 +293,18 @@ class Agent:
|
|
299
293
|
for k, v in job.config.items():
|
300
294
|
wandb.termlog("\t{}: {}".format(k, v["value"]))
|
301
295
|
|
302
|
-
|
296
|
+
try:
|
297
|
+
self._function()
|
298
|
+
except KeyboardInterrupt:
|
299
|
+
raise
|
300
|
+
except Exception as e:
|
301
|
+
# Log the run's exceptions directly to stderr to match CLI case, and wrap so we
|
302
|
+
# can identify it as coming from the job later later. This will get automatically
|
303
|
+
# logged by console_capture.py. Exception handler below will also handle exceptions
|
304
|
+
# in setup code.
|
305
|
+
exc_repr = _format_exception_traceback(e)
|
306
|
+
print(exc_repr, file=sys.stderr) # noqa: T201
|
307
|
+
raise _JobError(f"Run threw exception: {str(e)}") from e
|
303
308
|
wandb.finish()
|
304
309
|
except KeyboardInterrupt:
|
305
310
|
raise
|
@@ -350,6 +355,30 @@ def pyagent(sweep_id, function, entity=None, project=None, count=None):
|
|
350
355
|
agent.run()
|
351
356
|
|
352
357
|
|
358
|
+
def _format_exception_traceback(exc):
|
359
|
+
return "".join(traceback.format_exception(type(exc), exc, exc.__traceback__))
|
360
|
+
|
361
|
+
|
362
|
+
class _JobError(Exception):
|
363
|
+
"""Exception raised when a job fails during execution."""
|
364
|
+
|
365
|
+
pass
|
366
|
+
|
367
|
+
|
368
|
+
def _get_exception_logger_and_term_strs(exc):
|
369
|
+
if isinstance(exc, _JobError) and exc.__cause__:
|
370
|
+
# If it's a JobException, get the original exception for display
|
371
|
+
job_exc = exc.__cause__
|
372
|
+
log_str = _format_exception_traceback(job_exc)
|
373
|
+
# Don't long full stacktrace to terminal again because we already
|
374
|
+
# printed it to stderr.
|
375
|
+
term_str = " " + str(job_exc)
|
376
|
+
else:
|
377
|
+
log_str = _format_exception_traceback(exc)
|
378
|
+
term_str = "\n" + log_str
|
379
|
+
return log_str, term_str
|
380
|
+
|
381
|
+
|
353
382
|
_INSTANCES = 0
|
354
383
|
|
355
384
|
|
wandb/analytics/sentry.py
CHANGED
@@ -91,13 +91,18 @@ class Sentry:
|
|
91
91
|
self.scope.set_client(client)
|
92
92
|
|
93
93
|
@_safe_noop
|
94
|
-
def message(
|
94
|
+
def message(
|
95
|
+
self,
|
96
|
+
message: str,
|
97
|
+
repeat: bool = True,
|
98
|
+
level: str = "info",
|
99
|
+
) -> str | None:
|
95
100
|
"""Send a message to Sentry."""
|
96
101
|
if not repeat and message in self._sent_messages:
|
97
102
|
return None
|
98
103
|
self._sent_messages.add(message)
|
99
104
|
with sentry_sdk.scope.use_isolation_scope(self.scope): # type: ignore
|
100
|
-
return sentry_sdk.capture_message(message) # type: ignore
|
105
|
+
return sentry_sdk.capture_message(message, level=level) # type: ignore
|
101
106
|
|
102
107
|
@_safe_noop
|
103
108
|
def exception(
|
wandb/apis/importers/mlflow.py
CHANGED
wandb/apis/internal.py
CHANGED
@@ -211,6 +211,9 @@ class Api:
|
|
211
211
|
def upsert_run_queue(self, *args, **kwargs):
|
212
212
|
return self.api.upsert_run_queue(*args, **kwargs)
|
213
213
|
|
214
|
+
def create_custom_chart(self, *args, **kwargs):
|
215
|
+
return self.api.create_custom_chart(*args, **kwargs)
|
216
|
+
|
214
217
|
def update_launch_agent_status(self, *args, **kwargs):
|
215
218
|
return self.api.update_launch_agent_status(*args, **kwargs)
|
216
219
|
|
wandb/apis/paginator.py
CHANGED
@@ -13,6 +13,8 @@ from typing import (
|
|
13
13
|
overload,
|
14
14
|
)
|
15
15
|
|
16
|
+
import wandb
|
17
|
+
|
16
18
|
if TYPE_CHECKING:
|
17
19
|
from wandb_graphql.language.ast import Document
|
18
20
|
|
@@ -112,14 +114,25 @@ class Paginator(Iterator[T]):
|
|
112
114
|
class SizedPaginator(Paginator[T], Sized):
|
113
115
|
"""A Paginator for objects with a known total count."""
|
114
116
|
|
117
|
+
@property
|
118
|
+
def length(self) -> int | None:
|
119
|
+
wandb.termwarn(
|
120
|
+
(
|
121
|
+
"`.length` is deprecated and will be removed in a future version. "
|
122
|
+
"Use `len(...)` instead."
|
123
|
+
),
|
124
|
+
repeat=False,
|
125
|
+
)
|
126
|
+
return len(self)
|
127
|
+
|
115
128
|
def __len__(self) -> int:
|
116
|
-
if self.
|
129
|
+
if self._length is None:
|
117
130
|
self._load_page()
|
118
|
-
if self.
|
131
|
+
if self._length is None:
|
119
132
|
raise ValueError("Object doesn't provide length")
|
120
|
-
return self.
|
133
|
+
return self._length
|
121
134
|
|
122
135
|
@property
|
123
136
|
@abstractmethod
|
124
|
-
def
|
137
|
+
def _length(self) -> int | None:
|
125
138
|
raise NotImplementedError
|
wandb/apis/public/__init__.py
CHANGED
@@ -20,7 +20,7 @@ from wandb.apis.public.jobs import (
|
|
20
20
|
RunQueuePrioritizationMode,
|
21
21
|
RunQueueResourceType,
|
22
22
|
)
|
23
|
-
from wandb.apis.public.projects import PROJECT_FRAGMENT, Project, Projects
|
23
|
+
from wandb.apis.public.projects import PROJECT_FRAGMENT, Project, Projects, Sweeps
|
24
24
|
from wandb.apis.public.query_generator import QueryGenerator
|
25
25
|
from wandb.apis.public.registries.registry import Registry
|
26
26
|
from wandb.apis.public.reports import (
|