wandb 0.18.6__py3-none-win_amd64.whl → 0.19.0__py3-none-win_amd64.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.
Files changed (120) hide show
  1. package_readme.md +8 -0
  2. wandb/__init__.py +5 -7
  3. wandb/__init__.pyi +51 -30
  4. wandb/analytics/sentry.py +4 -10
  5. wandb/apis/importers/internals/internal.py +6 -6
  6. wandb/apis/importers/internals/protocols.py +11 -7
  7. wandb/apis/public/api.py +5 -1
  8. wandb/apis/public/jobs.py +1 -7
  9. wandb/apis/public/reports.py +6 -17
  10. wandb/apis/public/runs.py +12 -10
  11. wandb/bin/gpu_stats.exe +0 -0
  12. wandb/bin/wandb-core +0 -0
  13. wandb/cli/cli.py +9 -45
  14. wandb/env.py +3 -5
  15. wandb/errors/links.py +1 -1
  16. wandb/errors/term.py +1 -6
  17. wandb/filesync/dir_watcher.py +3 -3
  18. wandb/filesync/step_upload.py +2 -5
  19. wandb/integration/fastai/__init__.py +1 -6
  20. wandb/integration/gym/__init__.py +1 -7
  21. wandb/integration/keras/callbacks/metrics_logger.py +1 -8
  22. wandb/integration/keras/callbacks/model_checkpoint.py +1 -8
  23. wandb/integration/keras/keras.py +3 -5
  24. wandb/integration/lightgbm/__init__.py +1 -1
  25. wandb/integration/sb3/sb3.py +1 -7
  26. wandb/integration/sklearn/utils.py +1 -1
  27. wandb/integration/tensorboard/log.py +1 -2
  28. wandb/integration/torch/wandb_torch.py +1 -1
  29. wandb/integration/ultralytics/bbox_utils.py +9 -2
  30. wandb/jupyter.py +4 -4
  31. wandb/proto/v3/wandb_internal_pb2.py +31 -31
  32. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  33. wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
  34. wandb/proto/v4/wandb_internal_pb2.py +31 -31
  35. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  36. wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
  37. wandb/proto/v5/wandb_internal_pb2.py +31 -31
  38. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  39. wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
  40. wandb/proto/wandb_deprecated.py +3 -11
  41. wandb/proto/wandb_generate_deprecated.py +3 -7
  42. wandb/sdk/artifacts/artifact.py +3 -11
  43. wandb/sdk/artifacts/artifact_file_cache.py +2 -5
  44. wandb/sdk/artifacts/artifact_saver.py +2 -6
  45. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +2 -4
  46. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +2 -4
  47. wandb/sdk/artifacts/storage_handlers/s3_handler.py +2 -4
  48. wandb/sdk/backend/backend.py +1 -1
  49. wandb/sdk/data_types/base_types/wb_value.py +20 -10
  50. wandb/sdk/data_types/histogram.py +1 -3
  51. wandb/sdk/data_types/object_3d.py +2 -6
  52. wandb/sdk/data_types/table.py +1 -1
  53. wandb/sdk/data_types/utils.py +1 -2
  54. wandb/sdk/data_types/video.py +15 -4
  55. wandb/sdk/integration_utils/auto_logging.py +1 -8
  56. wandb/sdk/interface/interface.py +12 -5
  57. wandb/sdk/interface/interface_queue.py +0 -6
  58. wandb/sdk/interface/interface_shared.py +9 -0
  59. wandb/sdk/interface/router.py +1 -2
  60. wandb/sdk/interface/router_queue.py +0 -3
  61. wandb/sdk/interface/router_relay.py +0 -2
  62. wandb/sdk/internal/file_stream.py +1 -4
  63. wandb/sdk/internal/flow_control.py +1 -1
  64. wandb/sdk/internal/handler.py +8 -5
  65. wandb/sdk/internal/internal.py +3 -17
  66. wandb/sdk/internal/internal_api.py +3 -10
  67. wandb/sdk/internal/internal_util.py +0 -3
  68. wandb/sdk/internal/job_builder.py +20 -12
  69. wandb/sdk/internal/progress.py +1 -5
  70. wandb/sdk/internal/sender.py +9 -15
  71. wandb/sdk/internal/settings_static.py +4 -10
  72. wandb/sdk/internal/system/assets/cpu.py +2 -2
  73. wandb/sdk/internal/system/assets/disk.py +3 -3
  74. wandb/sdk/internal/system/assets/gpu.py +7 -7
  75. wandb/sdk/internal/system/assets/gpu_amd.py +1 -7
  76. wandb/sdk/internal/system/assets/interfaces.py +11 -13
  77. wandb/sdk/internal/system/assets/ipu.py +1 -1
  78. wandb/sdk/internal/system/assets/memory.py +2 -2
  79. wandb/sdk/internal/system/assets/open_metrics.py +2 -8
  80. wandb/sdk/internal/system/assets/trainium.py +3 -9
  81. wandb/sdk/internal/system/system_info.py +14 -13
  82. wandb/sdk/internal/system/system_monitor.py +5 -12
  83. wandb/sdk/internal/tb_watcher.py +1 -1
  84. wandb/sdk/internal/writer.py +2 -4
  85. wandb/sdk/launch/__init__.py +2 -1
  86. wandb/sdk/launch/agent/run_queue_item_file_saver.py +1 -7
  87. wandb/sdk/launch/create_job.py +2 -3
  88. wandb/sdk/launch/runner/abstract.py +1 -6
  89. wandb/sdk/launch/runner/kubernetes_monitor.py +2 -4
  90. wandb/sdk/lib/apikey.py +2 -6
  91. wandb/sdk/lib/fsm.py +12 -6
  92. wandb/sdk/lib/ipython.py +1 -6
  93. wandb/sdk/lib/module.py +0 -3
  94. wandb/sdk/lib/progress.py +2 -3
  95. wandb/sdk/lib/run_moment.py +1 -7
  96. wandb/sdk/lib/server.py +10 -24
  97. wandb/sdk/lib/sock_client.py +0 -5
  98. wandb/sdk/service/server.py +3 -12
  99. wandb/sdk/service/server_sock.py +0 -2
  100. wandb/sdk/service/service.py +5 -5
  101. wandb/sdk/wandb_init.py +215 -166
  102. wandb/sdk/wandb_login.py +17 -27
  103. wandb/sdk/wandb_run.py +129 -161
  104. wandb/sdk/wandb_settings.py +978 -1760
  105. wandb/sdk/wandb_setup.py +87 -94
  106. wandb/sdk/wandb_watch.py +1 -1
  107. wandb/sync/sync.py +1 -2
  108. wandb/util.py +7 -40
  109. wandb/wandb_controller.py +10 -12
  110. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/METADATA +14 -4
  111. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/RECORD +114 -120
  112. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/WHEEL +1 -1
  113. wandb/integration/magic.py +0 -556
  114. wandb/magic.py +0 -3
  115. wandb/sdk/lib/_settings_toposort_generate.py +0 -159
  116. wandb/sdk/lib/_settings_toposort_generated.py +0 -250
  117. wandb/sdk/lib/reporting.py +0 -99
  118. wandb/sdk/lib/tracelog.py +0 -255
  119. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/entry_points.txt +0 -0
  120. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/licenses/LICENSE +0 -0
