wandb 0.18.4__py3-none-any.whl → 0.18.6__py3-none-any.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 +2 -2
- wandb/__init__.pyi +21 -19
- wandb/agents/pyagent.py +1 -1
- wandb/apis/importers/wandb.py +1 -1
- wandb/apis/normalize.py +2 -18
- wandb/apis/public/api.py +122 -62
- wandb/apis/public/artifacts.py +8 -3
- wandb/apis/public/files.py +17 -2
- wandb/apis/public/jobs.py +2 -2
- wandb/apis/public/query_generator.py +1 -1
- wandb/apis/public/runs.py +8 -8
- wandb/apis/public/teams.py +3 -3
- wandb/apis/public/users.py +1 -1
- wandb/apis/public/utils.py +68 -0
- wandb/bin/gpu_stats +0 -0
- wandb/cli/cli.py +12 -3
- wandb/data_types.py +1 -1
- wandb/docker/__init__.py +2 -1
- wandb/docker/auth.py +2 -3
- wandb/errors/links.py +73 -0
- wandb/errors/term.py +7 -6
- wandb/filesync/step_prepare.py +1 -1
- wandb/filesync/upload_job.py +1 -1
- wandb/integration/catboost/catboost.py +2 -2
- wandb/integration/diffusers/pipeline_resolver.py +1 -1
- wandb/integration/diffusers/resolvers/multimodal.py +6 -6
- wandb/integration/diffusers/resolvers/utils.py +1 -1
- wandb/integration/fastai/__init__.py +3 -2
- wandb/integration/keras/callbacks/metrics_logger.py +1 -1
- wandb/integration/keras/callbacks/model_checkpoint.py +1 -1
- wandb/integration/keras/keras.py +1 -1
- wandb/integration/kfp/kfp_patch.py +1 -1
- wandb/integration/lightgbm/__init__.py +2 -2
- wandb/integration/magic.py +2 -2
- wandb/integration/metaflow/metaflow.py +1 -1
- wandb/integration/sacred/__init__.py +1 -1
- wandb/integration/sagemaker/auth.py +1 -1
- wandb/integration/sklearn/plot/classifier.py +7 -7
- wandb/integration/sklearn/plot/clusterer.py +3 -3
- wandb/integration/sklearn/plot/regressor.py +3 -3
- wandb/integration/sklearn/plot/shared.py +2 -2
- wandb/integration/tensorboard/log.py +2 -2
- wandb/integration/ultralytics/callback.py +2 -2
- wandb/integration/xgboost/xgboost.py +1 -1
- wandb/jupyter.py +0 -1
- wandb/plot/__init__.py +17 -8
- wandb/plot/bar.py +53 -27
- wandb/plot/confusion_matrix.py +151 -70
- wandb/plot/custom_chart.py +124 -0
- wandb/plot/histogram.py +46 -20
- wandb/plot/line.py +57 -26
- wandb/plot/line_series.py +148 -60
- wandb/plot/pr_curve.py +89 -44
- wandb/plot/roc_curve.py +82 -37
- wandb/plot/scatter.py +53 -20
- wandb/plot/viz.py +20 -102
- wandb/sdk/artifacts/artifact.py +280 -328
- wandb/sdk/artifacts/artifact_manifest.py +10 -9
- wandb/sdk/artifacts/artifact_manifest_entry.py +1 -1
- wandb/sdk/artifacts/storage_handlers/azure_handler.py +9 -4
- wandb/sdk/artifacts/storage_handlers/gcs_handler.py +1 -3
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +1 -1
- wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +2 -2
- wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -1
- wandb/sdk/backend/backend.py +0 -1
- wandb/sdk/data_types/audio.py +1 -1
- wandb/sdk/data_types/base_types/media.py +66 -5
- wandb/sdk/data_types/bokeh.py +1 -1
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -1
- wandb/sdk/data_types/helper_types/image_mask.py +2 -2
- wandb/sdk/data_types/histogram.py +1 -1
- wandb/sdk/data_types/html.py +1 -1
- wandb/sdk/data_types/image.py +1 -1
- wandb/sdk/data_types/molecule.py +3 -3
- wandb/sdk/data_types/object_3d.py +4 -4
- wandb/sdk/data_types/plotly.py +1 -1
- wandb/sdk/data_types/saved_model.py +0 -1
- wandb/sdk/data_types/table.py +7 -7
- wandb/sdk/data_types/trace_tree.py +1 -1
- wandb/sdk/data_types/video.py +4 -3
- wandb/sdk/interface/router.py +0 -2
- wandb/sdk/internal/datastore.py +1 -1
- wandb/sdk/internal/file_pusher.py +1 -1
- wandb/sdk/internal/file_stream.py +4 -4
- wandb/sdk/internal/handler.py +3 -2
- wandb/sdk/internal/internal.py +1 -1
- wandb/sdk/internal/internal_api.py +183 -64
- wandb/sdk/internal/job_builder.py +4 -3
- wandb/sdk/internal/system/assets/__init__.py +0 -2
- wandb/sdk/internal/tb_watcher.py +11 -10
- wandb/sdk/launch/_launch.py +4 -3
- wandb/sdk/launch/_launch_add.py +2 -2
- wandb/sdk/launch/builder/kaniko_builder.py +0 -1
- wandb/sdk/launch/create_job.py +1 -0
- wandb/sdk/launch/environment/local_environment.py +0 -1
- wandb/sdk/launch/errors.py +0 -6
- wandb/sdk/launch/registry/local_registry.py +0 -2
- wandb/sdk/launch/runner/abstract.py +0 -5
- wandb/sdk/launch/sweeps/__init__.py +0 -2
- wandb/sdk/launch/sweeps/scheduler.py +0 -2
- wandb/sdk/launch/sweeps/scheduler_sweep.py +0 -1
- wandb/sdk/lib/apikey.py +3 -3
- wandb/sdk/lib/file_stream_utils.py +1 -1
- wandb/sdk/lib/filesystem.py +1 -1
- wandb/sdk/lib/ipython.py +16 -9
- wandb/sdk/lib/mailbox.py +0 -4
- wandb/sdk/lib/printer.py +44 -8
- wandb/sdk/lib/retry.py +1 -1
- wandb/sdk/service/service.py +3 -3
- wandb/sdk/service/streams.py +2 -4
- wandb/sdk/wandb_init.py +20 -20
- wandb/sdk/wandb_login.py +1 -1
- wandb/sdk/wandb_require.py +1 -4
- wandb/sdk/wandb_run.py +57 -69
- wandb/sdk/wandb_settings.py +3 -4
- wandb/sdk/wandb_sync.py +2 -1
- wandb/util.py +46 -18
- wandb/wandb_agent.py +3 -3
- wandb/wandb_controller.py +2 -2
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/METADATA +1 -1
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/RECORD +124 -125
- wandb/sdk/internal/system/assets/gpu_apple.py +0 -177
- wandb/sdk/lib/_wburls_generate.py +0 -25
- wandb/sdk/lib/_wburls_generated.py +0 -22
- wandb/sdk/lib/wburls.py +0 -46
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/WHEEL +0 -0
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/entry_points.txt +0 -0
- {wandb-0.18.4.dist-info → wandb-0.18.6.dist-info}/licenses/LICENSE +0 -0
@@ -1,177 +0,0 @@
|
|
1
|
-
import json
|
2
|
-
import logging
|
3
|
-
import pathlib
|
4
|
-
import platform
|
5
|
-
import subprocess
|
6
|
-
import sys
|
7
|
-
import threading
|
8
|
-
from collections import deque
|
9
|
-
from typing import TYPE_CHECKING, List
|
10
|
-
|
11
|
-
if sys.version_info >= (3, 8):
|
12
|
-
from typing import TypedDict
|
13
|
-
else:
|
14
|
-
from typing_extensions import TypedDict
|
15
|
-
|
16
|
-
from wandb.sdk.lib import telemetry
|
17
|
-
|
18
|
-
from .aggregators import aggregate_mean
|
19
|
-
from .asset_registry import asset_registry
|
20
|
-
from .interfaces import Interface, Metric, MetricsMonitor
|
21
|
-
|
22
|
-
if TYPE_CHECKING:
|
23
|
-
from typing import Deque
|
24
|
-
|
25
|
-
from wandb.sdk.internal.settings_static import SettingsStatic
|
26
|
-
|
27
|
-
|
28
|
-
logger = logging.getLogger(__name__)
|
29
|
-
|
30
|
-
|
31
|
-
class _Stats(TypedDict):
|
32
|
-
gpu: float
|
33
|
-
memoryAllocated: float # noqa: N815
|
34
|
-
temp: float
|
35
|
-
powerWatts: float # noqa: N815
|
36
|
-
powerPercent: float # noqa: N815
|
37
|
-
# cpuWaitMs: float
|
38
|
-
|
39
|
-
|
40
|
-
def get_apple_gpu_path() -> pathlib.Path:
|
41
|
-
return (
|
42
|
-
pathlib.Path(sys.modules["wandb"].__path__[0]) / "bin" / "apple_gpu_stats"
|
43
|
-
).resolve()
|
44
|
-
|
45
|
-
|
46
|
-
class GPUAppleStats:
|
47
|
-
"""Apple GPU stats available on Arm Macs."""
|
48
|
-
|
49
|
-
name = "gpu.0.{}"
|
50
|
-
samples: "Deque[_Stats]"
|
51
|
-
|
52
|
-
# TODO: hard coded max watts as 16.5, found this number in the SMC list.
|
53
|
-
# Eventually we can have the apple_gpu_stats binary query for this.
|
54
|
-
MAX_POWER_WATTS = 16.5
|
55
|
-
|
56
|
-
def __init__(self) -> None:
|
57
|
-
self.samples = deque()
|
58
|
-
self.binary_path = get_apple_gpu_path()
|
59
|
-
|
60
|
-
def sample(self) -> None:
|
61
|
-
try:
|
62
|
-
command = [str(self.binary_path), "--json"]
|
63
|
-
output = (
|
64
|
-
subprocess.check_output(command, universal_newlines=True)
|
65
|
-
.strip()
|
66
|
-
.split("\n")
|
67
|
-
)[0]
|
68
|
-
raw_stats = json.loads(output)
|
69
|
-
|
70
|
-
temp_keys = [
|
71
|
-
"m1Gpu1",
|
72
|
-
"m1Gpu2",
|
73
|
-
"m1Gpu3",
|
74
|
-
"m1Gpu4",
|
75
|
-
"m2Gpu1",
|
76
|
-
"m2Gpu2",
|
77
|
-
"m3Gpu1",
|
78
|
-
"m3Gpu2",
|
79
|
-
"m3Gpu3",
|
80
|
-
"m3Gpu4",
|
81
|
-
"m3Gpu5",
|
82
|
-
"m3Gpu6",
|
83
|
-
"m3Gpu7",
|
84
|
-
"m3Gpu8",
|
85
|
-
]
|
86
|
-
temp, count = 0, 0
|
87
|
-
for k in temp_keys:
|
88
|
-
if raw_stats.get(k, 0) > 0:
|
89
|
-
temp += raw_stats[k]
|
90
|
-
count += 1
|
91
|
-
|
92
|
-
stats: _Stats = {
|
93
|
-
"gpu": raw_stats["utilization"],
|
94
|
-
"memoryAllocated": (
|
95
|
-
raw_stats["inUseSystemMemory"]
|
96
|
-
/ raw_stats["allocatedSystemMemory"]
|
97
|
-
* 100
|
98
|
-
),
|
99
|
-
"powerWatts": raw_stats["systemPower"],
|
100
|
-
"powerPercent": (raw_stats["systemPower"] / self.MAX_POWER_WATTS) * 100,
|
101
|
-
"temp": temp / count if count > 0 else 0,
|
102
|
-
# TODO: this stat could be useful eventually, it was consistently
|
103
|
-
# 0 in my experimentation and requires a frontend change
|
104
|
-
# so leaving it out for now.
|
105
|
-
# "cpuWaitMs": raw_stats["cpu_wait_ms"],
|
106
|
-
}
|
107
|
-
self.samples.append(stats)
|
108
|
-
|
109
|
-
except (OSError, ValueError, TypeError, subprocess.CalledProcessError) as e:
|
110
|
-
logger.exception("GPU stats error: %s", e)
|
111
|
-
|
112
|
-
def clear(self) -> None:
|
113
|
-
self.samples.clear()
|
114
|
-
|
115
|
-
def aggregate(self) -> dict:
|
116
|
-
if not self.samples:
|
117
|
-
return {}
|
118
|
-
stats = {}
|
119
|
-
for key in self.samples[0].keys():
|
120
|
-
samples = [s[key] for s in self.samples] # type: ignore
|
121
|
-
aggregate = aggregate_mean(samples)
|
122
|
-
stats[self.name.format(key)] = aggregate
|
123
|
-
return stats
|
124
|
-
|
125
|
-
|
126
|
-
@asset_registry.register
|
127
|
-
class GPUApple:
|
128
|
-
def __init__(
|
129
|
-
self,
|
130
|
-
interface: "Interface",
|
131
|
-
settings: "SettingsStatic",
|
132
|
-
shutdown_event: threading.Event,
|
133
|
-
) -> None:
|
134
|
-
self.name = self.__class__.__name__.lower()
|
135
|
-
self.metrics: List[Metric] = [
|
136
|
-
GPUAppleStats(),
|
137
|
-
]
|
138
|
-
self.metrics_monitor = MetricsMonitor(
|
139
|
-
self.name,
|
140
|
-
self.metrics,
|
141
|
-
interface,
|
142
|
-
settings,
|
143
|
-
shutdown_event,
|
144
|
-
)
|
145
|
-
telemetry_record = telemetry.TelemetryRecord()
|
146
|
-
telemetry_record.env.m1_gpu = True
|
147
|
-
interface._publish_telemetry(telemetry_record)
|
148
|
-
self.binary_path = get_apple_gpu_path()
|
149
|
-
|
150
|
-
@classmethod
|
151
|
-
def is_available(cls) -> bool:
|
152
|
-
return platform.system() == "Darwin" and platform.processor() == "arm"
|
153
|
-
|
154
|
-
def start(self) -> None:
|
155
|
-
self.metrics_monitor.start()
|
156
|
-
|
157
|
-
def finish(self) -> None:
|
158
|
-
self.metrics_monitor.finish()
|
159
|
-
|
160
|
-
def probe(self) -> dict:
|
161
|
-
try:
|
162
|
-
command = [str(self.binary_path), "--json"]
|
163
|
-
output = (
|
164
|
-
subprocess.check_output(command, universal_newlines=True)
|
165
|
-
.strip()
|
166
|
-
.split("\n")
|
167
|
-
)[0]
|
168
|
-
raw_stats = json.loads(output)
|
169
|
-
return {
|
170
|
-
self.name: {
|
171
|
-
"type": raw_stats["name"],
|
172
|
-
"vendor": raw_stats["vendor"],
|
173
|
-
}
|
174
|
-
}
|
175
|
-
except (OSError, ValueError, TypeError, subprocess.CalledProcessError) as e:
|
176
|
-
logger.exception("GPU stats error: %s", e)
|
177
|
-
return {self.name: {"type": "arm", "vendor": "Apple"}}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
from wburls import wburls # type: ignore
|
2
|
-
|
3
|
-
template = """
|
4
|
-
import sys
|
5
|
-
|
6
|
-
if sys.version_info >= (3, 8):
|
7
|
-
from typing import Literal
|
8
|
-
else:
|
9
|
-
from typing_extensions import Literal
|
10
|
-
|
11
|
-
|
12
|
-
URLS = Literal[
|
13
|
-
$literal_list
|
14
|
-
]
|
15
|
-
"""
|
16
|
-
|
17
|
-
|
18
|
-
def generate() -> None:
|
19
|
-
urls = wburls._get_urls()
|
20
|
-
literal_list = ", ".join([f"{key!r}" for key in urls])
|
21
|
-
print(template.replace("$literal_list", literal_list))
|
22
|
-
|
23
|
-
|
24
|
-
if __name__ == "__main__":
|
25
|
-
generate()
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# DO NOT EDIT -- GENERATED BY: `generate-tool.py --generate`
|
2
|
-
import sys
|
3
|
-
|
4
|
-
if sys.version_info >= (3, 8):
|
5
|
-
from typing import Literal
|
6
|
-
else:
|
7
|
-
from typing_extensions import Literal
|
8
|
-
|
9
|
-
|
10
|
-
URLS = Literal[
|
11
|
-
"cli_launch",
|
12
|
-
"doc_run",
|
13
|
-
"doc_require",
|
14
|
-
"doc_start_err",
|
15
|
-
"doc_artifacts_guide",
|
16
|
-
"upgrade_server",
|
17
|
-
"multiprocess",
|
18
|
-
"wandb_init",
|
19
|
-
"wandb_server",
|
20
|
-
"wandb_define_metric",
|
21
|
-
"wandb_core",
|
22
|
-
]
|
wandb/sdk/lib/wburls.py
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
"""Container for urls used in the wandb package.
|
2
|
-
|
3
|
-
Use this anytime a URL is displayed to the user.
|
4
|
-
|
5
|
-
Usage:
|
6
|
-
```python
|
7
|
-
from wandb.sdk.lib.wburls import wburls
|
8
|
-
|
9
|
-
print(f"This is a url {wburls.get('cli_launch')}")
|
10
|
-
```
|
11
|
-
"""
|
12
|
-
|
13
|
-
from typing import TYPE_CHECKING, Dict, Optional
|
14
|
-
|
15
|
-
if TYPE_CHECKING:
|
16
|
-
from ._wburls_generated import URLS
|
17
|
-
|
18
|
-
|
19
|
-
class WBURLs:
|
20
|
-
_urls_dict: Optional[Dict["URLS", str]]
|
21
|
-
|
22
|
-
def __init__(self) -> None:
|
23
|
-
self._urls_dict = None
|
24
|
-
|
25
|
-
def _get_urls(self) -> Dict["URLS", str]:
|
26
|
-
return dict(
|
27
|
-
cli_launch="https://wandb.me/launch",
|
28
|
-
doc_run="https://wandb.me/run",
|
29
|
-
doc_require="https://wandb.me/library-require",
|
30
|
-
doc_start_err="https://docs.wandb.ai/guides/track/tracking-faq#initstarterror-error-communicating-with-wandb-process-",
|
31
|
-
doc_artifacts_guide="https://docs.wandb.ai/guides/artifacts",
|
32
|
-
upgrade_server="https://wandb.me/server-upgrade",
|
33
|
-
multiprocess="http://wandb.me/init-multiprocess",
|
34
|
-
wandb_init="https://wandb.me/wandb-init",
|
35
|
-
wandb_server="https://wandb.me/wandb-server",
|
36
|
-
wandb_define_metric="https://wandb.me/define-metric",
|
37
|
-
wandb_core="https://wandb.me/wandb-core",
|
38
|
-
)
|
39
|
-
|
40
|
-
def get(self, s: "URLS") -> str:
|
41
|
-
if self._urls_dict is None:
|
42
|
-
self._urls_dict = self._get_urls()
|
43
|
-
return self._urls_dict[s]
|
44
|
-
|
45
|
-
|
46
|
-
wburls = WBURLs()
|
File without changes
|
File without changes
|
File without changes
|