wandb 0.16.5__py3-none-any.whl → 0.17.0rc1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. package_readme.md +95 -0
  2. wandb/__init__.py +2 -2
  3. wandb/agents/pyagent.py +0 -1
  4. wandb/analytics/sentry.py +2 -1
  5. wandb/apis/importers/internals/protocols.py +30 -56
  6. wandb/apis/importers/mlflow.py +13 -26
  7. wandb/apis/importers/wandb.py +8 -14
  8. wandb/apis/public/api.py +1 -0
  9. wandb/apis/public/artifacts.py +1 -0
  10. wandb/apis/public/files.py +1 -0
  11. wandb/apis/public/history.py +1 -0
  12. wandb/apis/public/jobs.py +1 -0
  13. wandb/apis/public/projects.py +1 -0
  14. wandb/apis/public/reports.py +1 -0
  15. wandb/apis/public/runs.py +1 -0
  16. wandb/apis/public/sweeps.py +1 -0
  17. wandb/apis/public/teams.py +1 -0
  18. wandb/apis/public/users.py +1 -0
  19. wandb/apis/reports/v1/_blocks.py +2 -6
  20. wandb/apis/reports/v2/gql.py +1 -0
  21. wandb/apis/reports/v2/interface.py +3 -4
  22. wandb/apis/reports/v2/internal.py +5 -8
  23. wandb/cli/cli.py +7 -4
  24. wandb/data_types.py +3 -3
  25. wandb/env.py +35 -5
  26. wandb/errors/__init__.py +5 -0
  27. wandb/integration/catboost/catboost.py +1 -1
  28. wandb/integration/fastai/__init__.py +1 -0
  29. wandb/integration/keras/__init__.py +1 -0
  30. wandb/integration/keras/keras.py +6 -6
  31. wandb/integration/langchain/wandb_tracer.py +1 -0
  32. wandb/integration/lightning/fabric/logger.py +1 -3
  33. wandb/integration/metaflow/metaflow.py +41 -6
  34. wandb/integration/openai/fine_tuning.py +77 -40
  35. wandb/keras/__init__.py +1 -0
  36. wandb/proto/v3/wandb_internal_pb2.py +364 -332
  37. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  38. wandb/proto/v4/wandb_internal_pb2.py +322 -316
  39. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  40. wandb/proto/wandb_internal_codegen.py +0 -25
  41. wandb/sdk/artifacts/artifact.py +41 -13
  42. wandb/sdk/artifacts/artifact_download_logger.py +1 -0
  43. wandb/sdk/artifacts/artifact_file_cache.py +18 -4
  44. wandb/sdk/artifacts/artifact_instance_cache.py +1 -0
  45. wandb/sdk/artifacts/artifact_manifest.py +1 -0
  46. wandb/sdk/artifacts/artifact_manifest_entry.py +1 -0
  47. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +1 -0
  48. wandb/sdk/artifacts/artifact_saver.py +21 -21
  49. wandb/sdk/artifacts/artifact_state.py +1 -0
  50. wandb/sdk/artifacts/artifact_ttl.py +1 -0
  51. wandb/sdk/artifacts/exceptions.py +1 -0
  52. wandb/sdk/artifacts/storage_handlers/azure_handler.py +1 -0
  53. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +13 -18
  54. wandb/sdk/artifacts/storage_handlers/http_handler.py +1 -0
  55. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +1 -0
  56. wandb/sdk/artifacts/storage_handlers/multi_handler.py +1 -0
  57. wandb/sdk/artifacts/storage_handlers/s3_handler.py +5 -3
  58. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +1 -0
  59. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +1 -0
  60. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -0
  61. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +1 -0
  62. wandb/sdk/artifacts/storage_policy.py +1 -0
  63. wandb/sdk/data_types/base_types/media.py +3 -6
  64. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +3 -1
  65. wandb/sdk/integration_utils/auto_logging.py +5 -6
  66. wandb/sdk/integration_utils/data_logging.py +5 -1
  67. wandb/sdk/interface/interface.py +72 -37
  68. wandb/sdk/interface/interface_shared.py +7 -13
  69. wandb/sdk/internal/datastore.py +1 -1
  70. wandb/sdk/internal/handler.py +18 -2
  71. wandb/sdk/internal/internal.py +0 -1
  72. wandb/sdk/internal/internal_util.py +0 -1
  73. wandb/sdk/internal/job_builder.py +4 -3
  74. wandb/sdk/internal/profiler.py +1 -0
  75. wandb/sdk/internal/run.py +1 -0
  76. wandb/sdk/internal/sender.py +1 -1
  77. wandb/sdk/internal/system/assets/gpu_amd.py +44 -44
  78. wandb/sdk/internal/system/assets/gpu_apple.py +56 -11
  79. wandb/sdk/internal/system/assets/interfaces.py +6 -8
  80. wandb/sdk/internal/system/assets/open_metrics.py +2 -2
  81. wandb/sdk/internal/system/assets/trainium.py +1 -3
  82. wandb/sdk/launch/_launch.py +5 -0
  83. wandb/sdk/launch/_project_spec.py +10 -23
  84. wandb/sdk/launch/agent/agent.py +81 -37
  85. wandb/sdk/launch/agent/config.py +80 -11
  86. wandb/sdk/launch/builder/abstract.py +1 -0
  87. wandb/sdk/launch/builder/build.py +28 -1
  88. wandb/sdk/launch/builder/docker_builder.py +1 -0
  89. wandb/sdk/launch/builder/kaniko_builder.py +149 -134
  90. wandb/sdk/launch/builder/noop.py +1 -0
  91. wandb/sdk/launch/create_job.py +61 -48
  92. wandb/sdk/launch/environment/abstract.py +1 -0
  93. wandb/sdk/launch/environment/gcp_environment.py +1 -0
  94. wandb/sdk/launch/environment/local_environment.py +1 -0
  95. wandb/sdk/launch/loader.py +1 -0
  96. wandb/sdk/launch/registry/abstract.py +1 -0
  97. wandb/sdk/launch/registry/azure_container_registry.py +1 -0
  98. wandb/sdk/launch/registry/elastic_container_registry.py +1 -0
  99. wandb/sdk/launch/registry/google_artifact_registry.py +1 -0
  100. wandb/sdk/launch/registry/local_registry.py +1 -0
  101. wandb/sdk/launch/runner/abstract.py +1 -0
  102. wandb/sdk/launch/runner/kubernetes_monitor.py +4 -1
  103. wandb/sdk/launch/runner/kubernetes_runner.py +4 -3
  104. wandb/sdk/launch/runner/sagemaker_runner.py +11 -10
  105. wandb/sdk/launch/sweeps/scheduler.py +4 -1
  106. wandb/sdk/launch/sweeps/scheduler_sweep.py +1 -0
  107. wandb/sdk/launch/sweeps/utils.py +1 -1
  108. wandb/sdk/launch/utils.py +21 -3
  109. wandb/sdk/lib/_settings_toposort_generated.py +1 -0
  110. wandb/sdk/lib/fsm.py +8 -12
  111. wandb/sdk/lib/gitlib.py +4 -4
  112. wandb/sdk/lib/lazyloader.py +0 -1
  113. wandb/sdk/lib/proto_util.py +1 -1
  114. wandb/sdk/lib/retry.py +3 -2
  115. wandb/sdk/lib/run_moment.py +7 -1
  116. wandb/sdk/service/service.py +17 -15
  117. wandb/sdk/verify/verify.py +2 -1
  118. wandb/sdk/wandb_init.py +2 -8
  119. wandb/sdk/wandb_manager.py +2 -2
  120. wandb/sdk/wandb_require.py +5 -0
  121. wandb/sdk/wandb_run.py +64 -46
  122. wandb/sdk/wandb_settings.py +2 -1
  123. wandb/sklearn/__init__.py +1 -0
  124. wandb/sklearn/plot/__init__.py +1 -0
  125. wandb/sklearn/plot/classifier.py +1 -0
  126. wandb/sklearn/plot/clusterer.py +1 -0
  127. wandb/sklearn/plot/regressor.py +1 -0
  128. wandb/sklearn/plot/shared.py +1 -0
  129. wandb/sklearn/utils.py +1 -0
  130. wandb/testing/relay.py +4 -4
  131. wandb/trigger.py +1 -0
  132. wandb/util.py +40 -17
  133. wandb/wandb_controller.py +0 -1
  134. wandb/wandb_torch.py +1 -2
  135. {wandb-0.16.5.dist-info → wandb-0.17.0rc1.dist-info}/METADATA +68 -69
  136. {wandb-0.16.5.dist-info → wandb-0.17.0rc1.dist-info}/RECORD +139 -140
  137. {wandb-0.16.5.dist-info → wandb-0.17.0rc1.dist-info}/WHEEL +1 -2
  138. wandb/bin/apple_gpu_stats +0 -0
  139. wandb-0.16.5.dist-info/top_level.txt +0 -1
  140. {wandb-0.16.5.dist-info → wandb-0.17.0rc1.dist-info}/entry_points.txt +0 -0
  141. {wandb-0.16.5.dist-info → wandb-0.17.0rc1.dist-info/licenses}/LICENSE +0 -0