@@ -6,7 +6,6 @@ import json
6
6
  import logging
7
7
  import os
8
8
  import queue
9
- import sys
10
9
  import threading
11
10
  import time
12
11
  import traceback
@@ -19,6 +18,7 @@ from typing import (
19
18
  Dict,
20
19
  Generator,
21
20
  List,
21
+ Literal,
22
22
  Optional,
23
23
  Tuple,
24
24
  Type,
@@ -53,16 +53,10 @@ from wandb.sdk.lib import (
53
53
  proto_util,
54
54
  redirect,
55
55
  telemetry,
56
- tracelog,
57
56
  )
58
57
  from wandb.sdk.lib.mailbox import ContextCancelledError
59
58
  from wandb.sdk.lib.proto_util import message_to_dict
60
59
 
61
- if sys.version_info >= (3, 8):
62
- from typing import Literal
63
- else:
64
- from typing_extensions import Literal
65
-
66
60
  if TYPE_CHECKING:
67
61
  from wandb.proto.wandb_internal_pb2 import (
68
62
  ArtifactManifest,
@@ -327,18 +321,19 @@ class SendManager:
327
321
  ) -> "SendManager":
328
322
  """Set up a standalone SendManager.
329
323
 
330
- Currently, we're using this primarily for `sync.py`.
324
+ Exclusively used in `sync.py`.
331
325
  """
326
+ print(root_dir)
332
327
  files_dir = os.path.join(root_dir, "files")
333
328
  settings = wandb.Settings(
334
- files_dir=files_dir,
329
+ x_files_dir=files_dir,
335
330
  root_dir=root_dir,
336
331
  # _start_time=0,
337
332
  resume=resume,
338
333
  # ignore_globs=(),
339
- _sync=True,
334
+ x_sync=True,
340
335
  disable_job_creation=False,
341
- _file_stream_timeout_seconds=0,
336
+ x_file_stream_timeout_seconds=0,
342
337
  )
343
338
  record_q: Queue[Record] = queue.Queue()
344
339
  result_q: Queue[Result] = queue.Queue()
@@ -418,7 +413,6 @@ class SendManager:
418
413
  send_handler(record)
419
414
 
420
415
  def _respond_result(self, result: "Result") -> None:
421
- tracelog.log_message_queue(result, self._result_q)
422
416
  context_id = context.context_id_from_result(result)
423
417
  self._context_keeper.release(context_id)
424
418
  self._result_q.put(result)
@@ -442,7 +436,7 @@ class SendManager:
442
436
  # state machine
443
437
  # - skipping the exit record in `wandb sync` mode so that
444
438
  # it is always executed as the last record
445
- if not self._settings._offline and not self._settings._sync:
439
+ if not self._settings._offline and not self._settings.x_sync:
446
440
  assert record_num == self._send_record_num + 1
447
441
  self._send_record_num = record_num
448
442
 
@@ -916,7 +910,7 @@ class SendManager:
916
910
  # update telemetry
917
911
  if run.telemetry:
918
912
  self._telemetry_obj.MergeFrom(run.telemetry)
919
- if self._settings._sync:
913
+ if self._settings.x_sync:
920
914
  self._telemetry_obj.feature.sync = True
921
915
 
922
916
  # build config dict
@@ -1126,7 +1120,7 @@ class SendManager:
1126
1120
  self._api,
1127
1121
  self._run.run_id,
1128
1122
  self._run.start_time.ToMicroseconds() / 1e6,
1129
- timeout=self._settings._file_stream_timeout_seconds,
1123
+ timeout=self._settings.x_file_stream_timeout_seconds or 0,
1130
1124
  settings=self._api_settings,
1131
1125
  )
