wandb 0.19.1rc1__py3-none-win32.whl → 0.19.3__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 +1 -7
- wandb/__init__.pyi +15 -7
- wandb/agents/pyagent.py +1 -1
- wandb/apis/importers/wandb.py +1 -1
- wandb/apis/public/files.py +1 -1
- wandb/apis/public/jobs.py +1 -1
- wandb/apis/public/runs.py +2 -7
- wandb/apis/reports/v1/__init__.py +1 -1
- wandb/apis/reports/v2/__init__.py +1 -1
- wandb/apis/workspaces/__init__.py +1 -1
- wandb/bin/gpu_stats.exe +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/beta.py +7 -4
- wandb/cli/cli.py +5 -7
- wandb/docker/__init__.py +4 -4
- wandb/integration/fastai/__init__.py +4 -6
- wandb/integration/keras/keras.py +5 -3
- wandb/integration/metaflow/metaflow.py +14 -16
- wandb/integration/prodigy/prodigy.py +3 -11
- wandb/integration/sagemaker/__init__.py +5 -3
- wandb/integration/sagemaker/config.py +17 -8
- wandb/integration/sagemaker/files.py +0 -1
- wandb/integration/sagemaker/resources.py +47 -18
- wandb/integration/torch/wandb_torch.py +1 -1
- wandb/proto/v3/wandb_internal_pb2.py +273 -235
- wandb/proto/v4/wandb_internal_pb2.py +222 -214
- wandb/proto/v5/wandb_internal_pb2.py +222 -214
- wandb/sdk/artifacts/artifact.py +3 -9
- wandb/sdk/backend/backend.py +1 -1
- wandb/sdk/data_types/base_types/wb_value.py +1 -1
- wandb/sdk/data_types/graph.py +2 -2
- wandb/sdk/data_types/saved_model.py +1 -1
- wandb/sdk/data_types/video.py +1 -1
- wandb/sdk/interface/interface.py +25 -25
- wandb/sdk/interface/interface_shared.py +21 -5
- wandb/sdk/internal/handler.py +19 -1
- wandb/sdk/internal/internal.py +1 -1
- wandb/sdk/internal/internal_api.py +4 -5
- wandb/sdk/internal/sample.py +2 -2
- wandb/sdk/internal/sender.py +1 -2
- wandb/sdk/internal/settings_static.py +3 -1
- wandb/sdk/internal/system/assets/disk.py +4 -4
- wandb/sdk/internal/system/assets/gpu.py +1 -1
- wandb/sdk/internal/system/assets/memory.py +1 -1
- wandb/sdk/internal/system/system_info.py +1 -1
- wandb/sdk/internal/system/system_monitor.py +3 -1
- wandb/sdk/internal/tb_watcher.py +1 -1
- wandb/sdk/launch/_project_spec.py +3 -3
- wandb/sdk/launch/builder/abstract.py +1 -1
- wandb/sdk/lib/apikey.py +2 -3
- wandb/sdk/lib/fsm.py +1 -1
- wandb/sdk/lib/gitlib.py +1 -1
- wandb/sdk/lib/gql_request.py +1 -1
- wandb/sdk/lib/interrupt.py +37 -0
- wandb/sdk/lib/lazyloader.py +1 -1
- wandb/sdk/lib/progress.py +7 -1
- wandb/sdk/lib/service_connection.py +1 -1
- wandb/sdk/lib/telemetry.py +1 -1
- wandb/sdk/service/_startup_debug.py +1 -1
- wandb/sdk/service/server_sock.py +3 -2
- wandb/sdk/service/service.py +1 -1
- wandb/sdk/service/streams.py +19 -17
- wandb/sdk/verify/verify.py +13 -13
- wandb/sdk/wandb_init.py +316 -246
- wandb/sdk/wandb_login.py +1 -1
- wandb/sdk/wandb_metadata.py +547 -0
- wandb/sdk/wandb_run.py +134 -39
- wandb/sdk/wandb_settings.py +7 -63
- wandb/sdk/wandb_setup.py +83 -82
- wandb/sdk/wandb_sweep.py +2 -2
- wandb/sdk/wandb_sync.py +15 -18
- wandb/sync/sync.py +10 -10
- wandb/util.py +11 -3
- wandb/wandb_agent.py +11 -16
- wandb/wandb_controller.py +7 -7
- {wandb-0.19.1rc1.dist-info → wandb-0.19.3.dist-info}/METADATA +3 -2
- {wandb-0.19.1rc1.dist-info → wandb-0.19.3.dist-info}/RECORD +80 -78
- {wandb-0.19.1rc1.dist-info → wandb-0.19.3.dist-info}/WHEEL +0 -0
- {wandb-0.19.1rc1.dist-info → wandb-0.19.3.dist-info}/entry_points.txt +0 -0
- {wandb-0.19.1rc1.dist-info → wandb-0.19.3.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_setup.py
CHANGED
@@ -20,6 +20,7 @@ import threading
|
|
20
20
|
from typing import TYPE_CHECKING, Any, Union
|
21
21
|
|
22
22
|
import wandb
|
23
|
+
import wandb.integration.sagemaker as sagemaker
|
23
24
|
from wandb.sdk.lib import import_hooks
|
24
25
|
|
25
26
|
from . import wandb_settings
|
@@ -61,29 +62,19 @@ class _EarlyLogger:
|
|
61
62
|
def log(self, level: str, msg: str, *args: Any, **kwargs: Any) -> None:
|
62
63
|
self._log.append((level, msg, args, kwargs))
|
63
64
|
|
64
|
-
def _flush(self) -> None:
|
65
|
-
assert self is not
|
66
|
-
assert logger is not None
|
65
|
+
def _flush(self, new_logger: Logger) -> None:
|
66
|
+
assert self is not new_logger
|
67
67
|
for level, msg, args, kwargs in self._log:
|
68
|
-
|
68
|
+
new_logger.log(level, msg, *args, **kwargs)
|
69
69
|
for msg, args, kwargs in self._exception:
|
70
|
-
|
70
|
+
new_logger.exception(msg, *args, **kwargs)
|
71
71
|
|
72
72
|
|
73
73
|
Logger = Union[logging.Logger, _EarlyLogger]
|
74
74
|
|
75
|
-
# logger will be configured to be either a standard logger instance or _EarlyLogger
|
76
|
-
logger: Logger | None = None
|
77
75
|
|
78
|
-
|
79
|
-
|
80
|
-
"""Configure module logger."""
|
81
|
-
global logger
|
82
|
-
logger = log_object
|
83
|
-
|
84
|
-
|
85
|
-
class _WandbSetup__WandbSetup: # noqa: N801
|
86
|
-
"""Inner class of _WandbSetup."""
|
76
|
+
class _WandbSetup:
|
77
|
+
"""W&B library singleton."""
|
87
78
|
|
88
79
|
def __init__(
|
89
80
|
self,
|
@@ -104,48 +95,52 @@ class _WandbSetup__WandbSetup: # noqa: N801
|
|
104
95
|
|
105
96
|
# TODO(jhr): defer strict checks until settings are fully initialized
|
106
97
|
# and logging is ready
|
107
|
-
self.
|
108
|
-
_set_logger(self._early_logger)
|
98
|
+
self._logger: Logger = _EarlyLogger()
|
109
99
|
|
110
|
-
self._settings = self._settings_setup(settings
|
100
|
+
self._settings = self._settings_setup(settings)
|
111
101
|
|
112
|
-
wandb.termsetup(self._settings,
|
102
|
+
wandb.termsetup(self._settings, None)
|
113
103
|
|
114
104
|
self._check()
|
115
105
|
self._setup()
|
116
106
|
|
117
107
|
def _settings_setup(
|
118
108
|
self,
|
119
|
-
settings: Settings | None
|
120
|
-
early_logger: _EarlyLogger | None = None,
|
109
|
+
settings: Settings | None,
|
121
110
|
) -> wandb_settings.Settings:
|
122
111
|
s = wandb_settings.Settings()
|
123
112
|
|
124
113
|
# the pid of the process to monitor for system stats
|
125
114
|
pid = os.getpid()
|
126
|
-
|
127
|
-
|
128
|
-
early_logger.info(f"Configure stats pid to {pid}")
|
115
|
+
self._logger.info(f"Current SDK version is {wandb.__version__}")
|
116
|
+
self._logger.info(f"Configure stats pid to {pid}")
|
129
117
|
s.x_stats_pid = pid
|
130
118
|
|
131
119
|
# load settings from the system config
|
132
|
-
if s.settings_system
|
133
|
-
|
120
|
+
if s.settings_system:
|
121
|
+
self._logger.info(f"Loading settings from {s.settings_system}")
|
134
122
|
s.update_from_system_config_file()
|
135
123
|
|
136
124
|
# load settings from the workspace config
|
137
|
-
if s.settings_workspace
|
138
|
-
|
125
|
+
if s.settings_workspace:
|
126
|
+
self._logger.info(f"Loading settings from {s.settings_workspace}")
|
139
127
|
s.update_from_workspace_config_file()
|
140
128
|
|
141
129
|
# load settings from the environment variables
|
142
|
-
|
143
|
-
early_logger.info("Loading settings from environment variables")
|
130
|
+
self._logger.info("Loading settings from environment variables")
|
144
131
|
s.update_from_env_vars(self._environ)
|
145
132
|
|
146
133
|
# infer settings from the system environment
|
147
134
|
s.update_from_system_environment()
|
148
135
|
|
136
|
+
# load SageMaker settings
|
137
|
+
check_sagemaker_env = not s.sagemaker_disable
|
138
|
+
if settings and settings.sagemaker_disable:
|
139
|
+
check_sagemaker_env = False
|
140
|
+
if check_sagemaker_env and sagemaker.is_using_sagemaker():
|
141
|
+
self._logger.info("Loading SageMaker settings")
|
142
|
+
sagemaker.set_global_settings(s)
|
143
|
+
|
149
144
|
# load settings from the passed init/setup settings
|
150
145
|
if settings:
|
151
146
|
s.update_from_settings(settings)
|
@@ -165,13 +160,15 @@ class _WandbSetup__WandbSetup: # noqa: N801
|
|
165
160
|
self._settings.update_from_dict(user_settings)
|
166
161
|
|
167
162
|
def _early_logger_flush(self, new_logger: Logger) -> None:
|
168
|
-
if
|
163
|
+
if self._logger is new_logger:
|
169
164
|
return
|
170
|
-
_set_logger(new_logger)
|
171
|
-
self._early_logger._flush()
|
172
165
|
|
173
|
-
|
174
|
-
|
166
|
+
if isinstance(self._logger, _EarlyLogger):
|
167
|
+
self._logger._flush(new_logger)
|
168
|
+
self._logger = new_logger
|
169
|
+
|
170
|
+
def _get_logger(self) -> Logger:
|
171
|
+
return self._logger
|
175
172
|
|
176
173
|
@property
|
177
174
|
def settings(self) -> wandb_settings.Settings:
|
@@ -236,16 +233,11 @@ class _WandbSetup__WandbSetup: # noqa: N801
|
|
236
233
|
if threading.current_thread() is not threading.main_thread():
|
237
234
|
pass
|
238
235
|
elif threading.current_thread().name != "MainThread":
|
239
|
-
|
236
|
+
wandb.termwarn(f"bad thread2: {threading.current_thread().name}")
|
240
237
|
if getattr(sys, "frozen", False):
|
241
|
-
|
238
|
+
wandb.termwarn("frozen, could be trouble")
|
242
239
|
|
243
240
|
def _setup(self) -> None:
|
244
|
-
if not self._settings._noop and not self._settings.x_disable_service:
|
245
|
-
from wandb.sdk.lib import service_connection
|
246
|
-
|
247
|
-
self._connection = service_connection.connect_to_service(self._settings)
|
248
|
-
|
249
241
|
sweep_path = self._settings.sweep_param_path
|
250
242
|
if sweep_path:
|
251
243
|
self._sweep_config = config_util.dict_from_config_file(
|
@@ -278,53 +270,61 @@ class _WandbSetup__WandbSetup: # noqa: N801
|
|
278
270
|
if internal_exit_code != 0:
|
279
271
|
sys.exit(internal_exit_code)
|
280
272
|
|
281
|
-
|
282
|
-
|
283
|
-
|
273
|
+
def ensure_service(self) -> ServiceConnection:
|
274
|
+
"""Returns a connection to the service process creating it if needed."""
|
275
|
+
if self._connection:
|
276
|
+
return self._connection
|
277
|
+
|
278
|
+
from wandb.sdk.lib import service_connection
|
279
|
+
|
280
|
+
self._connection = service_connection.connect_to_service(self._settings)
|
284
281
|
return self._connection
|
285
282
|
|
283
|
+
def assert_service(self) -> ServiceConnection:
|
284
|
+
"""Returns a connection to the service process, asserting it exists.
|
286
285
|
|
287
|
-
|
288
|
-
|
286
|
+
Unlike ensure_service(), this will not start up a service process
|
287
|
+
if it didn't already exist.
|
288
|
+
"""
|
289
|
+
if not self._connection:
|
290
|
+
raise AssertionError("Expected service process to exist.")
|
289
291
|
|
290
|
-
|
291
|
-
(Forked processes will get a new copy of the object)
|
292
|
-
"""
|
292
|
+
return self._connection
|
293
293
|
|
294
|
-
_instance: _WandbSetup__WandbSetup | None = None
|
295
294
|
|
296
|
-
|
297
|
-
|
298
|
-
if _WandbSetup._instance and _WandbSetup._instance._pid == pid:
|
299
|
-
_WandbSetup._instance._update(settings=settings)
|
300
|
-
return
|
301
|
-
_WandbSetup._instance = _WandbSetup__WandbSetup(settings=settings, pid=pid)
|
295
|
+
_singleton: _WandbSetup | None = None
|
296
|
+
"""The W&B library singleton, or None if not yet set up.
|
302
297
|
|
303
|
-
|
304
|
-
|
305
|
-
"""Returns a connection to the service process, if it exists."""
|
306
|
-
if not self._instance:
|
307
|
-
return None
|
308
|
-
return self._instance.service
|
298
|
+
The value is invalid and must not be used if `os.getpid() != _singleton._pid`.
|
299
|
+
"""
|
309
300
|
|
310
|
-
def __getattr__(self, name: str) -> Any:
|
311
|
-
return getattr(self._instance, name)
|
312
301
|
|
302
|
+
def singleton() -> _WandbSetup | None:
|
303
|
+
"""Returns the W&B singleton if it exists for the current process.
|
313
304
|
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
if _reset:
|
320
|
-
teardown()
|
305
|
+
Unlike setup(), this does not create the singleton if it doesn't exist.
|
306
|
+
"""
|
307
|
+
if _singleton and _singleton._pid == os.getpid():
|
308
|
+
return _singleton
|
309
|
+
else:
|
321
310
|
return None
|
322
311
|
|
323
|
-
wl = _WandbSetup(settings=settings)
|
324
|
-
return wl
|
325
312
|
|
313
|
+
def _setup(settings: Settings | None = None) -> _WandbSetup:
|
314
|
+
"""Set up library context."""
|
315
|
+
global _singleton
|
316
|
+
|
317
|
+
pid = os.getpid()
|
326
318
|
|
327
|
-
|
319
|
+
if _singleton and _singleton._pid == pid:
|
320
|
+
_singleton._update(settings=settings)
|
321
|
+
return _singleton
|
322
|
+
else:
|
323
|
+
_singleton = _WandbSetup(settings=settings, pid=pid)
|
324
|
+
return _singleton
|
325
|
+
|
326
|
+
|
327
|
+
def setup(settings: Settings | None = None) -> _WandbSetup:
|
328
328
|
"""Prepares W&B for use in the current process and its children.
|
329
329
|
|
330
330
|
You can usually ignore this as it is implicitly called by `wandb.init()`.
|
@@ -380,8 +380,7 @@ def setup(settings: Settings | None = None) -> _WandbSetup | None:
|
|
380
380
|
wandb.teardown()
|
381
381
|
```
|
382
382
|
"""
|
383
|
-
|
384
|
-
return ret
|
383
|
+
return _setup(settings=settings)
|
385
384
|
|
386
385
|
|
387
386
|
def teardown(exit_code: int | None = None) -> None:
|
@@ -395,8 +394,10 @@ def teardown(exit_code: int | None = None) -> None:
|
|
395
394
|
in an `atexit` hook, but this is not reliable in certain setups
|
396
395
|
such as when using Python's `multiprocessing` module.
|
397
396
|
"""
|
398
|
-
|
399
|
-
|
397
|
+
global _singleton
|
398
|
+
|
399
|
+
orig_singleton = _singleton
|
400
|
+
_singleton = None
|
400
401
|
|
401
|
-
if
|
402
|
-
|
402
|
+
if orig_singleton:
|
403
|
+
orig_singleton._teardown(exit_code=exit_code)
|
wandb/sdk/wandb_sweep.py
CHANGED
@@ -85,10 +85,10 @@ def sweep(
|
|
85
85
|
api = InternalApi()
|
86
86
|
sweep_id, warnings = api.upsert_sweep(sweep, prior_runs=prior_runs)
|
87
87
|
handle_sweep_config_violations(warnings)
|
88
|
-
print("Create sweep with ID:", sweep_id)
|
88
|
+
print("Create sweep with ID:", sweep_id) # noqa: T201
|
89
89
|
sweep_url = _get_sweep_url(api, sweep_id)
|
90
90
|
if sweep_url:
|
91
|
-
print("Sweep URL:", sweep_url)
|
91
|
+
print("Sweep URL:", sweep_url) # noqa: T201
|
92
92
|
return sweep_id
|
93
93
|
|
94
94
|
|
wandb/sdk/wandb_sync.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import pathlib
|
2
2
|
from typing import TYPE_CHECKING, Optional
|
3
3
|
|
4
|
+
from wandb import util
|
4
5
|
from wandb.errors.term import termerror, termlog
|
5
6
|
|
6
7
|
from . import wandb_setup
|
@@ -21,26 +22,31 @@ def _sync(
|
|
21
22
|
append: Optional[bool] = None,
|
22
23
|
skip_console: Optional[bool] = None,
|
23
24
|
) -> "wandb_internal_pb2.SyncResponse":
|
24
|
-
p = pathlib.Path(path)
|
25
|
-
|
26
25
|
wl = wandb_setup.setup()
|
27
26
|
assert wl is not None
|
28
27
|
|
29
28
|
stream_id = generate_id()
|
30
29
|
|
31
30
|
settings = wl.settings.to_proto()
|
31
|
+
p = pathlib.Path(path)
|
32
|
+
|
32
33
|
# update sync_file setting to point to the passed path
|
33
34
|
settings.sync_file.value = str(p.absolute())
|
34
35
|
settings.sync_dir.value = str(p.parent.absolute())
|
35
36
|
settings.files_dir.value = str(p.parent.absolute() / "files")
|
36
|
-
settings.
|
37
|
-
|
37
|
+
settings.x_sync.value = True
|
38
|
+
if run_id:
|
39
|
+
settings.run_id.value = run_id
|
40
|
+
if entity:
|
41
|
+
settings.entity.value = entity
|
42
|
+
if project:
|
43
|
+
settings.project.value = project
|
44
|
+
if skip_console:
|
45
|
+
settings.console.value = "off"
|
38
46
|
if append:
|
39
47
|
settings.resume.value = "allow"
|
40
48
|
|
41
|
-
service = wl.
|
42
|
-
assert service
|
43
|
-
|
49
|
+
service = wl.ensure_service()
|
44
50
|
service.inform_init(settings=settings, run_id=stream_id)
|
45
51
|
|
46
52
|
mailbox = Mailbox()
|
@@ -55,21 +61,12 @@ def _sync(
|
|
55
61
|
backend.interface._stream_id = stream_id # type: ignore
|
56
62
|
|
57
63
|
mailbox.enable_keepalive()
|
58
|
-
|
59
|
-
# TODO: let's add extra sync messages here so we get the url in the beginning
|
60
|
-
handle = backend.interface.deliver_sync(
|
61
|
-
start_offset=0,
|
62
|
-
final_offset=-1,
|
63
|
-
entity=entity,
|
64
|
-
project=project,
|
65
|
-
run_id=run_id,
|
66
|
-
skip_output_raw=skip_console,
|
67
|
-
)
|
64
|
+
handle = backend.interface.deliver_finish_sync()
|
68
65
|
result = handle.wait(timeout=-1)
|
69
66
|
assert result and result.response
|
70
67
|
response = result.response.sync_response
|
71
68
|
if response.url:
|
72
|
-
termlog(f"Synced {p} to {response.url}")
|
69
|
+
termlog(f"Synced {p} to {util.app_url(response.url)}")
|
73
70
|
# create a .synced file in the directory if mark_synced is true
|
74
71
|
if mark_synced:
|
75
72
|
with open(f"{p}.synced", "w"):
|
wandb/sync/sync.py
CHANGED
@@ -81,9 +81,9 @@ class SyncThread(threading.Thread):
|
|
81
81
|
record_type = pb.WhichOneof("record_type")
|
82
82
|
if self._view:
|
83
83
|
if self._verbose:
|
84
|
-
print("Record:", pb)
|
84
|
+
print("Record:", pb) # noqa: T201
|
85
85
|
else:
|
86
|
-
print("Record:", record_type)
|
86
|
+
print("Record:", record_type) # noqa: T201
|
87
87
|
return pb, exit_pb, True
|
88
88
|
if record_type == "run":
|
89
89
|
if self._run_id:
|
@@ -137,7 +137,7 @@ class SyncThread(threading.Thread):
|
|
137
137
|
if tb_event_files > 0 and sync_item.endswith(WANDB_SUFFIX):
|
138
138
|
wandb.termwarn("Found .wandb file, not streaming tensorboard metrics.")
|
139
139
|
else:
|
140
|
-
print(f"Found {tb_event_files} tfevent files in {tb_root}")
|
140
|
+
print(f"Found {tb_event_files} tfevent files in {tb_root}") # noqa: T201
|
141
141
|
if len(tb_logdirs) > 3:
|
142
142
|
wandb.termwarn(
|
143
143
|
f"Found {len(tb_logdirs)} directories containing tfevent files. "
|
@@ -163,7 +163,7 @@ class SyncThread(threading.Thread):
|
|
163
163
|
url_quote(proto_run.project),
|
164
164
|
url_quote(proto_run.run_id),
|
165
165
|
)
|
166
|
-
print("Syncing: {} ...".format(url))
|
166
|
+
print("Syncing: {} ...".format(url)) # noqa: T201
|
167
167
|
sys.stdout.flush()
|
168
168
|
# using a handler here automatically handles the step
|
169
169
|
# logic, adds summaries to the run, and handles different
|
@@ -245,7 +245,7 @@ class SyncThread(threading.Thread):
|
|
245
245
|
|
246
246
|
def run(self):
|
247
247
|
if self._log_path is not None:
|
248
|
-
print(f"Find logs at: {self._log_path}")
|
248
|
+
print(f"Find logs at: {self._log_path}") # noqa: T201
|
249
249
|
for sync_item in self._sync_list:
|
250
250
|
tb_event_files, tb_logdirs, tb_root = self._find_tfevent_files(sync_item)
|
251
251
|
if os.path.isdir(sync_item):
|
@@ -254,7 +254,7 @@ class SyncThread(threading.Thread):
|
|
254
254
|
if tb_root is None and (
|
255
255
|
check_and_warn_old(files) or len(filtered_files) != 1
|
256
256
|
):
|
257
|
-
print(f"Skipping directory: {sync_item}")
|
257
|
+
print(f"Skipping directory: {sync_item}") # noqa: T201
|
258
258
|
continue
|
259
259
|
if len(filtered_files) > 0:
|
260
260
|
sync_item = os.path.join(sync_item, filtered_files[0])
|
@@ -265,7 +265,7 @@ class SyncThread(threading.Thread):
|
|
265
265
|
root_dir = self._tmp_dir.name if sync_tb else os.path.dirname(sync_item)
|
266
266
|
|
267
267
|
# When appending we are allowing a possible resume, ie the run
|
268
|
-
#
|
268
|
+
# does not have to exist already
|
269
269
|
resume = "allow" if self._append else None
|
270
270
|
|
271
271
|
sm = sender.SendManager.setup(root_dir, resume=resume)
|
@@ -277,7 +277,7 @@ class SyncThread(threading.Thread):
|
|
277
277
|
try:
|
278
278
|
ds.open_for_scan(sync_item)
|
279
279
|
except AssertionError as e:
|
280
|
-
print(f".wandb file is empty ({e}), skipping: {sync_item}")
|
280
|
+
print(f".wandb file is empty ({e}), skipping: {sync_item}") # noqa: T201
|
281
281
|
continue
|
282
282
|
|
283
283
|
# save exit for final send
|
@@ -311,7 +311,7 @@ class SyncThread(threading.Thread):
|
|
311
311
|
url_quote(r.project),
|
312
312
|
url_quote(r.run_id),
|
313
313
|
)
|
314
|
-
print("Syncing: {} ... ".format(url), end="")
|
314
|
+
print("Syncing: {} ... ".format(url), end="") # noqa: T201
|
315
315
|
sys.stdout.flush()
|
316
316
|
shown = True
|
317
317
|
sm.finish()
|
@@ -320,7 +320,7 @@ class SyncThread(threading.Thread):
|
|
320
320
|
synced_file = f"{sync_item}{SYNCED_SUFFIX}"
|
321
321
|
with open(synced_file, "w"):
|
322
322
|
pass
|
323
|
-
print("done.")
|
323
|
+
print("done.") # noqa: T201
|
324
324
|
|
325
325
|
|
326
326
|
class SyncManager:
|
wandb/util.py
CHANGED
@@ -1717,9 +1717,17 @@ def _get_max_cli_version() -> Union[str, None]:
|
|
1717
1717
|
|
1718
1718
|
|
1719
1719
|
def _is_offline() -> bool:
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1720
|
+
"""Returns true if wandb is configured to be offline.
|
1721
|
+
|
1722
|
+
If there is an active run, returns whether the run is offline.
|
1723
|
+
Otherwise, returns the default mode, which is affected by explicit settings
|
1724
|
+
passed to `wandb.setup()`, environment variables, and W&B configuration
|
1725
|
+
files.
|
1726
|
+
"""
|
1727
|
+
if wandb.run:
|
1728
|
+
return wandb.run.settings._offline
|
1729
|
+
else:
|
1730
|
+
return wandb.setup().settings._offline
|
1723
1731
|
|
1724
1732
|
|
1725
1733
|
def ensure_text(
|
wandb/wandb_agent.py
CHANGED
@@ -62,10 +62,10 @@ class AgentProcess:
|
|
62
62
|
os.environ[k] = v
|
63
63
|
|
64
64
|
# call user function
|
65
|
-
|
65
|
+
wandb.termlog(f"Agent Started Run: {run_id}")
|
66
66
|
if function:
|
67
67
|
function()
|
68
|
-
|
68
|
+
wandb.termlog(f"Agent Finished Run: {run_id}\n")
|
69
69
|
|
70
70
|
# complete the run
|
71
71
|
run = wandb.run
|
@@ -92,7 +92,7 @@ class AgentProcess:
|
|
92
92
|
|
93
93
|
def wait(self):
|
94
94
|
if self._popen:
|
95
|
-
# if on windows, wait() will block and we
|
95
|
+
# if on windows, wait() will block and we won't be able to interrupt
|
96
96
|
if platform.system() == "Windows":
|
97
97
|
try:
|
98
98
|
while True:
|
@@ -353,15 +353,10 @@ class Agent:
|
|
353
353
|
)
|
354
354
|
)
|
355
355
|
if self._in_jupyter:
|
356
|
-
|
357
|
-
"
|
358
|
-
command.get("run_id")
|
359
|
-
)
|
356
|
+
wandb.termlog(
|
357
|
+
f"Agent Starting Run: {command.get('run_id')} with config:\n"
|
360
358
|
+ "\n".join(
|
361
|
-
[
|
362
|
-
"\t{}: {}".format(k, v["value"])
|
363
|
-
for k, v in command["args"].items()
|
364
|
-
]
|
359
|
+
[f"\t{k}: {v['value']}" for k, v in command["args"].items()]
|
365
360
|
)
|
366
361
|
)
|
367
362
|
|
@@ -397,7 +392,7 @@ class Agent:
|
|
397
392
|
|
398
393
|
if self._function:
|
399
394
|
# make sure that each run regenerates setup singleton
|
400
|
-
|
395
|
+
wandb.teardown()
|
401
396
|
proc = AgentProcess(
|
402
397
|
function=self._function,
|
403
398
|
env=env,
|
@@ -477,12 +472,12 @@ class AgentApi:
|
|
477
472
|
command["resp_queue"] = resp_queue
|
478
473
|
self._queue.put(command)
|
479
474
|
result = resp_queue.get()
|
480
|
-
print("result:", result)
|
475
|
+
print("result:", result) # noqa: T201
|
481
476
|
if "exception" in result:
|
482
|
-
print("Exception occurred while running command")
|
477
|
+
print("Exception occurred while running command") # noqa: T201
|
483
478
|
for line in result["traceback"]:
|
484
|
-
print(line.strip())
|
485
|
-
print(result["exception"])
|
479
|
+
print(line.strip()) # noqa: T201
|
480
|
+
print(result["exception"]) # noqa: T201
|
486
481
|
return result
|
487
482
|
|
488
483
|
|
wandb/wandb_controller.py
CHANGED
@@ -353,19 +353,19 @@ class _WandbController:
|
|
353
353
|
self._logged += 1
|
354
354
|
|
355
355
|
def _error(self, s: str) -> None:
|
356
|
-
print("ERROR:", s)
|
356
|
+
print("ERROR:", s) # noqa: T201
|
357
357
|
self._log()
|
358
358
|
|
359
359
|
def _warn(self, s: str) -> None:
|
360
|
-
print("WARN:", s)
|
360
|
+
print("WARN:", s) # noqa: T201
|
361
361
|
self._log()
|
362
362
|
|
363
363
|
def _info(self, s: str) -> None:
|
364
|
-
print("INFO:", s)
|
364
|
+
print("INFO:", s) # noqa: T201
|
365
365
|
self._log()
|
366
366
|
|
367
367
|
def _debug(self, s: str) -> None:
|
368
|
-
print("DEBUG:", s)
|
368
|
+
print("DEBUG:", s) # noqa: T201
|
369
369
|
self._log()
|
370
370
|
|
371
371
|
def _configure_check(self) -> None:
|
@@ -396,10 +396,10 @@ class _WandbController:
|
|
396
396
|
sweep_id, warnings = self._api.upsert_sweep(self._create)
|
397
397
|
handle_sweep_config_violations(warnings)
|
398
398
|
|
399
|
-
print("Create sweep with ID:", sweep_id)
|
399
|
+
print("Create sweep with ID:", sweep_id) # noqa: T201
|
400
400
|
sweep_url = wandb_sweep._get_sweep_url(self._api, sweep_id)
|
401
401
|
if sweep_url:
|
402
|
-
print("Sweep URL:", sweep_url)
|
402
|
+
print("Sweep URL:", sweep_url) # noqa: T201
|
403
403
|
self._sweep_id = sweep_id
|
404
404
|
self._defer_sweep_creation = False
|
405
405
|
return sweep_id
|
@@ -636,7 +636,7 @@ class _WandbController:
|
|
636
636
|
def print_status(self) -> None:
|
637
637
|
status = _sweep_status(self._sweep_obj, self._sweep_config, self._sweep_runs)
|
638
638
|
if self._laststatus != status or self._logged:
|
639
|
-
print(status)
|
639
|
+
print(status) # noqa: T201
|
640
640
|
self._laststatus = status
|
641
641
|
self._logged = 0
|
642
642
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: wandb
|
3
|
-
Version: 0.19.
|
3
|
+
Version: 0.19.3
|
4
4
|
Summary: A CLI and library for interacting with the Weights & Biases API.
|
5
5
|
Project-URL: Source, https://github.com/wandb/wandb
|
6
6
|
Project-URL: Bug Reports, https://github.com/wandb/wandb/issues
|
@@ -66,6 +66,7 @@ Requires-Dist: setuptools
|
|
66
66
|
Requires-Dist: typing-extensions<5,>=4.4; python_version < '3.12'
|
67
67
|
Provides-Extra: aws
|
68
68
|
Requires-Dist: boto3; extra == 'aws'
|
69
|
+
Requires-Dist: botocore>=1.5.76; extra == 'aws'
|
69
70
|
Provides-Extra: azure
|
70
71
|
Requires-Dist: azure-identity; extra == 'azure'
|
71
72
|
Requires-Dist: azure-storage-blob; extra == 'azure'
|
@@ -88,7 +89,7 @@ Requires-Dist: azure-containerregistry; extra == 'launch'
|
|
88
89
|
Requires-Dist: azure-identity; extra == 'launch'
|
89
90
|
Requires-Dist: azure-storage-blob; extra == 'launch'
|
90
91
|
Requires-Dist: boto3; extra == 'launch'
|
91
|
-
Requires-Dist: botocore; extra == 'launch'
|
92
|
+
Requires-Dist: botocore>=1.5.76; extra == 'launch'
|
92
93
|
Requires-Dist: chardet; extra == 'launch'
|
93
94
|
Requires-Dist: google-auth; extra == 'launch'
|
94
95
|
Requires-Dist: google-cloud-aiplatform; extra == 'launch'
|