@@ -1,4 +1,5 @@
1
1
  """Local registry implementation."""
2
+
2
3
  import logging
3
4
  from typing import Tuple
4
5
 
@@ -3,6 +3,7 @@
3
3
  This class defines the interface that the W&B launch runner uses to manage the lifecycle
4
4
  of runs launched in different environments (e.g. runs launched locally or in a cluster).
5
5
  """
6
+
6
7
  import logging
7
8
  import os
8
9
  import subprocess
@@ -1,4 +1,5 @@
1
1
  """Monitors kubernetes resources managed by the launch agent."""
2
+
2
3
  import asyncio
3
4
  import logging
4
5
  import sys
@@ -433,6 +434,8 @@ class SafeWatch:
433
434
  del kwargs["resource_version"]
434
435
  self._last_seen_resource_version = None
435
436
  except Exception as E:
437
+ exc_type = type(E).__name__
438
+ stack_trace = traceback.format_exc()
436
439
  wandb.termerror(
437
- f"Unknown exception in event stream: {E}, attempting to recover"
440
+ f"Unknown exception in event stream of type {exc_type}: {E}, attempting to recover. Stack trace: {stack_trace}"
438
441
  )
@@ -1,4 +1,5 @@
1
1
  """Implementation of KubernetesRunner class for wandb launch."""
2
+
2
3
  import asyncio
3
4
  import base64
4
5
  import datetime
@@ -539,9 +540,9 @@ class KubernetesRunner(AbstractRunner):
539
540
  WANDB_K8S_LABEL_MONITOR,
540
541
  LaunchAgent.name(),
541
542
  )
542
- resource_args["metadata"]["labels"][
543
- WANDB_K8S_LABEL_AGENT
544
- ] = LaunchAgent.name()
543
+ resource_args["metadata"]["labels"][WANDB_K8S_LABEL_AGENT] = (
544
+ LaunchAgent.name()
545
+ )
545
546
 
546
547
  overrides = {}
547
548
  if launch_project.override_args:
@@ -1,4 +1,5 @@
1
1
  """Implementation of the SageMakerRunner class."""
2
+
2
3
  import asyncio
3
4
  import logging
4
5
  from typing import Any, Dict, List, Optional, cast
@@ -324,16 +325,16 @@ def build_sagemaker_args(
324
325
  sagemaker_args["TrainingJobName"] = training_job_name
325
326
  entry_cmd = entry_point.command if entry_point else []
326
327
 
327
- sagemaker_args[
328
- "AlgorithmSpecification"
329
- ] = merge_image_uri_with_algorithm_specification(
330
- given_sagemaker_args.get(
331
- "AlgorithmSpecification",
332
- given_sagemaker_args.get("algorithm_specification"),
333
- ),
334
- image_uri,
335
- entry_cmd,
336
- args,
328
+ sagemaker_args["AlgorithmSpecification"] = (
329
+ merge_image_uri_with_algorithm_specification(
330
+ given_sagemaker_args.get(
331
+ "AlgorithmSpecification",
332
+ given_sagemaker_args.get("algorithm_specification"),
333
+ ),
334
+ image_uri,
335
+ entry_cmd,
336
+ args,
337
+ )
337
338
  )
338
339
 
339
340
  sagemaker_args["RoleArn"] = role_arn
@@ -1,4 +1,5 @@
1
1
  """Abstract Scheduler class."""
2
+
2
3
  import asyncio
3
4
  import base64
4
5
  import copy
@@ -157,7 +158,9 @@ class Scheduler(ABC):
157
158
  self._runs: Dict[str, SweepRun] = {}
158
159
  # Threading lock to ensure thread-safe access to the runs dictionary
159
160
  self._threading_lock: threading.Lock = threading.Lock()
160
- self._polling_sleep = polling_sleep or DEFAULT_POLLING_SLEEP
161
+ self._polling_sleep = (
162
+ polling_sleep if polling_sleep is not None else DEFAULT_POLLING_SLEEP
163
+ )
161
164
  self._project_queue = project_queue
162
165
  # Optionally run multiple workers in (pseudo-)parallel. Workers do not
163
166
  # actually run training workloads, they simply send heartbeat messages
@@ -1,4 +1,5 @@
1
1
  """Scheduler for classic wandb Sweeps."""
2
+
2
3
  import logging
3
4
  from pprint import pformat as pf
4
5
  from typing import Any, Dict, List, Optional
@@ -296,7 +296,7 @@ def check_job_exists(public_api: "PublicApi", job: Optional[str]) -> bool:
296
296
 
297
297
 
298
298
  def get_previous_args(
299
- run_spec: Dict[str, Any]
299
+ run_spec: Dict[str, Any],
300
300
  ) -> Tuple[Dict[str, Any], Dict[str, Any]]:
301
301
  """Parse through previous scheduler run_spec.