1132
1126
  # Ensure the streaming polices have the proper offsets
@@ -1,12 +1,11 @@
1
- from dataclasses import fields
2
- from typing import Any, Iterable, Sequence, Tuple
1
+ from typing import Any, Iterable
3
2
 
4
3
  from wandb.proto import wandb_settings_pb2
5
4
  from wandb.sdk.lib import RunMoment
6
- from wandb.sdk.wandb_settings import SettingsData
5
+ from wandb.sdk.wandb_settings import Settings
7
6
 
8
7
 
9
- class SettingsStatic(SettingsData):
8
+ class SettingsStatic(Settings):
10
9
  """A readonly object that wraps a protobuf Settings message.
11
10
 
12
11
  Implements the mapping protocol, so you can access settings as
@@ -19,8 +18,7 @@ class SettingsStatic(SettingsData):
19
18
 
20
19
  def _from_proto(self, proto: wandb_settings_pb2.Settings) -> None:
21
20
  forks_specified: list[str] = []
22
- for field in fields(SettingsData):
23
- key = field.name
21
+ for key in Settings.model_fields: # type: ignore [attr-defined]
24
22
  value: Any = None
25
23
  if key == "_stats_open_metrics_filters":
26
24
  # todo: it's an underscored field, refactor into
@@ -52,10 +50,6 @@ class SettingsStatic(SettingsData):
52
50
  else:
53
51
  if proto.HasField(key): # type: ignore [arg-type]
54
52
  value = getattr(proto, key).value
55
- if field.type == Sequence[str]:
56
- value = list(value)
57
- elif field.type == Tuple[str]:
58
- value = tuple(value)
59
53
  else:
60
54
  value = None
61
55
  object.__setattr__(self, key, value)
@@ -117,9 +117,9 @@ class CPU:
117
117
  ) -> None:
118
118
  self.name: str = self.__class__.__name__.lower()
119
119
  self.metrics: List[Metric] = [
120
- ProcessCpuPercent(settings._stats_pid),
120
+ ProcessCpuPercent(settings.x_stats_pid),
121
121
  CpuPercent(),
122
- ProcessCpuThreads(settings._stats_pid),
122
+ ProcessCpuThreads(settings.x_stats_pid),
123
123
  ]
124
124
  self.metrics_monitor: MetricsMonitor = MetricsMonitor(
125
125
  self.name,
@@ -167,8 +167,8 @@ class Disk:
167
167
  self.name = self.__class__.__name__.lower()
168
168
  self.settings = settings
169
169
  self.metrics: List[Metric] = [
170
- DiskUsagePercent(list(settings._stats_disk_paths or ["/"])),
171
- DiskUsage(list(settings._stats_disk_paths or ["/"])),
170
+ DiskUsagePercent(list(settings.x_stats_disk_paths or ["/"])),
171
+ DiskUsage(list(settings.x_stats_disk_paths or ["/"])),
172
172
  DiskIn(),
173
173
  DiskOut(),
174
174
  ]
@@ -186,7 +186,7 @@ class Disk:
186
186
  return psutil is not None
187
187
 
188
188
  def probe(self) -> dict:
189
- disk_paths = list(self.settings._stats_disk_paths or ["/"])
189
+ disk_paths = list(self.settings.x_stats_disk_paths or ["/"])
190
190
  disk_metrics = {}
191
191
  for disk_path in disk_paths:
192
192
  try:
@@ -354,13 +354,13 @@ class GPU:
354
354
  ) -> None:
355
355
  self.name = self.__class__.__name__.lower()
356
356
  self.metrics: List[Metric] = [
357
- GPUMemoryAllocated(settings._stats_pid),
358
- GPUMemoryAllocatedBytes(settings._stats_pid),
359
- GPUMemoryUtilization(settings._stats_pid),
360
- GPUUtilization(settings._stats_pid),
361
- GPUTemperature(settings._stats_pid),
362
- GPUPowerUsageWatts(settings._stats_pid),
363
- GPUPowerUsagePercent(settings._stats_pid),
357
+ GPUMemoryAllocated(settings.x_stats_pid),
358
+ GPUMemoryAllocatedBytes(settings.x_stats_pid),
359
+ GPUMemoryUtilization(settings.x_stats_pid),
360
+ GPUUtilization(settings.x_stats_pid),
361
+ GPUTemperature(settings.x_stats_pid),
362
+ GPUPowerUsageWatts(settings.x_stats_pid),
363
+ GPUPowerUsagePercent(settings.x_stats_pid),
364
364
  ]
365
365
  self.metrics_monitor = MetricsMonitor(
366
366
  self.name,
@@ -2,15 +2,9 @@ import json
2
2
  import logging
3
3
  import shutil
4
4
  import subprocess
5
- import sys
6
5
  import threading
7
6
  from collections import deque
8
- from typing import TYPE_CHECKING, Any, Dict, List, Union
9
-
10
- if sys.version_info >= (3, 8):
11
- from typing import Final, Literal
12
- else:
13
- from typing_extensions import Final, Literal
7
+ from typing import TYPE_CHECKING, Any, Dict, Final, List, Literal, Union
14
8
 
15
9
  from wandb.sdk.lib import telemetry
16
10
 
@@ -1,13 +1,15 @@
1
1
  import datetime
2
2
  import logging
3
- import sys
4
3
  import threading
5
- from typing import TYPE_CHECKING, Any, List, Optional, TypeVar
6
-
7
- if sys.version_info >= (3, 8):
8
- from typing import Protocol, runtime_checkable
9
- else:
10
- from typing_extensions import Protocol, runtime_checkable
4
+ from typing import (
5
+ TYPE_CHECKING,
6
+ Any,
7
+ List,
8
+ Optional,
9
+ Protocol,
10
+ TypeVar,
11
+ runtime_checkable,
12
+ )
11
13
 
12
14
  if TYPE_CHECKING:
13
15
  from typing import Deque
@@ -118,14 +120,10 @@ class MetricsMonitor:
118
120
  self.sampling_interval: float = float(
119
121
  max(
120
122
  0.1,
121
- settings._stats_sample_rate_seconds,
123
+ settings.x_stats_sampling_interval,
122
124
  )
123
125
  ) # seconds
124
- # The number of samples to aggregate (e.g. average or compute max/min etc.)
125
- # before publishing; defaults to 15; valid range: [1:30]
126
- self.samples_to_aggregate: int = min(
127
- 30, max(1, settings._stats_samples_to_average)
128
- )
126
+ self.samples_to_aggregate = 1
129
127
 
130
128
  def monitor(self) -> None:
131
129
  """Poll the Asset metrics."""
@@ -134,7 +134,7 @@ class IPU:
134
134
  ) -> None:
135
135
  self.name = self.__class__.__name__.lower()
136
136
  self.metrics: List[Metric] = [
137
- IPUStats(settings._stats_pid),
137
+ IPUStats(settings.x_stats_pid),
138
138
  ]
139
139
  self.metrics_monitor = MetricsMonitor(
140
140
  self.name,
@@ -134,8 +134,8 @@ class Memory:
134
134
  self.metrics: List[Metric] = [
135
135
  MemoryAvailable(),
136
136
  MemoryPercent(),
137
- ProcessMemoryRSS(settings._stats_pid),
138
- ProcessMemoryPercent(settings._stats_pid),
137
+ ProcessMemoryRSS(settings.x_stats_pid),
138
+ ProcessMemoryPercent(settings.x_stats_pid),
139
139
  ]
140
140
  self.metrics_monitor = MetricsMonitor(
141
141
  self.name,
@@ -1,16 +1,10 @@
1
1
  import logging
2
2
  import re
3
- import sys
4
3
  import threading
5
4
  from collections import defaultdict, deque
6
5
  from functools import lru_cache
7
6
  from types import ModuleType
8
- from typing import TYPE_CHECKING, Dict, List, Mapping, Sequence, Tuple, Union
9
-
10
- if sys.version_info >= (3, 8):
11
- from typing import Final
12
- else:
13
- from typing_extensions import Final
7
+ from typing import TYPE_CHECKING, Dict, Final, List, Mapping, Sequence, Tuple, Union
14
8
 
15
9
  import requests
16
10
  import requests.adapters
@@ -235,7 +229,7 @@ class OpenMetrics:
235
229
  self.shutdown_event = shutdown_event
236
230
 
237
231
  self.metrics: List[Metric] = [
238
- OpenMetricsMetric(name, url, settings._stats_open_metrics_filters)
232
+ OpenMetricsMetric(name, url, settings.x_stats_open_metrics_filters)
239
233
  ]
240
234
 
241
235
  self.metrics_monitor: MetricsMonitor = MetricsMonitor(
@@ -6,17 +6,11 @@ import os
6
6
  import pathlib
7
7
  import shutil
8
8
  import subprocess
9
- import sys
10
9
  import tempfile
11
10
  import threading
12
11
  import time
13
12
  from collections import deque
14
- from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
15
-
16
- if sys.version_info >= (3, 8):
17
- from typing import Final
18
- else:
19
- from typing_extensions import Final
13
+ from typing import TYPE_CHECKING, Any, Dict, Final, List, Optional, Tuple, Union
20
14
 
21
15
  from wandb.sdk.lib import telemetry
22
16
 
@@ -315,8 +309,8 @@ class Trainium:
315
309
  self.name = self.__class__.__name__.lower()
316
310
  self.metrics: List[Metric] = [
317
311
  NeuronCoreStats(
318
- settings._stats_pid,
319
- settings._stats_neuron_monitor_config_path,
312
+ settings.x_stats_pid,
313
+ settings.x_stats_neuron_monitor_config_path,
320
314
  ),
321
315
  ]
322
316
  self.metrics_monitor = MetricsMonitor(
@@ -126,7 +126,7 @@ class SystemInfo:
126
126
  logger.debug("Saving git patches done")
127
127
 
128
128
  def _probe_git(self, data: Dict[str, Any]) -> Dict[str, Any]:
129
- if self.settings.disable_git:
129
+ if self.settings.disable_git or self.settings.x_disable_machine_info:
130
130
  return data
131
131
 
132
132
  # in case of manually passing the git repo info, `enabled` would be False,
@@ -155,13 +155,14 @@ class SystemInfo:
155
155
  data["os"] = self.settings._os
156
156
  data["python"] = self.settings._python
157
157
  data["heartbeatAt"] = datetime.datetime.utcnow().isoformat()
158
- data["startedAt"] = datetime.datetime.utcfromtimestamp(
159
- self.settings._start_time
160
- ).isoformat()
158
+ data["startedAt"] = (
159
+ datetime.datetime.utcfromtimestamp(self.settings.x_start_time).isoformat()
160
+ if self.settings.x_start_time
161
+ else None
162
+ )
161
163
 
162
164
  data["docker"] = self.settings.docker
163
165
 
164
- data["cuda"] = self.settings._cuda
165
166
  data["args"] = tuple(self.settings._args or ())
166
167
  data["state"] = "running"
167
168
 
@@ -170,22 +171,22 @@ class SystemInfo:
170
171
  # Used during artifact-job creation, always points to the relpath
171
172
  # of code execution, even when in a git repo
172
173
  data["codePathLocal"] = self.settings._code_path_local
173
- if not self.settings.disable_code:
174
+ if not (self.settings.disable_code or self.settings.x_disable_machine_info):
174
175
  if self.settings.program_relpath:
175
176
  data["codePath"] = self.settings.program_relpath
176
177
  elif self.settings._jupyter:
177
178
  if self.settings.notebook_name:
178
179
  data["program"] = self.settings.notebook_name
179
- elif self.settings._jupyter_path:
180
- if self.settings._jupyter_path.startswith("fileId="):
181
- unescaped = unquote(self.settings._jupyter_path)
180
+ elif self.settings.x_jupyter_path:
181
+ if self.settings.x_jupyter_path.startswith("fileId="):
182
+ unescaped = unquote(self.settings.x_jupyter_path)
182
183
  data["colab"] = (
183
184
  "https://colab.research.google.com/notebook#" + unescaped
184
185
  )
185
- data["program"] = self.settings._jupyter_name
186
+ data["program"] = self.settings.x_jupyter_name
186
187
  else:
187
- data["program"] = self.settings._jupyter_path
188
- data["root"] = self.settings._jupyter_root
188
+ data["program"] = self.settings.x_jupyter_path
189
+ data["root"] = self.settings.x_jupyter_root
189
190
  # get the git repo info
190
191
  data = self._probe_git(data)
191
192
 
@@ -225,7 +226,7 @@ class SystemInfo:
225
226
 
226
227
  def publish(self, system_info: dict) -> None:
227
228
  # save pip, conda, code patches to disk
228
- if self.settings._save_requirements:
229
+ if self.settings.x_save_requirements:
229
230
  self._save_conda()
230
231
  if self.settings.save_code:
231
232
  self._save_code()
@@ -60,18 +60,11 @@ class SystemMonitor:
60
60
 
61
61
  # compute the global publishing interval if _stats_join_assets is requested
62
62
  sampling_interval: float = float(
63
- max(
64
- 0.1,
65
- self.settings._stats_sample_rate_seconds,
66
- )
63
+ max(0.1, self.settings.x_stats_sampling_interval)
67
64
  ) # seconds
68
- # The number of samples to aggregate (e.g. average or compute max/min etc.)
69
- # before publishing; defaults to 15; valid range: [1:30]
70
- samples_to_aggregate: int = min(
71
- 30, max(1, self.settings._stats_samples_to_average)
72
- )
65
+ samples_to_aggregate: int = 1
73
66
  self.publishing_interval: float = sampling_interval * samples_to_aggregate
74
- self.join_assets: bool = self.settings._stats_join_assets
67
+ self.join_assets: bool = False
75
68
 
76
69
  self.backend_interface = interface
77
70
  self.asset_interface: Optional[AssetInterface] = (
@@ -90,7 +83,7 @@ class SystemMonitor:
90
83
  )
91
84
 
92
85
  self.buffer: Dict[str, Deque[Tuple[float, float]]] = defaultdict(
93
- lambda: deque([], maxlen=self.settings._stats_buffer_size)
86
+ lambda: deque([], maxlen=self.settings.x_stats_buffer_size)
94
87
  )
95
88
 
96
89
  def _get_assets(self) -> List["Asset"]:
@@ -104,7 +97,7 @@ class SystemMonitor:
104
97
  ]
105
98
 
106
99
  def _get_open_metrics_assets(self) -> List["Asset"]:
107
- open_metrics_endpoints = self.settings._stats_open_metrics_endpoints
100
+ open_metrics_endpoints = self.settings.x_stats_open_metrics_endpoints
108
101
  if not open_metrics_endpoints:
109
102
  return []
110
103
 
@@ -231,7 +231,7 @@ class TBDirWatcher:
231
231
  return is_tfevents_file_created_by(path, None, None)
232
232
  else:
233
233
  return is_tfevents_file_created_by(
234
- path, self._hostname, self._tbwatcher._settings._start_time
234
+ path, self._hostname, self._tbwatcher._settings.x_start_time
235
235
  )
236
236
 
237
237
  def _loader(
@@ -7,7 +7,7 @@ from wandb.proto import wandb_internal_pb2 as pb
7
7
  from wandb.proto import wandb_telemetry_pb2 as tpb
8
8
 
9
9
  from ..interface.interface_queue import InterfaceQueue
10
- from ..lib import proto_util, telemetry, tracelog
10
+ from ..lib import proto_util, telemetry
11
11
  from . import context, datastore, flow_control
12
12
  from .settings_static import SettingsStatic
13
13
 
@@ -63,7 +63,7 @@ class WriteManager:
63
63
  self._telemetry_obj = tpb.TelemetryRecord()
64
64
  self._telemetry_overflow = False
65
65
  self._use_flow_control = not (
66
- self._settings._flow_control_disabled or self._settings._offline
66
+ self._settings.x_flow_control_disabled or self._settings._offline
67
67
  )
68
68
 
69
69
  def open(self) -> None:
@@ -79,7 +79,6 @@ class WriteManager:
79
79
 
80
80
  def _forward_record(self, record: "pb.Record") -> None:
81
81
  self._context_keeper.add_from_record(record)
82
- tracelog.log_message_queue(record, self._sender_q)
83
82
  self._sender_q.put(record)
84
83
 
85
84
  def _send_mark(self) -> None:
@@ -191,7 +190,6 @@ class WriteManager:
191
190
  # self._sender_cancel_set.add(cancel_id)
192
191
 
193
192
  def _respond_result(self, result: "pb.Result") -> None:
194
- tracelog.log_message_queue(result, self._result_q)
195
193
  self._result_q.put(result)
196
194
 
197
195
  def finish(self) -> None:
@@ -1,10 +1,11 @@
1
- from ._launch import launch
1
+ from ._launch import create_and_run_agent, launch
2
2
  from ._launch_add import launch_add
3
3
  from .agent.agent import LaunchAgent
4
4
  from .inputs.manage import manage_config_file, manage_wandb_config
5
5
  from .utils import load_wandb_config
6
6
 
7
7
  __all__ = [
8
+ "create_and_run_agent",
8
9
  "LaunchAgent",
9
10
  "launch",
10
11
  "launch_add",
@@ -1,16 +1,10 @@
1
1
  """Implementation of the run queue item file saver class."""
2
2
 
3
3
  import os
4
- import sys
5
- from typing import List, Optional
4
+ from typing import List, Literal, Optional
6
5
 
7
6
  import wandb
8
7
 
9
- if sys.version_info >= (3, 8):
10
- from typing import Literal
11
- else:
12
- from typing_extensions import Literal
13
-
14
8
  FileSubtypes = Literal["warning", "error"]
15
9
 
16
10
 
@@ -168,7 +168,7 @@ def _create_job(
168
168
  return None, "", []
169
169
 
170
170
  job_builder = _configure_job_builder_for_partial(tempdir.name, job_source=job_type)
171
- job_builder._settings.update(job_name=name)
171
+ job_builder._settings.job_name = name
172
172
  if job_type == "code":
173
173
  assert entrypoint is not None
174
174
  job_name = _make_code_artifact(
@@ -404,8 +404,7 @@ def _configure_job_builder_for_partial(tmpdir: str, job_source: str) -> JobBuild
404
404
  if job_source == "code":
405
405
  job_source = "artifact"
406
406
 
407
- settings = wandb.Settings()
408
- settings.update({"files_dir": tmpdir, "job_source": job_source})
407
+ settings = wandb.Settings(x_files_dir=tmpdir, job_source=job_source)
409
408
  job_builder = JobBuilder(
410
409
  settings=settings, # type: ignore
411
410
  verbose=True,
@@ -9,7 +9,7 @@ import os
9
9
  import subprocess
10
10
  import sys
11
11
  from abc import ABC, abstractmethod
12
- from typing import Any, Dict, List, Optional, Union
12
+ from typing import Any, Dict, List, Literal, Optional, Union
13
13
 
14
14
  from dockerpycreds.utils import find_executable # type: ignore
15
15
 
@@ -22,11 +22,6 @@ from .._project_spec import LaunchProject
22
22
  _logger = logging.getLogger(__name__)
23
23
 
24
24
 
25
- if sys.version_info >= (3, 8):
26
- from typing import Literal
27
- else:
28
- from typing_extensions import Literal
29
-
30
25
  State = Literal[
31
26
  "unknown",
32
27
  "starting",
@@ -2,7 +2,6 @@
2
2
 
3
3
  import asyncio
4
4
  import logging
5
- import sys
6
5
  import traceback
7
6
  from typing import Any, Dict, List, Optional, Tuple, Union
8
7
 
@@ -74,8 +73,7 @@ _logger = logging.getLogger(__name__)
74
73
  def create_named_task(name: str, coro: Any, *args: Any, **kwargs: Any) -> asyncio.Task:
75
74
  """Create a named task."""
76
75
  task = asyncio.create_task(coro(*args, **kwargs))
77
- if sys.version_info >= (3, 8):
78
- task.set_name(name)
76
+ task.set_name(name)
79
77
  task.add_done_callback(_log_err_task_callback)
80
78
  return task
81
79
 
@@ -87,7 +85,7 @@ def _log_err_task_callback(task: asyncio.Task) -> None:
87
85
  if isinstance(exec, asyncio.CancelledError):
88
86
  wandb.termlog(f"Task {task.get_name()} was cancelled")
89
87
  return
90
- name = str(task) if sys.version_info < (3, 8) else task.get_name()
88
+ name = task.get_name()
91
89
  wandb.termerror(f"Exception in task {name}")
92
90
  tb = exec.__traceback__
93
91
  tb_str = "".join(traceback.format_tb(tb))
wandb/sdk/lib/apikey.py CHANGED
@@ -6,14 +6,10 @@ import stat
6
6
  import sys
7
7
  import textwrap
8
8
  from functools import partial
9
- from typing import TYPE_CHECKING, Callable, Dict, Optional, Union
10
- from urllib.parse import urlparse
11
9
 
12
10
  # import Literal
13
- if sys.version_info >= (3, 8):
14
- from typing import Literal
15
- else:
16
- from typing_extensions import Literal
11
+ from typing import TYPE_CHECKING, Callable, Dict, Literal, Optional, Union
12
+ from urllib.parse import urlparse
17
13
 
18
14
  import click
19
15
  from requests.utils import NETRC_FILES, get_netrc_auth
wandb/sdk/lib/fsm.py CHANGED
@@ -31,12 +31,18 @@ Usage:
31
31
  import sys
32
32
  from abc import abstractmethod
33
33
  from dataclasses import dataclass
34
- from typing import Callable, Dict, Generic, Optional, Sequence, Type, TypeVar, Union
35
-
36
- if sys.version_info >= (3, 8):
37
- from typing import Protocol, runtime_checkable
38
- else:
39
- from typing_extensions import Protocol, runtime_checkable
34
+ from typing import (
35
+ Callable,
36
+ Dict,
37
+ Generic,
38
+ Optional,
39
+ Protocol,
40
+ Sequence,
41
+ Type,
42
+ TypeVar,
43
+ Union,
44
+ runtime_checkable,
45
+ )
40
46
 
41
47
  if sys.version_info >= (3, 10):
42
48
  from typing import TypeAlias
wandb/sdk/lib/ipython.py CHANGED
@@ -1,12 +1,7 @@
1
1
  import logging
2
2
  import sys
3
3
  import warnings
4
- from typing import Optional
5
-
6
- if sys.version_info >= (3, 8):
7
- from typing import Literal
8
- else:
9
- from typing_extensions import Literal
4
+ from typing import Literal, Optional
10
5
 
11
6
  import wandb
12
7
 
wandb/sdk/lib/module.py CHANGED
@@ -14,7 +14,6 @@ def set_global(
14
14
  log_artifact=None,
15
15
  define_metric=None,
16
16
  alert=None,
17
- plot_table=None,
18
17
  mark_preempting=None,
19
18
  log_model=None,
20
19
  use_model=None,
@@ -38,8 +37,6 @@ def set_global(
38
37
  wandb.log_artifact = log_artifact
39
38
  if define_metric:
40
39
  wandb.define_metric = define_metric
41
- if plot_table:
42
- wandb.plot_table = plot_table
43
40
  if alert:
44
41
  wandb.alert = alert
45
42
  if mark_preempting: