wandb 0.18.6__py3-none-macosx_11_0_arm64.whl → 0.19.0__py3-none-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
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 +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 +13 -3
  111. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/RECORD +114 -120
  112. wandb/integration/magic.py +0 -556
  113. wandb/magic.py +0 -3
  114. wandb/sdk/lib/_settings_toposort_generate.py +0 -159
  115. wandb/sdk/lib/_settings_toposort_generated.py +0 -250
  116. wandb/sdk/lib/reporting.py +0 -99
  117. wandb/sdk/lib/tracelog.py +0 -255
  118. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/WHEEL +0 -0
  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
wandb/sdk/lib/progress.py CHANGED
@@ -50,7 +50,7 @@ class ProgressPrinter:
50
50
  progress_text_area: p.DynamicText | None,
51
51
  settings: wandb.Settings | None,
52
52
  ) -> None:
53
- self._show_operation_stats = settings and settings._show_operation_stats
53
+ self._show_operation_stats = settings and settings.x_show_operation_stats
54
54
  self._printer = printer
55
55
  self._progress_text_area = progress_text_area
56
56
  self._tick = 0
@@ -189,8 +189,7 @@ class _DynamicOperationStatsPrinter:
189
189
  total_operations += stats.total_operations
190
190
 
191
191
  if self._ops_shown < total_operations:
192
- # NOTE: In Python 3.8, we'd use a chained comparison here.
193
- if 1 <= self._max_lines and self._max_lines <= len(self._lines):
192
+ if 1 <= self._max_lines <= len(self._lines):
194
193
  self._lines.pop()
195
194
 
196
195
  remaining = total_operations - self._ops_shown
@@ -1,13 +1,7 @@
1
- import sys
2
1
  from dataclasses import dataclass
3
- from typing import Union, cast
2
+ from typing import Literal, Union, cast
4
3
  from urllib import parse
5
4
 
6
- if sys.version_info >= (3, 8):
7
- from typing import Literal
8
- else:
9
- from typing_extensions import Literal
10
-
11
5
  _STEP = Literal["_step"]
12
6
 
13
7
 