302
302
 
wandb/sdk/launch/utils.py CHANGED
@@ -57,15 +57,15 @@ API_KEY_REGEX = r"WANDB_API_KEY=\w+(-\w+)?"
57
57
  MACRO_REGEX = re.compile(r"\$\{(\w+)\}")
58
58
 
59
59
  AZURE_CONTAINER_REGISTRY_URI_REGEX = re.compile(
60
- r"(?:https://)?([\w]+)\.azurecr\.io/([\w\-]+):?(.*)"
60
+ r"^(?:https://)?([\w]+)\.azurecr\.io/(?P<repository>[\w\-]+):?(?P<tag>.*)"
61
61
  )
62
62
 
63
63
  ELASTIC_CONTAINER_REGISTRY_URI_REGEX = re.compile(
64
- r"^(?P<account>.*)\.dkr\.ecr\.(?P<region>.*)\.amazonaws\.com/(?P<repository>.*)/?$"
64
+ r"^(?:https://)?(?P<account>[\w-]+)\.dkr\.ecr\.(?P<region>[\w-]+)\.amazonaws\.com/(?P<repository>[\w-]+):?(?P<tag>.*)$"
65
65
  )
66
66
 
67
67
  GCP_ARTIFACT_REGISTRY_URI_REGEX = re.compile(
68
- r"^(?P<region>[\w-]+)-docker\.pkg\.dev/(?P<project>[\w-]+)/(?P<repository>[\w-]+)/(?P<image_name>[\w-]+)$",
68
+ r"^(?:https://)?(?P<region>[\w-]+)-docker\.pkg\.dev/(?P<project>[\w-]+)/(?P<repository>[\w-]+)/?(?P<image_name>[\w-]+)?(?P<tag>:.*)?$",
69
69
  re.IGNORECASE,
70
70
  )
