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
@@ -0,0 +1,34 @@
|
|
1
|
+
# Generated by ariadne-codegen
|
2
|
+
# Source: tools/graphql_codegen/artifacts/
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from typing import Optional
|
7
|
+
|
8
|
+
from pydantic import Field
|
9
|
+
|
10
|
+
from wandb._pydantic import GQLBase
|
11
|
+
|
12
|
+
from .fragments import RegistryCollectionsPage
|
13
|
+
|
14
|
+
|
15
|
+
class RegistryCollections(GQLBase):
|
16
|
+
organization: Optional[RegistryCollectionsOrganization]
|
17
|
+
|
18
|
+
|
19
|
+
class RegistryCollectionsOrganization(GQLBase):
|
20
|
+
org_entity: Optional[RegistryCollectionsOrganizationOrgEntity] = Field(
|
21
|
+
alias="orgEntity"
|
22
|
+
)
|
23
|
+
|
24
|
+
|
25
|
+
class RegistryCollectionsOrganizationOrgEntity(GQLBase):
|
26
|
+
name: str
|
27
|
+
artifact_collections: Optional[RegistryCollectionsPage] = Field(
|
28
|
+
alias="artifactCollections"
|
29
|
+
)
|
30
|
+
|
31
|
+
|
32
|
+
RegistryCollections.model_rebuild()
|
33
|
+
RegistryCollectionsOrganization.model_rebuild()
|
34
|
+
RegistryCollectionsOrganizationOrgEntity.model_rebuild()
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Generated by ariadne-codegen
|
2
|
+
# Source: tools/graphql_codegen/artifacts/
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from typing import Optional
|
7
|
+
|
8
|
+
from pydantic import Field
|
9
|
+
|
10
|
+
from wandb._pydantic import GQLBase
|
11
|
+
|
12
|
+
from .fragments import RegistryVersionsPage
|
13
|
+
|
14
|
+
|
15
|
+
class RegistryVersions(GQLBase):
|
16
|
+
organization: Optional[RegistryVersionsOrganization]
|
17
|
+
|
18
|
+
|
19
|
+
class RegistryVersionsOrganization(GQLBase):
|
20
|
+
org_entity: Optional[RegistryVersionsOrganizationOrgEntity] = Field(
|
21
|
+
alias="orgEntity"
|
22
|
+
)
|
23
|
+
|
24
|
+
|
25
|
+
class RegistryVersionsOrganizationOrgEntity(GQLBase):
|
26
|
+
name: str
|
27
|
+
artifact_memberships: Optional[RegistryVersionsPage] = Field(
|
28
|
+
alias="artifactMemberships"
|
29
|
+
)
|
30
|
+
|
31
|
+
|
32
|
+
RegistryVersions.model_rebuild()
|
33
|
+
RegistryVersionsOrganization.model_rebuild()
|
34
|
+
RegistryVersionsOrganizationOrgEntity.model_rebuild()
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Generated by ariadne-codegen
|
2
|
+
# Source: tools/graphql_codegen/artifacts/
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from typing import Optional
|
7
|
+
|
8
|
+
from pydantic import Field
|
9
|
+
|
10
|
+
from wandb._pydantic import GQLBase, GQLId
|
11
|
+
|
12
|
+
|
13
|
+
class UnlinkArtifact(GQLBase):
|
14
|
+
unlink_artifact: Optional[UnlinkArtifactUnlinkArtifact] = Field(
|
15
|
+
alias="unlinkArtifact"
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
class UnlinkArtifactUnlinkArtifact(GQLBase):
|
20
|
+
artifact_id: GQLId = Field(alias="artifactID")
|
21
|
+
success: bool
|
22
|
+
client_mutation_id: Optional[str] = Field(alias="clientMutationId")
|
23
|
+
|
24
|
+
|
25
|
+
UnlinkArtifact.model_rebuild()
|
@@ -1,10 +1,5 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
from textwrap import dedent
|
4
|
-
|
5
|
-
from wandb_graphql.language.printer import print_ast
|
6
|
-
|
7
|
-
from wandb.apis.public.utils import gql_compat
|
8
3
|
from wandb.sdk.internal.internal_api import Api as InternalApi
|
9
4
|
|
10
5
|
OMITTABLE_ARTIFACT_FIELDS = frozenset(
|
@@ -18,85 +13,7 @@ OMITTABLE_ARTIFACT_FIELDS = frozenset(
|
|
18
13
|
)
|
19
14
|
|
20
15
|
|
21
|
-
def omit_artifact_fields(api: InternalApi) -> set[str]:
|
16
|
+
def omit_artifact_fields(api: InternalApi | None = None) -> set[str]:
|
22
17
|
"""Return names of Artifact fields to remove from GraphQL requests (for server compatibility)."""
|
23
|
-
allowed_fields =
|
24
|
-
return set(OMITTABLE_ARTIFACT_FIELDS - allowed_fields)
|
25
|
-
|
26
|
-
|
27
|
-
def _gql_artifact_fragment(include_aliases: bool = True) -> str:
|
28
|
-
"""Return a GraphQL query fragment with all parseable Artifact attributes."""
|
29
|
-
omit_fields = omit_artifact_fields(api=InternalApi())
|
30
|
-
|
31
|
-
# Respect the `include_aliases` flag
|
32
|
-
if not include_aliases:
|
33
|
-
omit_fields.add("aliases")
|
34
|
-
|
35
|
-
artifact_fragment_str = dedent(
|
36
|
-
"""\
|
37
|
-
fragment ArtifactFragment on Artifact {
|
38
|
-
id
|
39
|
-
artifactSequence {
|
40
|
-
project {
|
41
|
-
entityName
|
42
|
-
name
|
43
|
-
}
|
44
|
-
name
|
45
|
-
}
|
46
|
-
versionIndex
|
47
|
-
artifactType {
|
48
|
-
name
|
49
|
-
}
|
50
|
-
description
|
51
|
-
metadata
|
52
|
-
ttlDurationSeconds
|
53
|
-
ttlIsInherited
|
54
|
-
aliases {
|
55
|
-
artifactCollection {
|
56
|
-
project {
|
57
|
-
entityName
|
58
|
-
name
|
59
|
-
}
|
60
|
-
name
|
61
|
-
}
|
62
|
-
alias
|
63
|
-
}
|
64
|
-
tags {
|
65
|
-
name
|
66
|
-
}
|
67
|
-
historyStep
|
68
|
-
state
|
69
|
-
currentManifest {
|
70
|
-
file {
|
71
|
-
directUrl
|
72
|
-
}
|
73
|
-
}
|
74
|
-
commitHash
|
75
|
-
fileCount
|
76
|
-
createdAt
|
77
|
-
updatedAt
|
78
|
-
}"""
|
79
|
-
)
|
80
|
-
compat_doc = gql_compat(artifact_fragment_str, omit_fields=omit_fields)
|
81
|
-
return print_ast(compat_doc)
|
82
|
-
|
83
|
-
|
84
|
-
def _gql_registry_fragment() -> str:
|
85
|
-
return """
|
86
|
-
fragment RegistryFragment on Project {
|
87
|
-
id
|
88
|
-
allowAllArtifactTypesInRegistry
|
89
|
-
artifactTypes(includeAll: true) {
|
90
|
-
edges {
|
91
|
-
node {
|
92
|
-
name
|
93
|
-
}
|
94
|
-
}
|
95
|
-
}
|
96
|
-
name
|
97
|
-
description
|
98
|
-
createdAt
|
99
|
-
updatedAt
|
100
|
-
access
|
101
|
-
}
|
102
|
-
"""
|
18
|
+
allowed_fields = (api or InternalApi()).server_artifact_introspection()
|
19
|
+
return set(OMITTABLE_ARTIFACT_FIELDS) - set(allowed_fields)
|
@@ -1,5 +1,9 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
1
3
|
import re
|
2
|
-
from
|
4
|
+
from base64 import urlsafe_b64encode
|
5
|
+
from typing import Any, Final
|
6
|
+
from zlib import crc32
|
3
7
|
|
4
8
|
from wandb.sdk.artifacts.artifact import Artifact
|
5
9
|
|
@@ -8,14 +12,21 @@ PLACEHOLDER: Final[str] = "PLACEHOLDER"
|
|
8
12
|
|
9
13
|
def sanitize_artifact_name(name: str) -> str:
|
10
14
|
"""Sanitize the string to satisfy constraints on artifact names."""
|
11
|
-
from wandb.sdk.lib.hashutil import _md5
|
12
|
-
|
13
15
|
# If the name is already sanitized, don't change it.
|
14
16
|
if (sanitized := re.sub(r"[^a-zA-Z0-9_\-.]+", "", name)) == name:
|
15
17
|
return name
|
16
18
|
|
17
|
-
# Append
|
18
|
-
|
19
|
+
# Append a short alphanumeric suffix to maintain uniqueness.
|
20
|
+
# Yes, CRC is meant for checksums and not as a general hash function, but
|
21
|
+
# a 32-bit CRC hash, encoded as (url-safe) base64, is fairly short while
|
22
|
+
# providing 4B+ possible values, which should be good enough for the corner
|
23
|
+
# case names this function is meant to address.
|
24
|
+
#
|
25
|
+
# As implemented, the final suffix should be 6 characters.
|
26
|
+
crc: int = crc32(name.encode("utf-8")) & 0xFFFFFFFF # Ensure it's unsigned
|
27
|
+
crc_bytes = crc.to_bytes(4, byteorder="big")
|
28
|
+
suffix = urlsafe_b64encode(crc_bytes).rstrip(b"=").decode("ascii")
|
29
|
+
|
19
30
|
return f"{sanitized}-{suffix}"
|
20
31
|
|
21
32
|
|
@@ -31,10 +42,10 @@ class InternalArtifact(Artifact):
|
|
31
42
|
self,
|
32
43
|
name: str,
|
33
44
|
type: str,
|
34
|
-
description:
|
35
|
-
metadata:
|
45
|
+
description: str | None = None,
|
46
|
+
metadata: dict[str, Any] | None = None,
|
36
47
|
incremental: bool = False,
|
37
|
-
use_as:
|
48
|
+
use_as: str | None = None,
|
38
49
|
) -> None:
|
39
50
|
sanitized_name = sanitize_artifact_name(name)
|
40
51
|
super().__init__(
|
@@ -12,7 +12,7 @@ from pydantic.dataclasses import dataclass as pydantic_dataclass
|
|
12
12
|
from typing_extensions import Self
|
13
13
|
|
14
14
|
from wandb._iterutils import always_list
|
15
|
-
from wandb._pydantic import gql_typename
|
15
|
+
from wandb._pydantic import from_json, gql_typename
|
16
16
|
from wandb.util import json_friendly_val
|
17
17
|
|
18
18
|
from ._generated import ArtifactPortfolioTypeFields, ArtifactSequenceTypeFields
|
@@ -207,9 +207,11 @@ def validate_metadata(metadata: dict[str, Any] | None) -> dict[str, Any]:
|
|
207
207
|
"""Validate the artifact metadata and return it as a dict."""
|
208
208
|
if metadata is None:
|
209
209
|
return {}
|
210
|
-
if
|
211
|
-
|
212
|
-
|
210
|
+
if isinstance(metadata, str):
|
211
|
+
return from_json(metadata) if metadata else {}
|
212
|
+
if isinstance(metadata, dict):
|
213
|
+
return cast(Dict[str, Any], json.loads(json.dumps(json_friendly_val(metadata))))
|
214
|
+
raise TypeError(f"metadata must be dict, not {type(metadata)}")
|
213
215
|
|
214
216
|
|
215
217
|
def validate_ttl_duration_seconds(gql_ttl_duration_seconds: int | None) -> int | None:
|
@@ -264,6 +266,14 @@ def is_artifact_registry_project(project: str) -> bool:
|
|
264
266
|
return project.startswith(REGISTRY_PREFIX)
|
265
267
|
|
266
268
|
|
269
|
+
def remove_registry_prefix(project: str) -> str:
|
270
|
+
if is_artifact_registry_project(project):
|
271
|
+
return project[len(REGISTRY_PREFIX) :]
|
272
|
+
raise ValueError(
|
273
|
+
f"Project {project!r} does not have the prefix {REGISTRY_PREFIX}. It is not a registry project"
|
274
|
+
)
|
275
|
+
|
276
|
+
|
267
277
|
@pydantic_dataclass
|
268
278
|
class ArtifactPath:
|
269
279
|
#: The collection name.
|