wandb/sdk/lib/server.py CHANGED
@@ -1,7 +1,9 @@
1
1
  """module server."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  import json
4
- from typing import TYPE_CHECKING, Any, Dict, Optional, Union
6
+ from typing import TYPE_CHECKING, Any
5
7
 
6
8
  from wandb import util
7
9
  from wandb.apis import InternalApi
@@ -10,43 +12,27 @@ if TYPE_CHECKING:
10
12
  from wandb.sdk.wandb_settings import Settings
11
13
 
12
14
 
13
- class ServerError(Exception):
14
- pass
15
-
16
-
17
15
  class Server:
18
16
  def __init__(
19
17
  self,
20
- api: Optional[InternalApi] = None,
21
- settings: Optional["Settings"] = None,
18
+ settings: Settings,
22
19
  ) -> None:
23
- self._api = api or InternalApi(default_settings=settings)
24
- self._error_network: Optional[bool] = None
25
- self._viewer: Dict[str, Any] = {}
26
- self._flags: Dict[str, Any] = {}
27
- self._settings = settings
20
+ self._api = InternalApi(default_settings=settings)
21
+ self._viewer: dict[str, Any] = {}
22
+ self._flags: dict[str, Any] = {}
23
+ self._settings: Settings = settings
28
24
 
29
- def query_with_timeout(self, timeout: Union[int, float, None] = None) -> None:
30
- if self._settings and self._settings._disable_viewer:
25
+ def query_with_timeout(self, timeout: int | float = 5) -> None:
26
+ if self._settings.x_disable_viewer:
31
27
  return
32
- timeout = timeout or 5
33
28
  async_viewer = util.async_call(self._api.viewer_server_info, timeout=timeout)
34
29
  try:
35
30
  viewer_tuple, viewer_thread = async_viewer()
36
31
  except Exception:
37
- # TODO: currently a bare exception as lots can happen, we should classify
38
- self._error_network = True
39
32
  return
40
33
  if viewer_thread.is_alive():
41
34
  # this is likely a DNS hang
42
- self._error_network = True
43
35
  return
44
- self._error_network = False
45
36
  # TODO(jhr): should we kill the thread?
46
37
  self._viewer, self._serverinfo = viewer_tuple
47
38
  self._flags = json.loads(self._viewer.get("flags", "{}"))
48
-
49
- def is_valid(self) -> bool:
50
- if self._error_network is None:
51
- raise Exception("invalid usage: must query server")
52
- return self._error_network
@@ -7,8 +7,6 @@ from typing import TYPE_CHECKING, Any, List, Optional
7
7
 
8
8
  from wandb.proto import wandb_server_pb2 as spb
9
9
 
10
- from . import tracelog
11
-
12
10
  if TYPE_CHECKING:
13
11
  from wandb.proto import wandb_internal_pb2 as pb
14
12
 
@@ -145,7 +143,6 @@ class SockClient:
145
143
  time.sleep(self._retry_delay - delta_time)
146
144
 
147
145
  def _send_message(self, msg: Any) -> None:
148
- tracelog.log_message_send(msg, self._sockid)
149
146
  raw_size = msg.ByteSize()
150
147
  data = msg.SerializeToString()
151
148
  assert len(data) == raw_size, "invalid serialization"
@@ -280,7 +277,6 @@ class SockClient:
280
277
  return None
281
278
  rec = spb.ServerRequest()
282
279
  rec.ParseFromString(data)
283
- tracelog.log_message_recv(rec, self._sockid)
284
280
  return rec
285
281
 
286
282
  def read_server_response(
@@ -291,5 +287,4 @@ class SockClient:
291
287
  return None
292
288
  rec = spb.ServerResponse()
293
289
  rec.ParseFromString(data)
294
- tracelog.log_message_recv(rec, self._sockid)
295
290
  return rec
@@ -10,7 +10,6 @@ from typing import Optional
10
10
 
11
11
  import wandb
12
12
 
13
- from ..lib import tracelog
14
13
  from . import _startup_debug, port_file
15
14
  from .server_sock import SocketServer
16
15
  from .streams import StreamMux
@@ -69,22 +68,15 @@ class WandbServer:
69
68
  if self._sock_server:
70
69
  self._sock_server.stop()
71
70
 
72
- def _setup_tracelog(self) -> None:
73
- # TODO: remove this temporary hack, need to find a better way to pass settings
74
- # to the server. for now lets just look at the environment variable we need
75
- tracelog_mode = os.environ.get("WANDB_TRACELOG")
76
- if tracelog_mode:
77
- tracelog.enable(tracelog_mode)
78
-
79
71
  def _startup_debug_print(self, message: str) -> None:
80
72
  if not self._startup_debug_enabled:
81
73
  return
82
74
  _startup_debug.print_message(message)
83
75
 
84
76
  def _setup_proctitle(self, sock_port: Optional[int]) -> None:
85
- # TODO: similar to _setup_tracelog, the internal_process should have
86
- # a better way to have access to settings.
87
- disable_setproctitle = os.environ.get("WANDB__DISABLE_SETPROCTITLE")
77
+ # TODO: the internal_process should have a better way to have access to
78
+ # settings.
79
+ disable_setproctitle = os.environ.get("WANDB_X_DISABLE_SETPROCTITLE")
88
80
  if disable_setproctitle:
89
81
  return
90
82
 
@@ -103,7 +95,6 @@ class WandbServer:
103
95
  self._startup_debug_print("after_setproctitle")
104
96
 
105
97
  def serve(self) -> None:
106
- self._setup_tracelog()
107
98
  mux = StreamMux()
108
99
  self._startup_debug_print("before_network")
109
100
  sock_port = self._start_sock(mux=mux)
@@ -7,7 +7,6 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, Optional
7
7
  from wandb.proto import wandb_server_pb2 as spb
8
8
  from wandb.sdk.internal.settings_static import SettingsStatic
9
9
 
10
- from ..lib import tracelog
11
10
  from ..lib.sock_client import SockClient, SockClientClosedError
12
11
  from .streams import StreamMux
13
12
 
@@ -65,7 +64,6 @@ class SockServerInterfaceReaderThread(threading.Thread):
65
64
  except ValueError:
66
65
  # queue is closed
67
66
  break
68
- tracelog.log_message_dequeue(result, self._iface.relay_q)
69
67
  sockid = result.control.relay_id
70
68
  assert sockid
71
69
  sock_client = self._clients.get_client(sockid)
@@ -76,7 +76,7 @@ class _Service:
76
76
  ServiceStartProcessError: If the service process exits unexpectedly.
77
77
 
78
78
  """
79
- time_max = time.monotonic() + self._settings._service_wait
79
+ time_max = time.monotonic() + self._settings.x_service_wait
80
80
  while time.monotonic() < time_max:
81
81
  if proc and proc.poll():
82
82
  # process finished
@@ -97,7 +97,7 @@ class _Service:
97
97
  f"The wandb service process exited with {proc.returncode}. "
98
98
  "Ensure that `sys.executable` is a valid python interpreter. "
99
99
  "You can override it with the `_executable` setting "
100
- "or with the `WANDB__EXECUTABLE` environment variable."
100
+ "or with the `WANDB_X_EXECUTABLE` environment variable."
101
101
  f"\n{context}",
102
102
  context=context,
103
103
  )
@@ -120,7 +120,7 @@ class _Service:
120
120
  return
121
121
  raise ServiceStartTimeoutError(
122
122
  "Timed out waiting for wandb service to start after "
123
- f"{self._settings._service_wait} seconds. "
123
+ f"{self._settings.x_service_wait} seconds. "
124
124
  "Try increasing the timeout with the `_service_wait` setting."
125
125
  )
126
126
 
@@ -143,7 +143,7 @@ class _Service:
143
143
  with tempfile.TemporaryDirectory() as tmpdir:
144
144
  fname = os.path.join(tmpdir, f"port-{pid}.txt")
145
145
 
146
- executable = self._settings._executable
146
+ executable = self._settings.x_executable
147
147
  exec_cmd_list = [executable, "-m"]
148
148
 
149
149
  service_args = []
@@ -212,7 +212,7 @@ class _Service:
212
212
 
213
213
  try:
214
214
  internal_proc = subprocess.Popen(
215
- exec_cmd_list + service_args,
215
+ exec_cmd_list + service_args, # type: ignore[arg-type]
216
216
  env=os.environ,
217
217
  **kwargs,
218
218
  )