wandb 0.19.8__py3-none-macosx_11_0_arm64.whl → 0.19.9__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 +5 -1
- wandb/__init__.pyi +12 -8
- wandb/_pydantic/__init__.py +23 -0
- wandb/_pydantic/base.py +113 -0
- wandb/_pydantic/v1_compat.py +262 -0
- wandb/apis/paginator.py +82 -38
- wandb/apis/public/api.py +10 -64
- wandb/apis/public/artifacts.py +73 -17
- wandb/apis/public/files.py +2 -2
- wandb/apis/public/projects.py +3 -2
- wandb/apis/public/reports.py +2 -2
- wandb/apis/public/runs.py +19 -11
- wandb/bin/gpu_stats +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/integration/metaflow/metaflow.py +19 -17
- wandb/integration/sacred/__init__.py +1 -1
- wandb/jupyter.py +18 -15
- wandb/proto/v3/wandb_internal_pb2.py +7 -3
- 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 +3 -3
- 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 +3 -3
- wandb/proto/v5/wandb_settings_pb2.py +2 -2
- wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
- wandb/proto/wandb_deprecated.py +2 -0
- wandb/sdk/artifacts/_graphql_fragments.py +18 -20
- wandb/sdk/artifacts/_validators.py +1 -0
- wandb/sdk/artifacts/artifact.py +70 -36
- wandb/sdk/artifacts/artifact_saver.py +16 -2
- wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +23 -2
- wandb/sdk/data_types/audio.py +1 -3
- wandb/sdk/data_types/base_types/media.py +11 -4
- wandb/sdk/data_types/image.py +44 -25
- wandb/sdk/data_types/molecule.py +1 -5
- wandb/sdk/data_types/object_3d.py +2 -1
- wandb/sdk/data_types/saved_model.py +7 -9
- wandb/sdk/data_types/video.py +1 -4
- wandb/{apis/public → sdk/internal}/_generated/__init__.py +0 -6
- wandb/sdk/internal/_generated/base.py +226 -0
- wandb/{apis/public → sdk/internal}/_generated/server_features_query.py +3 -3
- wandb/{apis/public → sdk/internal}/_generated/typing_compat.py +1 -1
- wandb/sdk/internal/internal_api.py +138 -47
- wandb/sdk/internal/sender.py +2 -0
- wandb/sdk/internal/sender_config.py +8 -11
- wandb/sdk/internal/settings_static.py +24 -2
- wandb/sdk/lib/apikey.py +15 -16
- wandb/sdk/lib/run_moment.py +4 -6
- wandb/sdk/lib/wb_logging.py +161 -0
- wandb/sdk/wandb_config.py +44 -43
- wandb/sdk/wandb_init.py +141 -79
- wandb/sdk/wandb_metadata.py +107 -91
- wandb/sdk/wandb_run.py +152 -44
- wandb/sdk/wandb_settings.py +403 -201
- wandb/sdk/wandb_setup.py +3 -1
- {wandb-0.19.8.dist-info → wandb-0.19.9.dist-info}/METADATA +3 -3
- {wandb-0.19.8.dist-info → wandb-0.19.9.dist-info}/RECORD +64 -60
- wandb/apis/public/_generated/base.py +0 -128
- /wandb/{apis/public → sdk/internal}/_generated/enums.py +0 -0
- /wandb/{apis/public → sdk/internal}/_generated/input_types.py +0 -0
- /wandb/{apis/public → sdk/internal}/_generated/operations.py +0 -0
- {wandb-0.19.8.dist-info → wandb-0.19.9.dist-info}/WHEEL +0 -0
- {wandb-0.19.8.dist-info → wandb-0.19.9.dist-info}/entry_points.txt +0 -0
- {wandb-0.19.8.dist-info → wandb-0.19.9.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_metadata.py
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
import sys
|
4
3
|
from contextlib import contextmanager
|
5
4
|
from datetime import datetime, timezone
|
6
|
-
|
5
|
+
|
6
|
+
# For backward compatibility with pydantic v1
|
7
|
+
from typing import Any, Callable, Dict, List, Optional
|
7
8
|
|
8
9
|
from google.protobuf.timestamp_pb2 import Timestamp
|
9
|
-
from pydantic import BaseModel, ConfigDict, Field
|
10
|
+
from pydantic import BaseModel, ConfigDict, Field
|
11
|
+
from typing_extensions import Self
|
10
12
|
|
13
|
+
from wandb import termwarn
|
14
|
+
from wandb._pydantic import IS_PYDANTIC_V2
|
11
15
|
from wandb.proto import wandb_internal_pb2
|
12
16
|
|
13
|
-
if
|
14
|
-
from
|
15
|
-
else:
|
16
|
-
from typing_extensions import Self
|
17
|
+
if IS_PYDANTIC_V2:
|
18
|
+
from pydantic import model_validator
|
17
19
|
|
18
20
|
|
19
21
|
class DiskInfo(BaseModel, validate_assignment=True):
|
20
|
-
total: int
|
21
|
-
used: int
|
22
|
+
total: Optional[int] = None
|
23
|
+
used: Optional[int] = None
|
22
24
|
|
23
25
|
def to_proto(self) -> wandb_internal_pb2.DiskInfo:
|
24
26
|
return wandb_internal_pb2.DiskInfo(
|
@@ -32,7 +34,7 @@ class DiskInfo(BaseModel, validate_assignment=True):
|
|
32
34
|
|
33
35
|
|
34
36
|
class MemoryInfo(BaseModel, validate_assignment=True):
|
35
|
-
total: int
|
37
|
+
total: Optional[int] = None
|
36
38
|
|
37
39
|
def to_proto(self) -> wandb_internal_pb2.MemoryInfo:
|
38
40
|
return wandb_internal_pb2.MemoryInfo(total=self.total or 0)
|
@@ -43,8 +45,8 @@ class MemoryInfo(BaseModel, validate_assignment=True):
|
|
43
45
|
|
44
46
|
|
45
47
|
class CpuInfo(BaseModel, validate_assignment=True):
|
46
|
-
count: int
|
47
|
-
count_logical: int
|
48
|
+
count: Optional[int] = None
|
49
|
+
count_logical: Optional[int] = None
|
48
50
|
|
49
51
|
def to_proto(self) -> wandb_internal_pb2.CpuInfo:
|
50
52
|
return wandb_internal_pb2.CpuInfo(
|
@@ -58,13 +60,13 @@ class CpuInfo(BaseModel, validate_assignment=True):
|
|
58
60
|
|
59
61
|
|
60
62
|
class AppleInfo(BaseModel, validate_assignment=True):
|
61
|
-
name: str
|
62
|
-
ecpu_cores: int
|
63
|
-
pcpu_cores: int
|
64
|
-
gpu_cores: int
|
65
|
-
memory_gb: int
|
66
|
-
swap_total_bytes: int
|
67
|
-
ram_total_bytes: int
|
63
|
+
name: Optional[str] = None
|
64
|
+
ecpu_cores: Optional[int] = None
|
65
|
+
pcpu_cores: Optional[int] = None
|
66
|
+
gpu_cores: Optional[int] = None
|
67
|
+
memory_gb: Optional[int] = None
|
68
|
+
swap_total_bytes: Optional[int] = None
|
69
|
+
ram_total_bytes: Optional[int] = None
|
68
70
|
|
69
71
|
def to_proto(self) -> wandb_internal_pb2.AppleInfo:
|
70
72
|
return wandb_internal_pb2.AppleInfo(
|
@@ -91,11 +93,11 @@ class AppleInfo(BaseModel, validate_assignment=True):
|
|
91
93
|
|
92
94
|
|
93
95
|
class GpuNvidiaInfo(BaseModel, validate_assignment=True):
|
94
|
-
name: str
|
95
|
-
memory_total: int
|
96
|
-
cuda_cores: int
|
97
|
-
architecture: str
|
98
|
-
uuid: str
|
96
|
+
name: Optional[str] = None
|
97
|
+
memory_total: Optional[int] = None
|
98
|
+
cuda_cores: Optional[int] = None
|
99
|
+
architecture: Optional[str] = None
|
100
|
+
uuid: Optional[str] = None
|
99
101
|
|
100
102
|
def to_proto(self) -> wandb_internal_pb2.GpuNvidiaInfo:
|
101
103
|
return wandb_internal_pb2.GpuNvidiaInfo(
|
@@ -118,19 +120,19 @@ class GpuNvidiaInfo(BaseModel, validate_assignment=True):
|
|
118
120
|
|
119
121
|
|
120
122
|
class GpuAmdInfo(BaseModel, validate_assignment=True):
|
121
|
-
id: str
|
122
|
-
unique_id: str
|
123
|
-
vbios_version: str
|
124
|
-
performance_level: str
|
125
|
-
gpu_overdrive: str
|
126
|
-
gpu_memory_overdrive: str
|
127
|
-
max_power: str
|
128
|
-
series: str
|
129
|
-
model: str
|
130
|
-
vendor: str
|
131
|
-
sku: str
|
132
|
-
sclk_range: str
|
133
|
-
mclk_range: str
|
123
|
+
id: Optional[str] = None
|
124
|
+
unique_id: Optional[str] = None
|
125
|
+
vbios_version: Optional[str] = None
|
126
|
+
performance_level: Optional[str] = None
|
127
|
+
gpu_overdrive: Optional[str] = None
|
128
|
+
gpu_memory_overdrive: Optional[str] = None
|
129
|
+
max_power: Optional[str] = None
|
130
|
+
series: Optional[str] = None
|
131
|
+
model: Optional[str] = None
|
132
|
+
vendor: Optional[str] = None
|
133
|
+
sku: Optional[str] = None
|
134
|
+
sclk_range: Optional[str] = None
|
135
|
+
mclk_range: Optional[str] = None
|
134
136
|
|
135
137
|
def to_proto(self) -> wandb_internal_pb2.GpuAmdInfo:
|
136
138
|
return wandb_internal_pb2.GpuAmdInfo(
|
@@ -169,10 +171,10 @@ class GpuAmdInfo(BaseModel, validate_assignment=True):
|
|
169
171
|
|
170
172
|
|
171
173
|
class TrainiumInfo(BaseModel, validate_assignment=True):
|
172
|
-
name: str
|
173
|
-
vendor: str
|
174
|
-
neuron_device_count: int
|
175
|
-
neuroncore_per_device_count: int
|
174
|
+
name: Optional[str] = None
|
175
|
+
vendor: Optional[str] = None
|
176
|
+
neuron_device_count: Optional[int] = None
|
177
|
+
neuroncore_per_device_count: Optional[int] = None
|
176
178
|
|
177
179
|
def to_proto(self) -> wandb_internal_pb2.TrainiumInfo:
|
178
180
|
return wandb_internal_pb2.TrainiumInfo(
|
@@ -193,10 +195,10 @@ class TrainiumInfo(BaseModel, validate_assignment=True):
|
|
193
195
|
|
194
196
|
|
195
197
|
class TPUInfo(BaseModel, validate_assignment=True):
|
196
|
-
name: str
|
197
|
-
hbm_gib: int
|
198
|
-
devices_per_chip: int
|
199
|
-
count: int
|
198
|
+
name: Optional[str] = None
|
199
|
+
hbm_gib: Optional[int] = None
|
200
|
+
devices_per_chip: Optional[int] = None
|
201
|
+
count: Optional[int] = None
|
200
202
|
|
201
203
|
def to_proto(self) -> wandb_internal_pb2.TPUInfo:
|
202
204
|
return wandb_internal_pb2.TPUInfo(
|
@@ -217,8 +219,8 @@ class TPUInfo(BaseModel, validate_assignment=True):
|
|
217
219
|
|
218
220
|
|
219
221
|
class GitRepoRecord(BaseModel, validate_assignment=True):
|
220
|
-
remote_url: str
|
221
|
-
commit: str
|
222
|
+
remote_url: Optional[str] = Field(None, alias="remote")
|
223
|
+
commit: Optional[str] = None
|
222
224
|
|
223
225
|
def to_proto(self) -> wandb_internal_pb2.GitRepoRecord:
|
224
226
|
return wandb_internal_pb2.GitRepoRecord(
|
@@ -270,128 +272,142 @@ class Metadata(BaseModel, validate_assignment=True):
|
|
270
272
|
revalidate_instances="always",
|
271
273
|
)
|
272
274
|
|
273
|
-
os: str
|
275
|
+
os: Optional[str] = None
|
274
276
|
"""Operating system."""
|
275
277
|
|
276
|
-
python: str
|
278
|
+
python: Optional[str] = None
|
277
279
|
"""Python version."""
|
278
280
|
|
279
|
-
heartbeat_at: datetime
|
281
|
+
heartbeat_at: Optional[datetime] = Field(default=None, alias="heartbeatAt")
|
280
282
|
"""Timestamp of last heartbeat."""
|
281
283
|
|
282
|
-
started_at: datetime
|
284
|
+
started_at: Optional[datetime] = Field(default=None, alias="startedAt")
|
283
285
|
"""Timestamp of run start."""
|
284
286
|
|
285
|
-
docker: str
|
287
|
+
docker: Optional[str] = None
|
286
288
|
"""Docker image."""
|
287
289
|
|
288
|
-
cuda: str
|
290
|
+
cuda: Optional[str] = None
|
289
291
|
"""CUDA version."""
|
290
292
|
|
291
|
-
args:
|
293
|
+
args: List[str] = Field(default_factory=list)
|
292
294
|
"""Command-line arguments."""
|
293
295
|
|
294
|
-
state: str
|
296
|
+
state: Optional[str] = None
|
295
297
|
"""Run state."""
|
296
298
|
|
297
|
-
program: str
|
299
|
+
program: Optional[str] = None
|
298
300
|
"""Program name."""
|
299
301
|
|
300
|
-
code_path: str
|
302
|
+
code_path: Optional[str] = Field(default=None, alias="codePath")
|
301
303
|
"""Path to code."""
|
302
304
|
|
303
|
-
git: GitRepoRecord
|
305
|
+
git: Optional[GitRepoRecord] = None
|
304
306
|
"""Git repository information."""
|
305
307
|
|
306
|
-
email: str
|
308
|
+
email: Optional[str] = None
|
307
309
|
"""Email address."""
|
308
310
|
|
309
|
-
root: str
|
311
|
+
root: Optional[str] = None
|
310
312
|
"""Root directory."""
|
311
313
|
|
312
|
-
host: str
|
314
|
+
host: Optional[str] = None
|
313
315
|
"""Host name."""
|
314
316
|
|
315
|
-
username: str
|
317
|
+
username: Optional[str] = None
|
316
318
|
"""Username."""
|
317
319
|
|
318
|
-
executable: str
|
320
|
+
executable: Optional[str] = None
|
319
321
|
"""Python executable path."""
|
320
322
|
|
321
|
-
code_path_local: str
|
323
|
+
code_path_local: Optional[str] = Field(default=None, alias="codePathLocal")
|
322
324
|
"""Local code path."""
|
323
325
|
|
324
|
-
colab: str
|
326
|
+
colab: Optional[str] = None
|
325
327
|
"""Colab URL."""
|
326
328
|
|
327
|
-
cpu_count: int
|
329
|
+
cpu_count: Optional[int] = Field(default=None, alias="cpuCount")
|
328
330
|
"""CPU count."""
|
329
331
|
|
330
|
-
cpu_count_logical: int
|
332
|
+
cpu_count_logical: Optional[int] = Field(default=None, alias="cpuCountLogical")
|
331
333
|
"""Logical CPU count."""
|
332
334
|
|
333
|
-
gpu_type: str
|
335
|
+
gpu_type: Optional[str] = Field(default=None, alias="gpuType")
|
334
336
|
"""GPU type."""
|
335
337
|
|
336
|
-
gpu_count: int
|
338
|
+
gpu_count: Optional[int] = Field(default=None, alias="gpuCount")
|
337
339
|
"""GPU count."""
|
338
340
|
|
339
|
-
disk:
|
341
|
+
disk: Dict[str, DiskInfo] = Field(default_factory=dict)
|
340
342
|
"""Disk information."""
|
341
343
|
|
342
|
-
memory: MemoryInfo
|
344
|
+
memory: Optional[MemoryInfo] = None
|
343
345
|
"""Memory information."""
|
344
346
|
|
345
|
-
cpu: CpuInfo
|
347
|
+
cpu: Optional[CpuInfo] = None
|
346
348
|
"""CPU information."""
|
347
349
|
|
348
|
-
apple: AppleInfo
|
350
|
+
apple: Optional[AppleInfo] = None
|
349
351
|
"""Apple silicon information."""
|
350
352
|
|
351
|
-
gpu_nvidia:
|
353
|
+
gpu_nvidia: List[GpuNvidiaInfo] = Field(default_factory=list, alias="gpuNvidia")
|
352
354
|
"""NVIDIA GPU information."""
|
353
355
|
|
354
|
-
gpu_amd:
|
356
|
+
gpu_amd: List[GpuAmdInfo] = Field(default_factory=list, alias="gpuAmd")
|
355
357
|
"""AMD GPU information."""
|
356
358
|
|
357
|
-
slurm:
|
359
|
+
slurm: Dict[str, str] = Field(default_factory=dict)
|
358
360
|
"""Slurm environment information."""
|
359
361
|
|
360
|
-
cuda_version: str
|
362
|
+
cuda_version: Optional[str] = Field(default=None, alias="cudaVersion")
|
361
363
|
"""CUDA version."""
|
362
364
|
|
363
|
-
trainium: TrainiumInfo
|
365
|
+
trainium: Optional[TrainiumInfo] = None
|
364
366
|
"""Trainium information."""
|
365
367
|
|
366
|
-
tpu: TPUInfo
|
368
|
+
tpu: Optional[TPUInfo] = None
|
367
369
|
"""TPU information."""
|
368
370
|
|
369
371
|
def __init__(self, **data):
|
370
372
|
super().__init__(**data)
|
371
373
|
|
374
|
+
if not IS_PYDANTIC_V2:
|
375
|
+
termwarn(
|
376
|
+
"Metadata is read-only when using pydantic v1.",
|
377
|
+
repeat=False,
|
378
|
+
)
|
379
|
+
return
|
380
|
+
|
372
381
|
# Callback for post-update. This is used in the Run object to trigger
|
373
382
|
# a metadata update after the object is modified.
|
374
|
-
self._post_update_callback: Callable
|
383
|
+
self._post_update_callback: Optional[Callable] = None # type: ignore
|
375
384
|
|
376
385
|
def _set_callback(self, callback: Callable) -> None:
|
386
|
+
if not IS_PYDANTIC_V2:
|
387
|
+
return
|
377
388
|
self._post_update_callback = callback
|
378
389
|
|
379
390
|
@contextmanager
|
380
391
|
def disable_callback(self):
|
381
392
|
"""Temporarily disable callback."""
|
382
|
-
|
383
|
-
self._post_update_callback = None
|
384
|
-
try:
|
393
|
+
if not IS_PYDANTIC_V2:
|
385
394
|
yield
|
386
|
-
|
387
|
-
self._post_update_callback
|
395
|
+
else:
|
396
|
+
original_callback = self._post_update_callback
|
397
|
+
self._post_update_callback = None
|
398
|
+
try:
|
399
|
+
yield
|
400
|
+
finally:
|
401
|
+
self._post_update_callback = original_callback
|
402
|
+
|
403
|
+
if IS_PYDANTIC_V2:
|
388
404
|
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
405
|
+
@model_validator(mode="after")
|
406
|
+
def _callback(self) -> Self:
|
407
|
+
if getattr(self, "_post_update_callback", None) is not None:
|
408
|
+
self._post_update_callback(self.to_proto()) # type: ignore
|
393
409
|
|
394
|
-
|
410
|
+
return self
|
395
411
|
|
396
412
|
@classmethod
|
397
413
|
def _datetime_to_timestamp(cls, dt: datetime | None) -> Timestamp | None:
|
@@ -513,7 +529,7 @@ class Metadata(BaseModel, validate_assignment=True):
|
|
513
529
|
proto (wandb_internal_pb2.MetadataRequest): The protobuf message.
|
514
530
|
skip_existing (bool, optional): Skip updating fields that are already set.
|
515
531
|
"""
|
516
|
-
data:
|
532
|
+
data: Dict[str, Any] = {}
|
517
533
|
|
518
534
|
# Handle all scalar fields.
|
519
535
|
if proto.os:
|