wandb 0.18.0rc1__py3-none-win32.whl → 0.18.2__py3-none-win32.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. wandb/__init__.py +4 -4
  2. wandb/__init__.pyi +67 -12
  3. wandb/apis/internal.py +3 -0
  4. wandb/apis/public/api.py +128 -2
  5. wandb/apis/public/artifacts.py +11 -7
  6. wandb/apis/public/jobs.py +8 -0
  7. wandb/apis/public/runs.py +18 -5
  8. wandb/bin/wandb-core +0 -0
  9. wandb/cli/cli.py +0 -5
  10. wandb/data_types.py +9 -2019
  11. wandb/env.py +0 -5
  12. wandb/errors/__init__.py +11 -40
  13. wandb/errors/errors.py +37 -0
  14. wandb/errors/warnings.py +2 -0
  15. wandb/{sklearn → integration/sklearn}/calculate/calibration_curves.py +7 -7
  16. wandb/{sklearn → integration/sklearn}/calculate/class_proportions.py +1 -1
  17. wandb/{sklearn → integration/sklearn}/calculate/confusion_matrix.py +3 -2
  18. wandb/{sklearn → integration/sklearn}/calculate/elbow_curve.py +6 -6
  19. wandb/{sklearn → integration/sklearn}/calculate/learning_curve.py +2 -2
  20. wandb/{sklearn → integration/sklearn}/calculate/outlier_candidates.py +2 -2
  21. wandb/{sklearn → integration/sklearn}/calculate/residuals.py +8 -8
  22. wandb/{sklearn → integration/sklearn}/calculate/silhouette.py +2 -2
  23. wandb/{sklearn → integration/sklearn}/calculate/summary_metrics.py +2 -2
  24. wandb/{sklearn → integration/sklearn}/plot/classifier.py +5 -5
  25. wandb/{sklearn → integration/sklearn}/plot/clusterer.py +10 -6
  26. wandb/{sklearn → integration/sklearn}/plot/regressor.py +5 -5
  27. wandb/{sklearn → integration/sklearn}/plot/shared.py +3 -3
  28. wandb/{sklearn → integration/sklearn}/utils.py +8 -8
  29. wandb/integration/tensorboard/log.py +1 -1
  30. wandb/{wandb_torch.py → integration/torch/wandb_torch.py} +36 -32
  31. wandb/old/core.py +2 -80
  32. wandb/plot/bar.py +7 -4
  33. wandb/plot/confusion_matrix.py +5 -4
  34. wandb/plot/histogram.py +7 -4
  35. wandb/plot/line.py +7 -4
  36. wandb/proto/v3/wandb_base_pb2.py +2 -1
  37. wandb/proto/v3/wandb_internal_pb2.py +2 -1
  38. wandb/proto/v3/wandb_server_pb2.py +2 -1
  39. wandb/proto/v3/wandb_settings_pb2.py +3 -2
  40. wandb/proto/v3/wandb_telemetry_pb2.py +2 -1
  41. wandb/proto/v4/wandb_base_pb2.py +2 -1
  42. wandb/proto/v4/wandb_internal_pb2.py +2 -1
  43. wandb/proto/v4/wandb_server_pb2.py +2 -1
  44. wandb/proto/v4/wandb_settings_pb2.py +3 -2
  45. wandb/proto/v4/wandb_telemetry_pb2.py +2 -1
  46. wandb/proto/v5/wandb_base_pb2.py +3 -2
  47. wandb/proto/v5/wandb_internal_pb2.py +3 -2
  48. wandb/proto/v5/wandb_server_pb2.py +3 -2
  49. wandb/proto/v5/wandb_settings_pb2.py +4 -3
  50. wandb/proto/v5/wandb_telemetry_pb2.py +3 -2
  51. wandb/sdk/artifacts/_validators.py +48 -3
  52. wandb/sdk/artifacts/artifact.py +157 -183
  53. wandb/sdk/artifacts/artifact_file_cache.py +13 -11
  54. wandb/sdk/artifacts/artifact_instance_cache.py +4 -2
  55. wandb/sdk/artifacts/artifact_manifest.py +13 -11
  56. wandb/sdk/artifacts/artifact_manifest_entry.py +24 -22
  57. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +9 -7
  58. wandb/sdk/artifacts/artifact_saver.py +27 -25
  59. wandb/sdk/artifacts/exceptions.py +26 -25
  60. wandb/sdk/artifacts/storage_handler.py +11 -9
  61. wandb/sdk/artifacts/storage_handlers/azure_handler.py +16 -14
  62. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +15 -13
  63. wandb/sdk/artifacts/storage_handlers/http_handler.py +15 -14
  64. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +10 -8
  65. wandb/sdk/artifacts/storage_handlers/multi_handler.py +14 -12
  66. wandb/sdk/artifacts/storage_handlers/s3_handler.py +19 -19
  67. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +10 -8
  68. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +12 -10
  69. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +9 -7
  70. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +31 -29
  71. wandb/sdk/artifacts/storage_policy.py +20 -20
  72. wandb/sdk/backend/backend.py +8 -26
  73. wandb/sdk/data_types/audio.py +165 -0
  74. wandb/sdk/data_types/base_types/wb_value.py +1 -3
  75. wandb/sdk/data_types/bokeh.py +70 -0
  76. wandb/sdk/data_types/graph.py +405 -0
  77. wandb/sdk/data_types/image.py +156 -0
  78. wandb/sdk/data_types/table.py +1204 -0
  79. wandb/sdk/data_types/trace_tree.py +2 -2
  80. wandb/sdk/data_types/utils.py +49 -0
  81. wandb/sdk/data_types/video.py +2 -2
  82. wandb/sdk/interface/interface.py +0 -24
  83. wandb/sdk/interface/interface_shared.py +0 -12
  84. wandb/sdk/internal/handler.py +0 -10
  85. wandb/sdk/internal/internal_api.py +71 -0
  86. wandb/sdk/internal/sender.py +0 -43
  87. wandb/sdk/internal/tb_watcher.py +1 -1
  88. wandb/sdk/lib/_settings_toposort_generated.py +1 -0
  89. wandb/sdk/lib/hashutil.py +34 -12
  90. wandb/sdk/lib/service_connection.py +216 -0
  91. wandb/sdk/lib/service_token.py +94 -0
  92. wandb/sdk/lib/sock_client.py +7 -3
  93. wandb/sdk/service/server.py +2 -5
  94. wandb/sdk/service/service.py +2 -31
  95. wandb/sdk/service/streams.py +0 -7
  96. wandb/sdk/wandb_init.py +42 -25
  97. wandb/sdk/wandb_run.py +18 -159
  98. wandb/sdk/wandb_settings.py +2 -0
  99. wandb/sdk/wandb_setup.py +25 -16
  100. wandb/sdk/wandb_sync.py +9 -3
  101. wandb/sdk/wandb_watch.py +31 -15
  102. wandb/sklearn.py +35 -0
  103. wandb/util.py +14 -3
  104. {wandb-0.18.0rc1.dist-info → wandb-0.18.2.dist-info}/METADATA +6 -5
  105. {wandb-0.18.0rc1.dist-info → wandb-0.18.2.dist-info}/RECORD +114 -110
  106. wandb/sdk/internal/update.py +0 -113
  107. wandb/sdk/lib/console.py +0 -39
  108. wandb/sdk/service/service_base.py +0 -50
  109. wandb/sdk/service/service_sock.py +0 -70
  110. wandb/sdk/wandb_manager.py +0 -232
  111. /wandb/{sklearn → integration/sklearn}/__init__.py +0 -0
  112. /wandb/{sklearn → integration/sklearn}/calculate/__init__.py +0 -0
  113. /wandb/{sklearn → integration/sklearn}/calculate/decision_boundaries.py +0 -0
  114. /wandb/{sklearn → integration/sklearn}/calculate/feature_importances.py +0 -0
  115. /wandb/{sklearn → integration/sklearn}/plot/__init__.py +0 -0
  116. /wandb/{sdk/lib → plot}/viz.py +0 -0
  117. {wandb-0.18.0rc1.dist-info → wandb-0.18.2.dist-info}/WHEEL +0 -0
  118. {wandb-0.18.0rc1.dist-info → wandb-0.18.2.dist-info}/entry_points.txt +0 -0
  119. {wandb-0.18.0rc1.dist-info → wandb-0.18.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,94 @@
1
+ from __future__ import annotations
2
+
3
+ import dataclasses
4
+ import os
5
+
6
+ from wandb import env
7
+
8
+ _CURRENT_VERSION = "2"
9
+ _SUPPORTED_TRANSPORTS = "tcp"
10
+
11
+
12
+ def get_service_token() -> ServiceToken | None:
13
+ """Reads the token from environment variables.
14
+
15
+ Returns:
16
+ The token if the correct environment variable is set, or None.
17
+
18
+ Raises:
19
+ ValueError: If the environment variable is set but cannot be
20
+ parsed.
21
+ """
22
+ token = os.environ.get(env.SERVICE)
23
+ if not token:
24
+ return None
25
+
26
+ parts = token.split("-")
27
+ if len(parts) != 5:
28
+ raise ValueError(f"Invalid token: {token}")
29
+
30
+ version, pid_str, transport, host, port_str = parts
31
+
32
+ if version != _CURRENT_VERSION:
33
+ raise ValueError(
34
+ f"Expected version {_CURRENT_VERSION},"
35
+ f" but got {version} (token={token})"
36
+ )
37
+ if transport not in _SUPPORTED_TRANSPORTS:
38
+ raise ValueError(
39
+ f"Unsupported transport: {transport} (token={token})",
40
+ )
41
+
42
+ try:
43
+ return ServiceToken(
44
+ version=version,
45
+ pid=int(pid_str),
46
+ transport=transport,
47
+ host=host,
48
+ port=int(port_str),
49
+ )
50
+ except ValueError as e:
51
+ raise ValueError(f"Invalid token: {token}") from e
52
+
53
+
54
+ def set_service_token(parent_pid: int, transport: str, host: str, port: int) -> None:
55
+ """Stores a service token in an environment variable.
56
+
57
+ Args:
58
+ parent_pid: The process ID of the process that started the service.
59
+ transport: The transport used to communicate with the service.
60
+ host: The host part of the internet address on which the service
61
+ is listening (e.g. localhost).
62
+ port: The port the service is listening on.
63
+
64
+ Raises:
65
+ ValueError: If given an unsupported transport.
66
+ """
67
+ if transport not in _SUPPORTED_TRANSPORTS:
68
+ raise ValueError(f"Unsupported transport: {transport}")
69
+
70
+ os.environ[env.SERVICE] = "-".join(
71
+ (
72
+ _CURRENT_VERSION,
73
+ str(parent_pid),
74
+ transport,
75
+ host,
76
+ str(port),
77
+ )
78
+ )
79
+
80
+
81
+ def clear_service_token() -> None:
82
+ """Clears the environment variable storing the service token."""
83
+ os.environ.pop(env.SERVICE, None)
84
+
85
+
86
+ @dataclasses.dataclass(frozen=True)
87
+ class ServiceToken:
88
+ """An identifier for a running service process."""
89
+
90
+ version: str
91
+ pid: int
92
+ transport: str
93
+ host: str
94
+ port: int
@@ -14,9 +14,11 @@ if TYPE_CHECKING:
14
14
 
15
15
 
16
16
  class SockClientClosedError(Exception):
17
- """Socket has been closed."""
17
+ """Raised on operations on a closed socket."""
18
18
 
19
- pass
19
+
20
+ class SockClientTimeoutError(Exception):
21
+ """Raised if the server didn't respond before the timeout."""
20
22
 
21
23
 
22
24
  class SockBuffer:
@@ -182,8 +184,10 @@ class SockClient:
182
184
  # it should be relatively stable.
183
185
  # This pass would be solved as part of the fix in https://wandb.atlassian.net/browse/WB-8709
184
186
  response = self.read_server_response(timeout=1)
187
+
185
188
  if response is None:
186
- raise Exception("No response")
189
+ raise SockClientTimeoutError("No response after 1 second.")
190
+
187
191
  return response
188
192
 
189
193
  def send(
@@ -20,7 +20,6 @@ class WandbServer:
20
20
  _pid: Optional[int]
21
21
  _sock_port: Optional[int]
22
22
  _debug: bool
23
- _serve_sock: bool
24
23
  _sock_server: Optional[SocketServer]
25
24
  _startup_debug_enabled: bool
26
25
 
@@ -31,14 +30,12 @@ class WandbServer:
31
30
  address: Optional[str] = None,
32
31
  pid: Optional[int] = None,
33
32
  debug: bool = True,
34
- serve_sock: bool = False,
35
33
  ) -> None:
36
34
  self._sock_port = sock_port
37
35
  self._port_fname = port_fname
38
36
  self._address = address
39
37
  self._pid = pid
40
38
  self._debug = debug
41
- self._serve_sock = serve_sock
42
39
  self._sock_server = None
43
40
  self._startup_debug_enabled = _startup_debug.is_enabled()
44
41
 
@@ -97,7 +94,7 @@ class WandbServer:
97
94
  pid = str(self._pid or 0)
98
95
  transport = "s" if sock_port else "g"
99
96
  port = sock_port or 0
100
- # this format is similar to wandb_manager token, but it's purely informative now
97
+ # this format is similar to the service token, but it's purely informative now
101
98
  # (consider unifying this in the future)
102
99
  service_id = f"{service_ver}-{pid}-{transport}-{port}"
103
100
  proc_title = f"wandb-service({service_id})"
@@ -109,7 +106,7 @@ class WandbServer:
109
106
  self._setup_tracelog()
110
107
  mux = StreamMux()
111
108
  self._startup_debug_print("before_network")
112
- sock_port = self._start_sock(mux=mux) if self._serve_sock else None
109
+ sock_port = self._start_sock(mux=mux)
113
110
  self._startup_debug_print("after_network")
114
111
  self._inform_used_ports(sock_port=sock_port)
115
112
  self._startup_debug_print("after_inform")
@@ -15,18 +15,12 @@ import time
15
15
  from typing import TYPE_CHECKING, Any, Dict, Optional
16
16
 
17
17
  from wandb import _sentry, termlog
18
- from wandb.env import (
19
- core_debug,
20
- core_error_reporting_enabled,
21
- is_require_legacy_service,
22
- )
18
+ from wandb.env import core_debug, error_reporting_enabled, is_require_legacy_service
23
19
  from wandb.errors import Error, WandbCoreNotAvailableError
24
20
  from wandb.sdk.lib.wburls import wburls
25
21
  from wandb.util import get_core_path, get_module
26
22
 
27
23
  from . import _startup_debug, port_file
28
- from .service_base import ServiceInterface
29
- from .service_sock import ServiceSockInterface
30
24
 
31
25
  if TYPE_CHECKING:
32
26
  from wandb.sdk.wandb_settings import Settings
@@ -35,25 +29,18 @@ if TYPE_CHECKING:
35
29
  class ServiceStartProcessError(Error):
36
30
  """Raised when a known error occurs when launching wandb service."""
37
31
 
38
- pass
39
-
40
32
 
41
33
  class ServiceStartTimeoutError(Error):
42
34
  """Raised when service start times out."""
43
35
 
44
- pass
45
-
46
36
 
47
37
  class ServiceStartPortError(Error):
48
38
  """Raised when service start fails to find a port."""
49
39
 
50
- pass
51
-
52
40
 
53
41
  class _Service:
54
42
  _settings: "Settings"
55
43
  _sock_port: Optional[int]
56
- _service_interface: ServiceInterface
57
44
  _internal_proc: Optional[subprocess.Popen]
58
45
  _startup_debug_enabled: bool
59
46
 
@@ -69,10 +56,6 @@ class _Service:
69
56
 
70
57
  _sentry.configure_scope(tags=dict(settings), process_context="service")
71
58
 
72
- # current code only supports socket server implementation, in the
73
- # future we might be able to support both
74
- self._service_interface = ServiceSockInterface()
75
-
76
59
  def _startup_debug_print(self, message: str) -> None:
77
60
  if not self._startup_debug_enabled:
78
61
  return
@@ -162,9 +145,6 @@ class _Service:
162
145
 
163
146
  executable = self._settings._executable
164
147
  exec_cmd_list = [executable, "-m"]
165
- # Add coverage collection if needed
166
- if os.environ.get("YEA_RUN_COVERAGE") and os.environ.get("COVERAGE_RCFILE"):
167
- exec_cmd_list += ["coverage", "run", "-m"]
168
148
 
169
149
  service_args = []
170
150
 
@@ -176,16 +156,12 @@ class _Service:
176
156
 
177
157
  service_args.extend([core_path])
178
158
 
179
- if not core_error_reporting_enabled(default="True"):
159
+ if not error_reporting_enabled():
180
160
  service_args.append("--no-observability")
181
161
 
182
162
  if core_debug(default="False"):
183
163
  service_args.append("--debug")
184
164
 
185
- trace_filename = os.environ.get("_WANDB_TRACE")
186
- if trace_filename is not None:
187
- service_args.extend(["--trace", trace_filename])
188
-
189
165
  exec_cmd_list = []
190
166
  termlog(
191
167
  "Using wandb-core as the SDK backend."
@@ -201,7 +177,6 @@ class _Service:
201
177
  "--pid",
202
178
  pid,
203
179
  ]
204
- service_args.append("--serve-sock")
205
180
 
206
181
  if os.environ.get("WANDB_SERVICE_PROFILE") == "memray":
207
182
  _ = get_module(
@@ -260,10 +235,6 @@ class _Service:
260
235
  def sock_port(self) -> Optional[int]:
261
236
  return self._sock_port
262
237
 
263
- @property
264
- def service_interface(self) -> ServiceInterface:
265
- return self._service_interface
266
-
267
238
  def join(self) -> int:
268
239
  ret = 0
269
240
  if self._internal_proc:
@@ -317,7 +317,6 @@ class StreamMux:
317
317
  # These could be done in parallel in the future
318
318
  for _sid, stream in started_streams.items():
319
319
  # dispatch all our final requests
320
- server_info_handle = stream.interface.deliver_request_server_info()
321
320
  poll_exit_handle = stream.interface.deliver_poll_exit()
322
321
  final_summary_handle = stream.interface.deliver_get_summary()
323
322
  sampled_history_handle = stream.interface.deliver_request_sampled_history()
@@ -327,11 +326,6 @@ class StreamMux:
327
326
  assert result
328
327
  internal_messages_response = result.response.internal_messages_response
329
328
 
330
- # wait for them, it's ok to do this serially but this can be improved
331
- result = server_info_handle.wait(timeout=-1)
332
- assert result
333
- server_info_response = result.response.server_info_response
334
-
335
329
  result = poll_exit_handle.wait(timeout=-1)
336
330
  assert result
337
331
  poll_exit_response = result.response.poll_exit_response
@@ -348,7 +342,6 @@ class StreamMux:
348
342
  sampled_history=sampled_history,
349
343
  final_summary=final_summary,
350
344
  poll_exit_response=poll_exit_response,
351
- server_info_response=server_info_response,
352
345
  internal_messages_response=internal_messages_response,
353
346
  settings=stream._settings, # type: ignore
354
347
  printer=printer,
wandb/sdk/wandb_init.py CHANGED
@@ -174,12 +174,19 @@ class _WandbInit:
174
174
 
175
175
  # we add this logic to be backward compatible with the old behavior of disable
176
176
  # where it would disable the service if the mode was set to disabled
177
+ # TODO: use the regular settins object to handle this
177
178
  mode = kwargs.get("mode")
178
179
  settings_mode = (kwargs.get("settings") or {}).get("mode") or os.environ.get(
179
- "WANDB_MODE"
180
+ wandb.env.MODE
180
181
  )
181
- _disable_service = mode == "disabled" or settings_mode == "disabled"
182
- setup_settings = {"_disable_service": _disable_service}
182
+ settings__disable_service = (kwargs.get("settings") or {}).get(
183
+ "_disable_service"
184
+ ) or os.environ.get(wandb.env._DISABLE_SERVICE)
185
+
186
+ setup_settings = {
187
+ "mode": mode or settings_mode,
188
+ "_disable_service": settings__disable_service,
189
+ }
183
190
 
184
191
  self._wl = wandb_setup.setup(settings=setup_settings)
185
192
  # Make sure we have a logger setup (might be an early logger)
@@ -648,9 +655,9 @@ class _WandbInit:
648
655
  f"Successfully finished last run (ID:{latest_run._run_id}). Initializing new run:<br/>"
649
656
  )
650
657
  elif isinstance(wandb.run, Run):
651
- manager = self._wl._get_manager()
658
+ service = self._wl.service
652
659
  # We shouldn't return a stale global run if we are in a new pid
653
- if not manager or os.getpid() == wandb.run._init_pid:
660
+ if not service or os.getpid() == wandb.run._init_pid:
654
661
  logger.info("wandb.init() called when a run is still active")
655
662
  with telemetry.context() as tel:
656
663
  tel.feature.init_return_run = True
@@ -658,15 +665,20 @@ class _WandbInit:
658
665
 
659
666
  logger.info("starting backend")
660
667
 
661
- manager = self._wl._get_manager()
662
- if manager:
663
- logger.info("setting up manager")
664
- manager._inform_init(
665
- settings=self.settings.to_proto(), run_id=self.settings.run_id
668
+ service = self._wl.service
669
+ if service:
670
+ logger.info("sending inform_init request")
671
+ service.inform_init(
672
+ settings=self.settings.to_proto(),
673
+ run_id=self.settings.run_id,
666
674
  )
667
675
 
668
676
  mailbox = Mailbox()
669
- backend = Backend(settings=self.settings, manager=manager, mailbox=mailbox)
677
+ backend = Backend(
678
+ settings=self.settings,
679
+ service=service,
680
+ mailbox=mailbox,
681
+ )
670
682
  backend.ensure_launched()
671
683
  logger.info("backend started and connected")
672
684
  # Make sure we are logged in
@@ -732,7 +744,7 @@ class _WandbInit:
732
744
  if os.environ.get(wandb.env._DISABLE_SERVICE):
733
745
  tel.feature.service_disabled = True
734
746
 
735
- if manager:
747
+ if service:
736
748
  tel.feature.service = True
737
749
  if self.settings._flow_control_disabled:
738
750
  tel.feature.flow_control_disabled = True
@@ -823,7 +835,7 @@ class _WandbInit:
823
835
 
824
836
  if error is not None:
825
837
  logger.error(f"encountered error: {error}")
826
- if not manager:
838
+ if not service:
827
839
  # Shutdown the backend and get rid of the logger
828
840
  # we don't need to do console cleanup at this point
829
841
  backend.cleanup()
@@ -850,9 +862,10 @@ class _WandbInit:
850
862
  logger.info("starting run threads in backend")
851
863
  # initiate run (stats and metadata probing)
852
864
 
853
- if manager:
854
- manager._inform_start(
855
- settings=self.settings.to_proto(), run_id=self.settings.run_id
865
+ if service:
866
+ service.inform_start(
867
+ settings=self.settings.to_proto(),
868
+ run_id=self.settings.run_id,
856
869
  )
857
870
 
858
871
  assert backend.interface
@@ -927,33 +940,37 @@ def _attach(
927
940
  if logger is None:
928
941
  raise UsageError("logger is not initialized")
929
942
 
930
- manager = _wl._get_manager()
931
- response = manager._inform_attach(attach_id=attach_id) if manager else None
932
- if response is None:
933
- raise UsageError(f"Unable to attach to run {attach_id}")
943
+ service = _wl.service
944
+ if not service:
945
+ raise UsageError(f"Unable to attach to run {attach_id} (no service process)")
946
+
947
+ try:
948
+ attach_settings = service.inform_attach(attach_id=attach_id)
949
+ except Exception as e:
950
+ raise UsageError(f"Unable to attach to run {attach_id}") from e
934
951
 
935
952
  settings: Settings = copy.copy(_wl._settings)
936
953
 
937
954
  settings.update(
938
955
  {
939
956
  "run_id": attach_id,
940
- "_start_time": response._start_time.value,
941
- "_start_datetime": response._start_datetime.value,
942
- "_offline": response._offline.value,
957
+ "_start_time": attach_settings._start_time.value,
958
+ "_start_datetime": attach_settings._start_datetime.value,
959
+ "_offline": attach_settings._offline.value,
943
960
  },
944
961
  source=Source.INIT,
945
962
  )
946
963
 
947
964
  # TODO: consolidate this codepath with wandb.init()
948
965
  mailbox = Mailbox()
949
- backend = Backend(settings=settings, manager=manager, mailbox=mailbox)
966
+ backend = Backend(settings=settings, service=service, mailbox=mailbox)
950
967
  backend.ensure_launched()
951
968
  logger.info("attach backend started and connected")
952
969
 
953
970
  if run is None:
954
971
  run = Run(settings=settings)
955
972
  else:
956
- run._init()
973
+ run._init(settings=settings)
957
974
  run._set_library(_wl)
958
975
  run._set_backend(backend)
959
976
  backend._hack_set_run(run)