wandb 0.22.0__py3-none-macosx_12_0_x86_64.whl → 0.22.2__py3-none-macosx_12_0_x86_64.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 +1 -1
- wandb/__init__.pyi +8 -5
- wandb/_pydantic/__init__.py +12 -11
- wandb/_pydantic/base.py +49 -19
- wandb/apis/__init__.py +2 -0
- wandb/apis/attrs.py +2 -0
- wandb/apis/importers/internals/internal.py +16 -23
- wandb/apis/internal.py +2 -0
- wandb/apis/normalize.py +2 -0
- wandb/apis/public/__init__.py +3 -2
- wandb/apis/public/api.py +215 -164
- wandb/apis/public/artifacts.py +23 -20
- wandb/apis/public/const.py +2 -0
- wandb/apis/public/files.py +33 -24
- wandb/apis/public/history.py +2 -0
- wandb/apis/public/jobs.py +20 -18
- wandb/apis/public/projects.py +4 -2
- wandb/apis/public/query_generator.py +3 -0
- wandb/apis/public/registries/__init__.py +7 -0
- wandb/apis/public/registries/_freezable_list.py +9 -12
- wandb/apis/public/registries/registries_search.py +8 -6
- wandb/apis/public/registries/registry.py +22 -17
- wandb/apis/public/reports.py +2 -0
- wandb/apis/public/runs.py +261 -57
- wandb/apis/public/sweeps.py +10 -9
- wandb/apis/public/teams.py +2 -0
- wandb/apis/public/users.py +2 -0
- wandb/apis/public/utils.py +16 -15
- wandb/automations/_generated/__init__.py +54 -127
- wandb/automations/_generated/create_generic_webhook_integration.py +1 -7
- wandb/automations/_generated/fragments.py +26 -91
- wandb/bin/gpu_stats +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/beta.py +16 -2
- wandb/cli/beta_leet.py +74 -0
- wandb/cli/beta_sync.py +9 -11
- wandb/cli/cli.py +34 -7
- wandb/errors/errors.py +3 -3
- wandb/proto/v3/wandb_api_pb2.py +86 -0
- wandb/proto/v3/wandb_internal_pb2.py +352 -351
- wandb/proto/v3/wandb_settings_pb2.py +2 -2
- wandb/proto/v3/wandb_sync_pb2.py +19 -6
- wandb/proto/v4/wandb_api_pb2.py +37 -0
- wandb/proto/v4/wandb_internal_pb2.py +352 -351
- wandb/proto/v4/wandb_settings_pb2.py +2 -2
- wandb/proto/v4/wandb_sync_pb2.py +10 -6
- wandb/proto/v5/wandb_api_pb2.py +38 -0
- wandb/proto/v5/wandb_internal_pb2.py +352 -351
- wandb/proto/v5/wandb_settings_pb2.py +2 -2
- wandb/proto/v5/wandb_sync_pb2.py +10 -6
- wandb/proto/v6/wandb_api_pb2.py +48 -0
- wandb/proto/v6/wandb_internal_pb2.py +352 -351
- wandb/proto/v6/wandb_settings_pb2.py +2 -2
- wandb/proto/v6/wandb_sync_pb2.py +10 -6
- wandb/proto/wandb_api_pb2.py +18 -0
- wandb/proto/wandb_generate_proto.py +1 -0
- wandb/sdk/artifacts/_factories.py +7 -2
- wandb/sdk/artifacts/_generated/__init__.py +112 -412
- wandb/sdk/artifacts/_generated/fragments.py +65 -0
- wandb/sdk/artifacts/_generated/operations.py +52 -22
- wandb/sdk/artifacts/_generated/run_input_artifacts.py +3 -23
- wandb/sdk/artifacts/_generated/run_output_artifacts.py +3 -23
- wandb/sdk/artifacts/_generated/type_info.py +19 -0
- wandb/sdk/artifacts/_gqlutils.py +47 -0
- wandb/sdk/artifacts/_models/__init__.py +4 -0
- wandb/sdk/artifacts/_models/base_model.py +20 -0
- wandb/sdk/artifacts/_validators.py +40 -12
- wandb/sdk/artifacts/artifact.py +99 -118
- wandb/sdk/artifacts/artifact_file_cache.py +6 -1
- wandb/sdk/artifacts/artifact_manifest_entry.py +67 -14
- wandb/sdk/artifacts/storage_handler.py +18 -12
- wandb/sdk/artifacts/storage_handlers/azure_handler.py +11 -6
- wandb/sdk/artifacts/storage_handlers/gcs_handler.py +9 -6
- wandb/sdk/artifacts/storage_handlers/http_handler.py +9 -4
- wandb/sdk/artifacts/storage_handlers/local_file_handler.py +10 -6
- wandb/sdk/artifacts/storage_handlers/multi_handler.py +5 -4
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +10 -8
- wandb/sdk/artifacts/storage_handlers/tracking_handler.py +6 -4
- wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +24 -21
- wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +4 -2
- wandb/sdk/artifacts/storage_policies/_multipart.py +187 -0
- wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +71 -242
- wandb/sdk/artifacts/storage_policy.py +25 -12
- wandb/sdk/data_types/bokeh.py +5 -1
- wandb/sdk/data_types/image.py +17 -6
- wandb/sdk/data_types/object_3d.py +67 -2
- wandb/sdk/interface/interface.py +31 -4
- wandb/sdk/interface/interface_queue.py +10 -0
- wandb/sdk/interface/interface_shared.py +0 -7
- wandb/sdk/interface/interface_sock.py +9 -3
- wandb/sdk/internal/_generated/__init__.py +2 -12
- wandb/sdk/internal/job_builder.py +27 -10
- wandb/sdk/internal/sender.py +5 -2
- wandb/sdk/internal/settings_static.py +2 -82
- wandb/sdk/launch/create_job.py +2 -1
- wandb/sdk/launch/runner/kubernetes_runner.py +25 -20
- wandb/sdk/launch/utils.py +82 -1
- wandb/sdk/lib/progress.py +8 -74
- wandb/sdk/lib/service/service_client.py +5 -9
- wandb/sdk/lib/service/service_connection.py +39 -23
- wandb/sdk/mailbox/mailbox_handle.py +2 -0
- wandb/sdk/projects/_generated/__init__.py +12 -33
- wandb/sdk/wandb_init.py +23 -3
- wandb/sdk/wandb_login.py +53 -27
- wandb/sdk/wandb_run.py +10 -5
- wandb/sdk/wandb_settings.py +63 -25
- wandb/sync/sync.py +7 -2
- wandb/util.py +1 -1
- {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/METADATA +1 -1
- {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/RECORD +113 -103
- wandb/sdk/artifacts/_graphql_fragments.py +0 -19
- {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/WHEEL +0 -0
- {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/entry_points.txt +0 -0
- {wandb-0.22.0.dist-info → wandb-0.22.2.dist-info}/licenses/LICENSE +0 -0
wandb/__init__.py
CHANGED
wandb/__init__.pyi
CHANGED
@@ -107,7 +107,7 @@ if TYPE_CHECKING:
|
|
107
107
|
import wandb
|
108
108
|
from wandb.plot import CustomChart
|
109
109
|
|
110
|
-
__version__: str = "0.22.
|
110
|
+
__version__: str = "0.22.2"
|
111
111
|
|
112
112
|
run: Run | None
|
113
113
|
config: wandb_config.Config
|
@@ -388,8 +388,8 @@ def init(
|
|
388
388
|
enable on your settings page.
|
389
389
|
tensorboard: Deprecated. Use `sync_tensorboard` instead.
|
390
390
|
sync_tensorboard: Enables automatic syncing of W&B logs from TensorBoard
|
391
|
-
or TensorBoardX, saving relevant event files for viewing in
|
392
|
-
|
391
|
+
or TensorBoardX, saving relevant event files for viewing in
|
392
|
+
the W&B UI.
|
393
393
|
monitor_gym: Enables automatic logging of videos of the environment when
|
394
394
|
using OpenAI Gym.
|
395
395
|
settings: Specifies a dictionary or `wandb.Settings` object with advanced
|
@@ -754,6 +754,9 @@ def save(
|
|
754
754
|
When given an absolute path or glob and no `base_path`, one
|
755
755
|
directory level is preserved as in the example above.
|
756
756
|
|
757
|
+
Files are automatically deduplicated: calling `save()` multiple times
|
758
|
+
on the same file without modifications will not re-upload it.
|
759
|
+
|
757
760
|
Args:
|
758
761
|
glob_str: A relative or absolute path or Unix glob.
|
759
762
|
base_path: A path to use to infer a directory structure; see examples.
|
@@ -778,10 +781,10 @@ def save(
|
|
778
781
|
run.save("these/are/myfiles/*", base_path="these")
|
779
782
|
# => Saves files in an "are/myfiles/" folder in the run.
|
780
783
|
|
781
|
-
run.save("/
|
784
|
+
run.save("/Users/username/Documents/run123/*.txt")
|
782
785
|
# => Saves files in a "run123/" folder in the run. See note below.
|
783
786
|
|
784
|
-
run.save("/
|
787
|
+
run.save("/Users/username/Documents/run123/*.txt", base_path="/Users")
|
785
788
|
# => Saves files in a "username/Documents/run123/" folder in the run.
|
786
789
|
|
787
790
|
run.save("files/*/saveme.txt")
|
wandb/_pydantic/__init__.py
CHANGED
@@ -1,19 +1,9 @@
|
|
1
1
|
"""Internal utilities for working with pydantic."""
|
2
2
|
|
3
|
-
from .base import CompatBaseModel, GQLBase
|
4
|
-
from .field_types import GQLId, Typename
|
5
|
-
from .utils import IS_PYDANTIC_V2, from_json, gql_typename, pydantic_isinstance, to_json
|
6
|
-
from .v1_compat import (
|
7
|
-
AliasChoices,
|
8
|
-
computed_field,
|
9
|
-
field_validator,
|
10
|
-
model_validator,
|
11
|
-
to_camel,
|
12
|
-
)
|
13
|
-
|
14
3
|
__all__ = [
|
15
4
|
"IS_PYDANTIC_V2",
|
16
5
|
"CompatBaseModel",
|
6
|
+
"JsonableModel",
|
17
7
|
"GQLBase",
|
18
8
|
"Typename",
|
19
9
|
"GQLId",
|
@@ -27,3 +17,14 @@ __all__ = [
|
|
27
17
|
"from_json",
|
28
18
|
"gql_typename",
|
29
19
|
]
|
20
|
+
|
21
|
+
from .base import CompatBaseModel, GQLBase, JsonableModel
|
22
|
+
from .field_types import GQLId, Typename
|
23
|
+
from .utils import IS_PYDANTIC_V2, from_json, gql_typename, pydantic_isinstance, to_json
|
24
|
+
from .v1_compat import (
|
25
|
+
AliasChoices,
|
26
|
+
computed_field,
|
27
|
+
field_validator,
|
28
|
+
model_validator,
|
29
|
+
to_camel,
|
30
|
+
)
|
wandb/_pydantic/base.py
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from
|
5
|
+
from abc import ABC
|
6
|
+
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Literal
|
6
7
|
|
7
8
|
from pydantic import BaseModel, ConfigDict
|
8
9
|
from typing_extensions import TypedDict, Unpack, override
|
@@ -29,34 +30,54 @@ class ModelDumpKwargs(TypedDict, total=False):
|
|
29
30
|
serialize_as_any: bool
|
30
31
|
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
# ---------------------------------------------------------------------------
|
34
|
+
# Base models and mixin classes.
|
35
|
+
#
|
36
|
+
# Extra info is provided for devs in inline comments, NOT docstrings. This
|
37
|
+
# prevents it from showing up in generated docs for subclasses.
|
37
38
|
|
38
39
|
|
39
|
-
# v1-compatible
|
40
|
+
# FOR INTERNAL USE ONLY: v1-compatible drop-in replacement for `pydantic.BaseModel`.
|
41
|
+
# If pydantic v2 is detected, this is just `pydantic.BaseModel`.
|
42
|
+
#
|
43
|
+
# Deliberately inherits ALL default configuration from `pydantic.BaseModel`.
|
40
44
|
class CompatBaseModel(PydanticCompatMixin, BaseModel):
|
41
45
|
__doc__ = None # Prevent subclasses from inheriting the BaseModel docstring
|
42
46
|
|
43
47
|
|
44
|
-
|
45
|
-
#
|
46
|
-
|
48
|
+
class JsonableModel(CompatBaseModel, ABC):
|
49
|
+
# Base class with sensible default behavior for classes that need to convert to/from JSON.
|
50
|
+
#
|
51
|
+
# Automatically parse/serialize "raw" API data (e.g. automatically convert to/from camelCase keys):
|
52
|
+
# - `.model_{dump,dump_json}()` should return "JSON-ready" dicts or JSON strings
|
53
|
+
# - `.model_{validate,validate_json}()` should accept "JSON-ready" dicts or JSON strings
|
54
|
+
#
|
55
|
+
# Ensure round-trip serialization <-> deserialization between:
|
56
|
+
# - `model_dump()` <-> `model_validate()`
|
57
|
+
# - `model_dump_json()` <-> `model_validate_json()`
|
58
|
+
#
|
59
|
+
# These behaviors are useful for models that need to predictably handle e.g. GraphQL request/response data.
|
60
|
+
|
47
61
|
model_config = ConfigDict(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
62
|
+
# ---------------------------------------------------------------------------
|
63
|
+
# Discouraged in v2.11+, deprecated in v3. Kept here for compatibility.
|
64
|
+
populate_by_name=True,
|
65
|
+
# ---------------------------------------------------------------------------
|
66
|
+
# Introduced in v2.11, ignored in earlier versions
|
67
|
+
validate_by_name=True,
|
68
|
+
validate_by_alias=True,
|
69
|
+
serialize_by_alias=True,
|
70
|
+
# ---------------------------------------------------------------------------
|
52
71
|
validate_assignment=True,
|
53
|
-
validate_default=True,
|
54
72
|
use_attribute_docstrings=True,
|
55
73
|
from_attributes=True,
|
56
|
-
revalidate_instances="always",
|
57
|
-
protected_namespaces=(), # Some GraphQL fields may begin with "model_"
|
58
74
|
)
|
59
75
|
|
76
|
+
# Custom defaults keyword args for `JsonableModel.model_{dump,dump_json}`:
|
77
|
+
# - by_alias: Convert keys to JSON-ready names and objects to JSON-ready dicts.
|
78
|
+
# - round_trip: Ensure round-trippable result
|
79
|
+
__DUMP_DEFAULTS: ClassVar[ModelDumpKwargs] = dict(by_alias=True, round_trip=True)
|
80
|
+
|
60
81
|
@override
|
61
82
|
def model_dump(
|
62
83
|
self,
|
@@ -64,7 +85,7 @@ class GQLBase(CompatBaseModel):
|
|
64
85
|
mode: Literal["json", "python"] | str = "json", # NOTE: changed default
|
65
86
|
**kwargs: Unpack[ModelDumpKwargs],
|
66
87
|
) -> dict[str, Any]:
|
67
|
-
kwargs = {**
|
88
|
+
kwargs = {**self.__DUMP_DEFAULTS, **kwargs} # allows overrides, if needed
|
68
89
|
return super().model_dump(mode=mode, **kwargs)
|
69
90
|
|
70
91
|
@override
|
@@ -74,5 +95,14 @@ class GQLBase(CompatBaseModel):
|
|
74
95
|
indent: int | None = None,
|
75
96
|
**kwargs: Unpack[ModelDumpKwargs],
|
76
97
|
) -> str:
|
77
|
-
kwargs = {**
|
98
|
+
kwargs = {**self.__DUMP_DEFAULTS, **kwargs} # allows overrides, if needed
|
78
99
|
return super().model_dump_json(indent=indent, **kwargs)
|
100
|
+
|
101
|
+
|
102
|
+
# Base class for all GraphQL-generated types.
|
103
|
+
class GQLBase(JsonableModel, ABC):
|
104
|
+
model_config = ConfigDict(
|
105
|
+
validate_default=True,
|
106
|
+
revalidate_instances="always",
|
107
|
+
protected_namespaces=(), # Some GraphQL fields may begin with "model_"
|
108
|
+
)
|
wandb/apis/__init__.py
CHANGED
wandb/apis/attrs.py
CHANGED
@@ -8,12 +8,10 @@ from pathlib import Path
|
|
8
8
|
from typing import Any, Dict, Iterable, Optional
|
9
9
|
|
10
10
|
import numpy as np
|
11
|
-
from google.protobuf.json_format import ParseDict
|
12
11
|
from tenacity import retry, stop_after_attempt, wait_random_exponential
|
13
12
|
|
14
13
|
from wandb import Artifact
|
15
14
|
from wandb.proto import wandb_internal_pb2 as pb
|
16
|
-
from wandb.proto import wandb_settings_pb2
|
17
15
|
from wandb.proto import wandb_telemetry_pb2 as telem_pb
|
18
16
|
from wandb.sdk.interface.interface import file_policy_to_enum
|
19
17
|
from wandb.sdk.interface.interface_queue import InterfaceQueue
|
@@ -310,27 +308,22 @@ def _make_settings(
|
|
310
308
|
) -> SettingsStatic:
|
311
309
|
_settings_override = coalesce(settings_override, {})
|
312
310
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
combined_settings = {**default_settings, **_settings_override}
|
330
|
-
settings_message = wandb_settings_pb2.Settings()
|
331
|
-
ParseDict(combined_settings, settings_message)
|
332
|
-
|
333
|
-
return SettingsStatic(settings_message)
|
311
|
+
return SettingsStatic(
|
312
|
+
{
|
313
|
+
"x_files_dir": os.path.join(root_dir, "files"),
|
314
|
+
"root_dir": root_dir,
|
315
|
+
"resume": "never",
|
316
|
+
"program": None,
|
317
|
+
"ignore_globs": [],
|
318
|
+
"disable_job_creation": True,
|
319
|
+
"x_start_time": 0,
|
320
|
+
"x_sync": True,
|
321
|
+
"x_live_policy_rate_limit": 15, # matches dir_watcher
|
322
|
+
"x_live_policy_wait_time": 600, # matches dir_watcher
|
323
|
+
"x_file_stream_timeout_seconds": 60,
|
324
|
+
**_settings_override,
|
325
|
+
}
|
326
|
+
)
|
334
327
|
|
335
328
|
|
336
329
|
def send_run(
|
wandb/apis/internal.py
CHANGED
wandb/apis/normalize.py
CHANGED
wandb/apis/public/__init__.py
CHANGED
@@ -10,7 +10,7 @@ __all__ = (
|
|
10
10
|
"ArtifactTypes",
|
11
11
|
"RunArtifacts",
|
12
12
|
"Automations",
|
13
|
-
"File",
|
13
|
+
"File",
|
14
14
|
"Files",
|
15
15
|
"HistoryScan", # doc:exclude
|
16
16
|
"SampledHistoryScan", # doc:exclude
|
@@ -27,6 +27,7 @@ __all__ = (
|
|
27
27
|
"Sweeps",
|
28
28
|
"QueryGenerator", # doc:exclude
|
29
29
|
"Registry",
|
30
|
+
"Registries", # doc:exclude
|
30
31
|
"BetaReport",
|
31
32
|
"PanelMetricsHelper", # doc:exclude
|
32
33
|
"PythonMongoishQueryGenerator", # doc:exclude
|
@@ -64,7 +65,7 @@ from wandb.apis.public.jobs import (
|
|
64
65
|
)
|
65
66
|
from wandb.apis.public.projects import PROJECT_FRAGMENT, Project, Projects, Sweeps
|
66
67
|
from wandb.apis.public.query_generator import QueryGenerator
|
67
|
-
from wandb.apis.public.registries
|
68
|
+
from wandb.apis.public.registries import Registries, Registry
|
68
69
|
from wandb.apis.public.reports import (
|
69
70
|
BetaReport,
|
70
71
|
PanelMetricsHelper,
|