71
71
 
@@ -846,3 +846,21 @@ def fetch_and_validate_template_variables(
846
846
  raise LaunchError(f"Value for {key} must be of type {field_type}.")
847
847
  template_variables[key] = val
848
848
  return template_variables
849
+
850
+
851
+ def get_entrypoint_file(entrypoint: List[str]) -> Optional[str]:
852
+ """Get the entrypoint file from the given command.
853
+
854
+ Args:
855
+ entrypoint (List[str]): List of command and arguments.
856
+
857
+ Returns:
858
+ Optional[str]: The entrypoint file if found, otherwise None.
859
+ """
860
+ if not entrypoint:
861
+ return None
862
+ if entrypoint[0].endswith(".py") or entrypoint[0].endswith(".sh"):
863
+ return entrypoint[0]
864
+ if len(entrypoint) < 2:
865
+ return None
866
+ return entrypoint[1]
@@ -22,6 +22,7 @@ _Setting = Literal[
22
22
  "_disable_service",
23
23
  "_disable_setproctitle",
24
24
  "_disable_stats",
25
+ "_disable_update_check",
25
26
  "_disable_viewer",
26
27
  "_disable_machine_info",
27
28
  "_except_exit",
wandb/sdk/lib/fsm.py CHANGED
@@ -52,43 +52,39 @@ T_FsmContext_contra = TypeVar("T_FsmContext_contra", contravariant=True)
52
52
  @runtime_checkable
53
53
  class FsmStateCheck(Protocol[T_FsmInputs]):
54
54
  @abstractmethod
55
- def on_check(self, inputs: T_FsmInputs) -> None:
56
- ... # pragma: no cover
55
+ def on_check(self, inputs: T_FsmInputs) -> None: ... # pragma: no cover
57
56
 
58
57
 
59
58
  @runtime_checkable
60
59
  class FsmStateOutput(Protocol[T_FsmInputs]):
61
60
  @abstractmethod
62
- def on_state(self, inputs: T_FsmInputs) -> None:
63
- ... # pragma: no cover
61
+ def on_state(self, inputs: T_FsmInputs) -> None: ... # pragma: no cover
64
62
 
65
63
 
66
64
  @runtime_checkable
67
65
  class FsmStateEnter(Protocol[T_FsmInputs]):
68
66
  @abstractmethod
69
- def on_enter(self, inputs: T_FsmInputs) -> None:
70
- ... # pragma: no cover
67
+ def on_enter(self, inputs: T_FsmInputs) -> None: ... # pragma: no cover
71
68
 
72
69
 
73
70
  @runtime_checkable
74
71
  class FsmStateEnterWithContext(Protocol[T_FsmInputs, T_FsmContext_contra]):
75
72
  @abstractmethod
76
- def on_enter(self, inputs: T_FsmInputs, context: T_FsmContext_contra) -> None:
77
- ... # pragma: no cover
73
+ def on_enter(
74
+ self, inputs: T_FsmInputs, context: T_FsmContext_contra
75
+ ) -> None: ... # pragma: no cover
78
76
 
79
77
 
80
78
  @runtime_checkable
81
79
  class FsmStateStay(Protocol[T_FsmInputs]):
82
80
  @abstractmethod
83
- def on_stay(self, inputs: T_FsmInputs) -> None:
84
- ... # pragma: no cover
81
+ def on_stay(self, inputs: T_FsmInputs) -> None: ... # pragma: no cover
85
82
 
86
83
 
87
84
  @runtime_checkable
88
85
  class FsmStateExit(Protocol[T_FsmInputs, T_FsmContext_cov]):
89
86
  @abstractmethod
90
- def on_exit(self, inputs: T_FsmInputs) -> T_FsmContext_cov:
91
- ... # pragma: no cover
87
+ def on_exit(self, inputs: T_FsmInputs) -> T_FsmContext_cov: ... # pragma: no cover
92
88
 
93
89
 
94
90
  # It would be nice if python provided optional protocol members, but it doesnt as described here:
wandb/sdk/lib/gitlib.py CHANGED
@@ -14,7 +14,7 @@ try:
14
14
  Repo,
15
15
  )
16
16
  except ImportError:
17
- Repo = None
17
+ Repo = None # type: ignore
18
18
 
19
19
  if TYPE_CHECKING:
20
20
  from git import Repo
@@ -121,7 +121,7 @@ class GitRepo:
121
121
  # TODO: Saw a user getting a Unicode decode error when parsing refs,
122
122
  # more details on implementing a real fix in [WB-4064]
123
123
  try:
124
- if len(self.repo.refs) > 0:
124
+ if len(self.repo.refs) > 0: # type: ignore[arg-type]
125
125
  return self.repo.head.commit.hexsha
126
126
  else:
127
127
  return self.repo.git.show_ref("--head").split(" ")[0]
@@ -140,7 +140,7 @@ class GitRepo:
140
140
  if not self.repo:
141
141
  return None
142
142
  try:
143
- return self.repo.remotes[self.remote_name]
143
+ return self.repo.remotes[self.remote_name] # type: ignore[index]
144
144
  except IndexError:
145
145
  return None
146
146
 
@@ -200,7 +200,7 @@ class GitRepo:
200
200
  possible_relatives.append(tracking_branch.commit)
201
201
 
202
202
  if not possible_relatives:
203
- for branch in self.repo.branches:
203
+ for branch in self.repo.branches: # type: ignore[attr-defined]
204
204
  tracking_branch = branch.tracking_branch()
205
205
  if tracking_branch is not None:
206
206
  possible_relatives.append(tracking_branch.commit)
@@ -1,6 +1,5 @@
1
1
  """module lazyloader."""
2
2
 
3
-
4
3
  import importlib
5
4
  import sys
6
5
  import types
@@ -29,7 +29,7 @@ def _assign_end_offset(record: "pb.Record", end_offset: int) -> None:
29
29
 
30
30
 
31
31
  def proto_encode_to_dict(
32
- pb_obj: Union["tpb.TelemetryRecord", "pb.MetricRecord"]
32
+ pb_obj: Union["tpb.TelemetryRecord", "pb.MetricRecord"],
33
33
  ) -> Dict[int, Any]:
34
34
  data: Dict[int, Any] = dict()
35
35
  fields = pb_obj.ListFields()
wandb/sdk/lib/retry.py CHANGED
@@ -248,8 +248,9 @@ class ExponentialBackoff(Backoff):
248
248
  if self._timeout_at is not None and NOW_FN() > self._timeout_at:
249
249
  raise exc
250
250
 
251
- result, self._next_sleep = self._next_sleep, min(
252
- self._max_sleep, self._next_sleep * (1 + random.random())
251
+ result, self._next_sleep = (
252
+ self._next_sleep,
253
+ min(self._max_sleep, self._next_sleep * (1 + random.random())),
253
254
  )
254
255
 
255
256
  return result
@@ -1,7 +1,13 @@
1
+ import sys
1
2
  from dataclasses import dataclass
2
- from typing import Literal, Union, cast
3
+ from typing import Union, cast
3
4
  from urllib import parse
4
5
 
6
+ if sys.version_info >= (3, 8):
7
+ from typing import Literal
8
+ else:
9
+ from typing_extensions import Literal
10
+
5
11
  _STEP = Literal["_step"]
6
12
 
7
13
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  Backend server process can be connected to using tcp sockets transport.
4
4
  """
5
+
5
6
  import datetime
6
7
  import os
7
8
  import pathlib
@@ -14,8 +15,8 @@ import time
14
15
  from typing import TYPE_CHECKING, Any, Dict, Optional
15
16
 
16
17
  from wandb import _sentry, termlog
17
- from wandb.env import error_reporting_enabled
18
- from wandb.errors import Error
18
+ from wandb.env import core_debug, core_error_reporting_enabled, is_require_core
19
+ from wandb.errors import Error, WandbCoreNotAvailableError
19
20
  from wandb.sdk.lib.wburls import wburls
20
21
  from wandb.util import get_core_path, get_module
21
22
 
@@ -161,28 +162,29 @@ class _Service:
161
162
  exec_cmd_list += ["coverage", "run", "-m"]
162
163
 
163
164
  service_args = []
164
- # NOTE: "wandb-core" is the name of the package that will be distributed
165
- # as the stable version of the wandb core library.
166
- #
167
- # Environment variable _WANDB_CORE_PATH is a temporary development feature
168
- # to assist in running the core service from a live development directory.
169
- core_path = get_core_path()
170
- if core_path:
165
+
166
+ if is_require_core():
167
+ try:
168
+ core_path = get_core_path()
169
+ except WandbCoreNotAvailableError as e:
170
+ _sentry.reraise(e)
171
+
171
172
  service_args.extend([core_path])
172
- if not error_reporting_enabled():
173
+
174
+ if not core_error_reporting_enabled(default="True"):
173
175
  service_args.append("--no-observability")
174
- if os.environ.get("WANDB_CORE_DEBUG", False):
176
+
177
+ if core_debug(default="False"):
175
178
  service_args.append("--debug")
179
+
176
180
  trace_filename = os.environ.get("_WANDB_TRACE")
177
181
  if trace_filename is not None:
178
182
  service_args.extend(["--trace", trace_filename])
179
183
 
180
184
  exec_cmd_list = []
181
- # TODO: remove this after the wandb-core GA release
182
- wandb_core = get_module("wandb_core")
183
185
  termlog(
184
- f"Using wandb-core version {wandb_core.__version__} as the SDK backend. "
185
- f"Please refer to {wburls.get('wandb_core')} for more information.",
186
+ "Using wandb-core as the SDK backend."
187
+ f" Please refer to {wburls.get('wandb_core')} for more information.",
186
188
  repeat=False,
187
189
  )
188
190
  else:
@@ -1,4 +1,5 @@
1
1
  """Utilities for wandb verify."""
2
+
2
3
  import getpass
3
4
  import os
4
5
  import time
@@ -20,7 +21,7 @@ PROJECT_NAME = "verify"
20
21
  GET_RUN_MAX_TIME = 10
21
22
  MIN_RETRYS = 3
22
23
  CHECKMARK = "\u2705"
23
- RED_X = "\u274C"
24
+ RED_X = "\u274c"
24
25
  ID_PREFIX = runid.generate_id()
25
26
 
26
27
 
wandb/sdk/wandb_init.py CHANGED
@@ -195,12 +195,6 @@ class _WandbInit:
195
195
  # Start with settings from wandb library singleton
196
196
  settings: Settings = self._wl.settings.copy()
197
197
 
198
- # when using launch, we don't want to reuse the same run id from the singleton
199
- # since users might launch multiple runs in the same process
200
- # TODO(kdg): allow users to control this via launch settings
201
- if settings.launch and singleton is not None:
202
- settings.update({"run_id": None}, source=Source.INIT)
203
-
204
198
  settings_param = kwargs.pop("settings", None)
205
199
  if settings_param is not None and isinstance(settings_param, (Settings, dict)):
206
200
  settings.update(settings_param, source=Source.INIT)
@@ -1124,10 +1118,10 @@ def init(
1124
1118
  for saving hyperparameters to compare across runs. The ID cannot
1125
1119
  contain the following special characters: `/\#?%:`.
1126
1120
  See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming).
1127
- fork_from: (str, optional) A string with the format <run_id>?_step=<step> describing
1121
+ fork_from: (str, optional) A string with the format {run_id}?_step={step} describing
1128
1122
  a moment in a previous run to fork a new run from. Creates a new run that picks up
1129
1123
  logging history from the specified run at the specified moment. The target run must
1130
- be in the current project.
1124
+ be in the current project. Example: `fork_from="my-run-id?_step=1234"`.
1131
1125
 
1132
1126
  Examples:
1133
1127
  ### Set where the run is logged
@@ -5,7 +5,7 @@ Create a manager channel.
5
5
 
6
6
  import atexit
7
7
  import os
8
- from typing import TYPE_CHECKING, Any, Callable, Dict, Optional
8
+ from typing import TYPE_CHECKING, Callable, Optional
9
9
 
10
10
  import psutil
11
11
 
@@ -205,7 +205,7 @@ class _Manager:
205
205
  svc_iface = self._get_service_interface()
206
206
  svc_iface._svc_inform_start(settings=settings, run_id=run_id)
207
207
 
208
- def _inform_attach(self, attach_id: str) -> Optional[Dict[str, Any]]:
208
+ def _inform_attach(self, attach_id: str) -> Optional["wandb_settings_pb2.Settings"]:
209
209
  svc_iface = self._get_service_interface()
210
210
  try:
211
211
  response = svc_iface._svc_inform_attach(attach_id=attach_id)
@@ -9,9 +9,11 @@ Example:
9
9
  wandb.require("incremental-artifacts@beta")
10
10
  """
11
11
 
12
+ import os
12
13
  from typing import Optional, Sequence, Union
13
14
 
14
15
  import wandb
16
+ from wandb.env import _REQUIRE_CORE
15
17
  from wandb.errors import UnsupportedError
16
18
  from wandb.sdk import wandb_run
17
19
  from wandb.sdk.lib.wburls import wburls
@@ -38,6 +40,9 @@ class _Requires:
38
40
  def require_service(self) -> None:
39
41
  self._require_service()
40
42
 
43
+ def require_core(self) -> None:
44
+ os.environ[_REQUIRE_CORE] = "true"
45
+
41
46
  def apply(self) -> None:
42
47
  """Call require_* method for supported features."""
43
48
  last_message: str = ""