wandb 0.20.1rc20250604__py3-none-win32.whl → 0.21.0__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 +3 -6
- wandb/__init__.pyi +24 -23
- wandb/analytics/sentry.py +2 -2
- wandb/apis/importers/internals/internal.py +0 -3
- wandb/apis/internal.py +3 -0
- wandb/apis/paginator.py +17 -4
- wandb/apis/public/api.py +85 -4
- wandb/apis/public/artifacts.py +10 -8
- wandb/apis/public/files.py +5 -5
- wandb/apis/public/projects.py +44 -3
- wandb/apis/public/registries/{utils.py → _utils.py} +12 -12
- wandb/apis/public/registries/registries_search.py +2 -2
- wandb/apis/public/registries/registry.py +19 -18
- wandb/apis/public/reports.py +64 -8
- wandb/apis/public/runs.py +16 -23
- 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/bin/gpu_stats.exe +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/beta.py +1 -7
- wandb/cli/cli.py +0 -30
- wandb/env.py +0 -6
- wandb/integration/catboost/catboost.py +6 -2
- wandb/integration/kfp/kfp_patch.py +3 -1
- wandb/integration/sb3/sb3.py +3 -3
- wandb/integration/ultralytics/callback.py +6 -2
- wandb/plot/__init__.py +2 -0
- wandb/plot/bar.py +30 -29
- wandb/plot/confusion_matrix.py +75 -71
- 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 +10 -10
- 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 +10 -10
- 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 +10 -10
- 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 +10 -10
- 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/_validators.py +40 -2
- wandb/sdk/artifacts/artifact.py +163 -21
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +42 -1
- wandb/sdk/backend/backend.py +1 -1
- wandb/sdk/data_types/base_types/media.py +9 -7
- wandb/sdk/data_types/base_types/wb_value.py +6 -6
- wandb/sdk/data_types/saved_model.py +3 -3
- wandb/sdk/data_types/table.py +41 -41
- wandb/sdk/data_types/trace_tree.py +12 -12
- 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 +4 -74
- wandb/sdk/internal/internal_api.py +54 -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 +3 -3
- wandb/sdk/launch/agent/job_status_tracker.py +3 -1
- wandb/sdk/launch/utils.py +3 -3
- wandb/sdk/lib/console_capture.py +66 -19
- wandb/sdk/lib/printer.py +6 -7
- wandb/sdk/lib/progress.py +1 -3
- wandb/sdk/lib/service/ipc_support.py +13 -0
- wandb/sdk/lib/{service_connection.py → service/service_connection.py} +20 -56
- wandb/sdk/lib/service/service_port_file.py +105 -0
- wandb/sdk/lib/service/service_process.py +111 -0
- wandb/sdk/lib/service/service_token.py +164 -0
- wandb/sdk/lib/sock_client.py +8 -12
- wandb/sdk/wandb_init.py +1 -5
- wandb/sdk/wandb_require.py +9 -21
- wandb/sdk/wandb_run.py +23 -137
- wandb/sdk/wandb_settings.py +233 -80
- wandb/sdk/wandb_setup.py +2 -13
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/METADATA +1 -3
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/RECORD +94 -120
- wandb/sdk/internal/flow_control.py +0 -263
- wandb/sdk/internal/internal.py +0 -401
- wandb/sdk/internal/internal_util.py +0 -97
- wandb/sdk/internal/system/__init__.py +0 -0
- wandb/sdk/internal/system/assets/__init__.py +0 -25
- wandb/sdk/internal/system/assets/aggregators.py +0 -31
- wandb/sdk/internal/system/assets/asset_registry.py +0 -20
- wandb/sdk/internal/system/assets/cpu.py +0 -163
- wandb/sdk/internal/system/assets/disk.py +0 -210
- wandb/sdk/internal/system/assets/gpu.py +0 -416
- wandb/sdk/internal/system/assets/gpu_amd.py +0 -233
- wandb/sdk/internal/system/assets/interfaces.py +0 -205
- wandb/sdk/internal/system/assets/ipu.py +0 -177
- wandb/sdk/internal/system/assets/memory.py +0 -166
- wandb/sdk/internal/system/assets/network.py +0 -125
- wandb/sdk/internal/system/assets/open_metrics.py +0 -293
- wandb/sdk/internal/system/assets/tpu.py +0 -154
- wandb/sdk/internal/system/assets/trainium.py +0 -393
- wandb/sdk/internal/system/env_probe_helpers.py +0 -13
- wandb/sdk/internal/system/system_info.py +0 -248
- wandb/sdk/internal/system/system_monitor.py +0 -224
- wandb/sdk/internal/writer.py +0 -204
- wandb/sdk/lib/service_token.py +0 -93
- wandb/sdk/service/__init__.py +0 -0
- wandb/sdk/service/_startup_debug.py +0 -22
- wandb/sdk/service/port_file.py +0 -53
- wandb/sdk/service/server.py +0 -107
- wandb/sdk/service/server_sock.py +0 -286
- wandb/sdk/service/service.py +0 -252
- wandb/sdk/service/streams.py +0 -425
- wandb/sdk/wandb_metadata.py +0 -623
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/WHEEL +0 -0
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/entry_points.txt +0 -0
- {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_run.py
CHANGED
@@ -35,13 +35,13 @@ from wandb.integration.torch import wandb_torch
|
|
35
35
|
from wandb.plot import CustomChart, Visualize
|
36
36
|
from wandb.proto.wandb_deprecated import Deprecated
|
37
37
|
from wandb.proto.wandb_internal_pb2 import (
|
38
|
-
MetadataRequest,
|
39
38
|
MetricRecord,
|
40
39
|
PollExitResponse,
|
41
40
|
Result,
|
42
41
|
RunRecord,
|
43
42
|
)
|
44
43
|
from wandb.sdk.artifacts._internal_artifact import InternalArtifact
|
44
|
+
from wandb.sdk.artifacts._validators import is_artifact_registry_project
|
45
45
|
from wandb.sdk.artifacts.artifact import Artifact
|
46
46
|
from wandb.sdk.internal import job_builder
|
47
47
|
from wandb.sdk.lib import asyncio_compat, wb_logging
|
@@ -63,7 +63,7 @@ from wandb.util import (
|
|
63
63
|
from . import wandb_config, wandb_metric, wandb_summary
|
64
64
|
from .artifacts._validators import (
|
65
65
|
MAX_ARTIFACT_METADATA_KEYS,
|
66
|
-
|
66
|
+
ArtifactPath,
|
67
67
|
validate_aliases,
|
68
68
|
validate_tags,
|
69
69
|
)
|
@@ -92,7 +92,6 @@ from .mailbox import (
|
|
92
92
|
wait_with_progress,
|
93
93
|
)
|
94
94
|
from .wandb_alerts import AlertLevel
|
95
|
-
from .wandb_metadata import Metadata
|
96
95
|
from .wandb_settings import Settings
|
97
96
|
from .wandb_setup import _WandbSetup
|
98
97
|
|
@@ -168,6 +167,7 @@ class RunStatusChecker:
|
|
168
167
|
self,
|
169
168
|
run_id: str,
|
170
169
|
interface: InterfaceBase,
|
170
|
+
settings: Settings,
|
171
171
|
stop_polling_interval: int = 15,
|
172
172
|
retry_polling_interval: int = 5,
|
173
173
|
internal_messages_polling_interval: int = 10,
|
@@ -177,6 +177,7 @@ class RunStatusChecker:
|
|
177
177
|
self._stop_polling_interval = stop_polling_interval
|
178
178
|
self._retry_polling_interval = retry_polling_interval
|
179
179
|
self._internal_messages_polling_interval = internal_messages_polling_interval
|
180
|
+
self._settings = settings
|
180
181
|
|
181
182
|
self._join_event = threading.Event()
|
182
183
|
|
@@ -318,9 +319,15 @@ class RunStatusChecker:
|
|
318
319
|
|
319
320
|
def check_internal_messages(self) -> None:
|
320
321
|
def _process_internal_messages(result: Result) -> None:
|
322
|
+
if (
|
323
|
+
not self._settings.show_warnings
|
324
|
+
or self._settings.quiet
|
325
|
+
or self._settings.silent
|
326
|
+
):
|
327
|
+
return
|
321
328
|
internal_messages = result.response.internal_messages_response
|
322
329
|
for msg in internal_messages.messages.warning:
|
323
|
-
wandb.termwarn(msg)
|
330
|
+
wandb.termwarn(msg, repeat=False)
|
324
331
|
|
325
332
|
with wb_logging.log_to_run(self._run_id):
|
326
333
|
try:
|
@@ -620,8 +627,6 @@ class Run:
|
|
620
627
|
)
|
621
628
|
self.summary._set_update_callback(self._summary_update_callback)
|
622
629
|
|
623
|
-
self.__metadata: Metadata | None = None
|
624
|
-
|
625
630
|
self._step = 0
|
626
631
|
self._starting_step = 0
|
627
632
|
self._start_runtime = 0
|
@@ -1647,7 +1652,7 @@ class Run:
|
|
1647
1652
|
def _populate_git_info(self) -> None:
|
1648
1653
|
from .lib.gitlib import GitRepo
|
1649
1654
|
|
1650
|
-
# Use user
|
1655
|
+
# Use user-provided git info if available, otherwise resolve it from the environment
|
1651
1656
|
try:
|
1652
1657
|
repo = GitRepo(
|
1653
1658
|
root=self._settings.git_root,
|
@@ -2481,6 +2486,7 @@ class Run:
|
|
2481
2486
|
self._run_status_checker = RunStatusChecker(
|
2482
2487
|
self._settings.run_id,
|
2483
2488
|
interface=self._backend.interface,
|
2489
|
+
settings=self._settings,
|
2484
2490
|
)
|
2485
2491
|
self._run_status_checker.start()
|
2486
2492
|
|
@@ -2922,9 +2928,6 @@ class Run:
|
|
2922
2928
|
"""
|
2923
2929
|
wandb.sdk._unwatch(self, models=models)
|
2924
2930
|
|
2925
|
-
def _detach(self) -> None:
|
2926
|
-
pass
|
2927
|
-
|
2928
2931
|
@_log_to_run
|
2929
2932
|
@_raise_if_finished
|
2930
2933
|
@_attach
|
@@ -2950,13 +2953,6 @@ class Run:
|
|
2950
2953
|
The linked artifact if linking was successful, otherwise None.
|
2951
2954
|
|
2952
2955
|
"""
|
2953
|
-
portfolio, project, entity = wandb.util._parse_entity_project_item(target_path)
|
2954
|
-
if aliases is None:
|
2955
|
-
aliases = []
|
2956
|
-
|
2957
|
-
if not self._backend or not self._backend.interface:
|
2958
|
-
return None
|
2959
|
-
|
2960
2956
|
if artifact.is_draft() and not artifact._is_draft_save_started():
|
2961
2957
|
artifact = self._log_artifact(artifact)
|
2962
2958
|
|
@@ -2964,52 +2960,17 @@ class Run:
|
|
2964
2960
|
# TODO: implement offline mode + sync
|
2965
2961
|
raise NotImplementedError
|
2966
2962
|
|
2967
|
-
#
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
2976
|
-
project = project or self.project
|
2977
|
-
entity = entity or self.entity
|
2978
|
-
handle = self._backend.interface.deliver_link_artifact(
|
2979
|
-
artifact,
|
2980
|
-
portfolio,
|
2981
|
-
aliases,
|
2982
|
-
entity,
|
2983
|
-
project,
|
2984
|
-
organization,
|
2985
|
-
)
|
2986
|
-
if artifact._ttl_duration_seconds is not None:
|
2987
|
-
wandb.termwarn(
|
2988
|
-
"Artifact TTL will be disabled for source artifacts that are linked to portfolios."
|
2989
|
-
)
|
2990
|
-
result = handle.wait_or(timeout=None)
|
2991
|
-
response = result.response.link_artifact_response
|
2992
|
-
if response.error_message:
|
2993
|
-
wandb.termerror(response.error_message)
|
2994
|
-
return None
|
2995
|
-
if response.version_index is None:
|
2996
|
-
wandb.termerror(
|
2997
|
-
"Error fetching the linked artifact's version index after linking"
|
2998
|
-
)
|
2999
|
-
return None
|
2963
|
+
# Normalize the target "entity/project/collection" with defaults
|
2964
|
+
# inferred from this run's entity and project, if needed.
|
2965
|
+
#
|
2966
|
+
# HOWEVER, if the target path is a registry collection, avoid setting
|
2967
|
+
# the target entity to the run's entity. Instead, delegate to
|
2968
|
+
# Artifact.link() to resolve the required org entity.
|
2969
|
+
target = ArtifactPath.from_str(target_path)
|
2970
|
+
if not (target.project and is_artifact_registry_project(target.project)):
|
2971
|
+
target = target.with_defaults(prefix=self.entity, project=self.project)
|
3000
2972
|
|
3001
|
-
|
3002
|
-
artifact_name = f"{entity}/{project}/{portfolio}:v{response.version_index}"
|
3003
|
-
if is_artifact_registry_project(project):
|
3004
|
-
if organization:
|
3005
|
-
artifact_name = f"{organization}/{project}/{portfolio}:v{response.version_index}"
|
3006
|
-
else:
|
3007
|
-
artifact_name = f"{project}/{portfolio}:v{response.version_index}"
|
3008
|
-
linked_artifact = self._public_api()._artifact(artifact_name)
|
3009
|
-
except Exception as e:
|
3010
|
-
wandb.termerror(f"Error fetching link artifact after linking: {e}")
|
3011
|
-
return None
|
3012
|
-
return linked_artifact
|
2973
|
+
return artifact.link(target.to_str(), aliases)
|
3013
2974
|
|
3014
2975
|
@_log_to_run
|
3015
2976
|
@_raise_if_finished
|
@@ -3737,60 +3698,6 @@ class Run:
|
|
3737
3698
|
logger.exception("Error getting system metrics.")
|
3738
3699
|
return {}
|
3739
3700
|
|
3740
|
-
@property
|
3741
|
-
@_log_to_run
|
3742
|
-
@_attach
|
3743
|
-
@_raise_if_finished
|
3744
|
-
def _metadata(self) -> Metadata | None:
|
3745
|
-
"""The metadata associated with this run.
|
3746
|
-
|
3747
|
-
NOTE: Automatically collected metadata can be overridden by the user.
|
3748
|
-
"""
|
3749
|
-
if not self._backend or not self._backend.interface:
|
3750
|
-
return self.__metadata
|
3751
|
-
|
3752
|
-
# Initialize the metadata object if it doesn't exist.
|
3753
|
-
if self.__metadata is None:
|
3754
|
-
self.__metadata = Metadata()
|
3755
|
-
self.__metadata._set_callback(self._metadata_callback)
|
3756
|
-
|
3757
|
-
handle = self._backend.interface.deliver_get_system_metadata()
|
3758
|
-
|
3759
|
-
try:
|
3760
|
-
result = handle.wait_or(timeout=1)
|
3761
|
-
except TimeoutError:
|
3762
|
-
logger.exception("Timeout getting run metadata.")
|
3763
|
-
return None
|
3764
|
-
|
3765
|
-
response = result.response.get_system_metadata_response
|
3766
|
-
|
3767
|
-
# Temporarily disable the callback to prevent triggering
|
3768
|
-
# an update call to wandb-core with the callback.
|
3769
|
-
with self.__metadata.disable_callback():
|
3770
|
-
# Values stored in the metadata object take precedence.
|
3771
|
-
self.__metadata.update_from_proto(response.metadata, skip_existing=True)
|
3772
|
-
|
3773
|
-
return self.__metadata
|
3774
|
-
|
3775
|
-
@_log_to_run
|
3776
|
-
@_raise_if_finished
|
3777
|
-
@_attach
|
3778
|
-
def _metadata_callback(
|
3779
|
-
self,
|
3780
|
-
metadata: MetadataRequest,
|
3781
|
-
) -> None:
|
3782
|
-
"""Callback to publish Metadata to wandb-core upon user updates."""
|
3783
|
-
# ignore updates if the attached to another run
|
3784
|
-
if self._is_attached:
|
3785
|
-
wandb.termwarn(
|
3786
|
-
"Metadata updates are ignored when attached to another run.",
|
3787
|
-
repeat=False,
|
3788
|
-
)
|
3789
|
-
return
|
3790
|
-
|
3791
|
-
if self._backend and self._backend.interface:
|
3792
|
-
self._backend.interface.publish_metadata(metadata)
|
3793
|
-
|
3794
3701
|
# ------------------------------------------------------------------------------
|
3795
3702
|
# HEADER
|
3796
3703
|
# ------------------------------------------------------------------------------
|
@@ -3918,10 +3825,6 @@ class Run:
|
|
3918
3825
|
printer=printer,
|
3919
3826
|
)
|
3920
3827
|
Run._footer_log_dir_info(settings=settings, printer=printer)
|
3921
|
-
Run._footer_notify_wandb_core(
|
3922
|
-
settings=settings,
|
3923
|
-
printer=printer,
|
3924
|
-
)
|
3925
3828
|
Run._footer_internal_messages(
|
3926
3829
|
internal_messages_response=internal_messages_response,
|
3927
3830
|
settings=settings,
|
@@ -4068,23 +3971,6 @@ class Run:
|
|
4068
3971
|
for message in internal_messages_response.messages.warning:
|
4069
3972
|
printer.display(message, level="warn")
|
4070
3973
|
|
4071
|
-
@staticmethod
|
4072
|
-
def _footer_notify_wandb_core(
|
4073
|
-
*,
|
4074
|
-
settings: Settings,
|
4075
|
-
printer: printer.Printer,
|
4076
|
-
) -> None:
|
4077
|
-
"""Prints a message advertising the upcoming core release."""
|
4078
|
-
if settings.quiet or not settings.x_require_legacy_service:
|
4079
|
-
return
|
4080
|
-
|
4081
|
-
printer.display(
|
4082
|
-
"The legacy backend is deprecated. In future versions, `wandb-core` will become "
|
4083
|
-
"the sole backend service, and the `wandb.require('legacy-service')` flag will be removed. "
|
4084
|
-
f"For more information, visit {url_registry.url('wandb-core')}",
|
4085
|
-
level="warn",
|
4086
|
-
)
|
4087
|
-
|
4088
3974
|
|
4089
3975
|
# We define this outside of the run context to support restoring before init
|
4090
3976
|
def restore(
|