wandb 0.17.5__py3-none-win32.whl → 0.17.6__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.
Files changed (47) hide show
  1. wandb/__init__.py +3 -1
  2. wandb/apis/public/api.py +1 -1
  3. wandb/apis/public/jobs.py +5 -0
  4. wandb/bin/wandb-core +0 -0
  5. wandb/data_types.py +2 -1
  6. wandb/env.py +6 -0
  7. wandb/integration/lightning/fabric/logger.py +4 -4
  8. wandb/proto/v3/wandb_internal_pb2.py +226 -226
  9. wandb/proto/v3/wandb_settings_pb2.py +1 -1
  10. wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
  11. wandb/proto/v4/wandb_internal_pb2.py +226 -226
  12. wandb/proto/v4/wandb_settings_pb2.py +1 -1
  13. wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
  14. wandb/proto/v5/wandb_internal_pb2.py +226 -226
  15. wandb/proto/v5/wandb_settings_pb2.py +1 -1
  16. wandb/proto/v5/wandb_telemetry_pb2.py +10 -10
  17. wandb/proto/wandb_deprecated.py +4 -0
  18. wandb/proto/wandb_internal_pb2.py +6 -0
  19. wandb/sdk/artifacts/artifact.py +5 -0
  20. wandb/sdk/artifacts/artifact_manifest_entry.py +31 -0
  21. wandb/sdk/artifacts/storage_handlers/azure_handler.py +35 -23
  22. wandb/sdk/data_types/object_3d.py +113 -2
  23. wandb/sdk/interface/interface.py +23 -0
  24. wandb/sdk/internal/sender.py +31 -15
  25. wandb/sdk/launch/_launch.py +4 -2
  26. wandb/sdk/launch/_project_spec.py +34 -8
  27. wandb/sdk/launch/agent/agent.py +6 -2
  28. wandb/sdk/launch/agent/run_queue_item_file_saver.py +2 -4
  29. wandb/sdk/launch/builder/build.py +4 -2
  30. wandb/sdk/launch/builder/templates/_wandb_bootstrap.py +2 -1
  31. wandb/sdk/launch/inputs/internal.py +42 -28
  32. wandb/sdk/launch/inputs/schema.py +39 -0
  33. wandb/sdk/launch/runner/kubernetes_runner.py +72 -0
  34. wandb/sdk/launch/runner/local_container.py +13 -10
  35. wandb/sdk/launch/runner/sagemaker_runner.py +3 -5
  36. wandb/sdk/launch/utils.py +2 -0
  37. wandb/sdk/lib/disabled.py +13 -174
  38. wandb/sdk/wandb_init.py +23 -27
  39. wandb/sdk/wandb_login.py +6 -6
  40. wandb/sdk/wandb_run.py +41 -22
  41. wandb/sdk/wandb_settings.py +3 -2
  42. wandb/wandb_agent.py +2 -0
  43. {wandb-0.17.5.dist-info → wandb-0.17.6.dist-info}/METADATA +3 -2
  44. {wandb-0.17.5.dist-info → wandb-0.17.6.dist-info}/RECORD +47 -46
  45. {wandb-0.17.5.dist-info → wandb-0.17.6.dist-info}/WHEEL +0 -0
  46. {wandb-0.17.5.dist-info → wandb-0.17.6.dist-info}/entry_points.txt +0 -0
  47. {wandb-0.17.5.dist-info → wandb-0.17.6.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/lib/disabled.py CHANGED
@@ -1,178 +1,6 @@
1
- #
1
+ from typing import Any
2
2
 
3
-
4
- class RunDisabled(str):
5
- def __init__(self, *args, **kwargs):
6
- object.__setattr__(self, "___dict", {})
7
-
8
- def __add__(self, other):
9
- return self
10
-
11
- def __sub__(self, other):
12
- return self
13
-
14
- def __mul__(self, other):
15
- return self
16
-
17
- def __truediv__(self, other):
18
- return self
19
-
20
- def __floordiv__(self, other):
21
- return self
22
-
23
- def __mod__(self, other):
24
- return self
25
-
26
- def __pow__(self, other, modulo=None):
27
- return self
28
-
29
- def __lshift__(self, other):
30
- return self
31
-
32
- def __rshift__(self, other):
33
- return self
34
-
35
- def __and__(self, other):
36
- return self
37
-
38
- def __xor__(self, other):
39
- return self
40
-
41
- def __or__(self, other):
42
- return self
43
-
44
- def __iadd__(self, other):
45
- return self
46
-
47
- def __isub__(self, other):
48
- return self
49
-
50
- def __imul__(self, other):
51
- return self
52
-
53
- def __idiv__(self, other):
54
- return self
55
-
56
- def __ifloordiv__(self, other):
57
- return self
58
-
59
- def __imod__(self, other):
60
- return self
61
-
62
- def __ipow__(self, other, modulo=None):
63
- return self
64
-
65
- def __ilshift__(self, other):
66
- return self
67
-
68
- def __irshift__(self, other):
69
- return self
70
-
71
- def __iand__(self, other):
72
- return self
73
-
74
- def __ixor__(self, other):
75
- return self
76
-
77
- def __ior__(self, other):
78
- return self
79
-
80
- def __neg__(self):
81
- return self
82
-
83
- def __pos__(self):
84
- return self
85
-
86
- def __abs__(self):
87
- return self
88
-
89
- def __invert__(self):
90
- return self
91
-
92
- def __complex__(self):
93
- return 1 + 0j
94
-
95
- def __int__(self):
96
- return 1
97
-
98
- def __long__(self):
99
- return 1
100
-
101
- def __float__(self):
102
- return 1.0
103
-
104
- def __oct__(self):
105
- return oct(1)
106
-
107
- def __hex__(self):
108
- return hex(1)
109
-
110
- def __lt__(self, other):
111
- return True
112
-
113
- def __le__(self, other):
114
- return True
115
-
116
- def __eq__(self, other):
117
- return True
118
-
119
- def __ne__(self, other):
120
- return True
121
-
122
- def __gt__(self, other):
123
- return True
124
-
125
- def __ge__(self, other):
126
- return True
127
-
128
- def __getattr__(self, attr):
129
- return self[attr]
130
-
131
- def __getitem__(self, key):
132
- d = object.__getattribute__(self, "___dict")
133
- try:
134
- if key in d:
135
- return d[key]
136
- except TypeError:
137
- key = str(key)
138
- if key in d:
139
- return d[key]
140
- dummy = RunDisabled()
141
- d[key] = dummy
142
- return dummy
143
-
144
- def __setitem__(self, key, value):
145
- object.__getattribute__(self, "___dict")[key] = value
146
-
147
- def __setattr__(self, key, value):
148
- self[key] = value
149
-
150
- def __call__(self, *args, **kwargs):
151
- return RunDisabled()
152
-
153
- def __len__(self):
154
- return 1
155
-
156
- def __str__(self):
157
- return ""
158
-
159
- def __enter__(self):
160
- return self
161
-
162
- def __exit__(self, exc_type, exc_val, exc_tb):
163
- return exc_type is None
164
-
165
- def __repr__(self):
166
- return ""
167
-
168
- def __nonzero__(self):
169
- return True
170
-
171
- def __bool__(self):
172
- return True
173
-
174
- def __getstate__(self):
175
- return 1
3
+ from wandb.sdk.lib import deprecate
176
4
 
177
5
 
178
6
  class SummaryDisabled(dict):
@@ -188,3 +16,14 @@ class SummaryDisabled(dict):
188
16
  val = SummaryDisabled(val)
189
17
  self[key] = val
190
18
  return val
19
+
20
+
21
+ class RunDisabled:
22
+ """Compatibility class for integrations that explicitly check for wandb.RunDisabled."""
23
+
24
+ def __getattr__(self, name: str) -> Any:
25
+ deprecate.deprecate(
26
+ field_name=deprecate.Deprecated.run_disabled,
27
+ warning_message="RunDisabled is deprecated and is a no-op. "
28
+ '`wandb.init(mode="disabled")` now returns and instance of `wandb.sdk.wandb_run.Run`.',
29
+ )
wandb/sdk/wandb_init.py CHANGED
@@ -30,15 +30,7 @@ from wandb.util import _is_artifact_representation
30
30
 
31
31
  from . import wandb_login, wandb_setup
32
32
  from .backend.backend import Backend
33
- from .lib import (
34
- RunDisabled,
35
- SummaryDisabled,
36
- filesystem,
37
- ipython,
38
- module,
39
- reporting,
40
- telemetry,
41
- )
33
+ from .lib import SummaryDisabled, filesystem, ipython, module, reporting, telemetry
42
34
  from .lib.deprecate import Deprecated, deprecate
43
35
  from .lib.mailbox import Mailbox, MailboxProgress
44
36
  from .lib.printer import Printer, get_printer
@@ -529,20 +521,18 @@ class _WandbInit:
529
521
  logger.info(f"Logging user logs to {settings.log_user}")
530
522
  logger.info(f"Logging internal logs to {settings.log_internal}")
531
523
 
532
- def _make_run_disabled(self) -> RunDisabled:
533
- drun = RunDisabled()
534
- drun.config = wandb.wandb_sdk.wandb_config.Config()
535
- drun.config.update(self.sweep_config)
536
- drun.config.update(self.config)
537
- drun.summary = SummaryDisabled()
538
- drun.log = lambda data, *_, **__: drun.summary.update(data)
539
- drun.finish = lambda *_, **__: module.unset_globals()
540
- drun.step = 0
541
- drun.resumed = False
542
- drun.disabled = True
543
- drun.id = runid.generate_id()
544
- drun.name = "dummy-" + drun.id
545
- drun.dir = tempfile.gettempdir()
524
+ def _make_run_disabled(self) -> Run:
525
+ drun = Run(settings=Settings(mode="disabled", files_dir=tempfile.gettempdir()))
526
+ drun._config = wandb.wandb_sdk.wandb_config.Config()
527
+ drun._config.update(self.sweep_config)
528
+ drun._config.update(self.config)
529
+ drun.summary = SummaryDisabled() # type: ignore
530
+ drun.log = lambda data, *_, **__: drun.summary.update(data) # type: ignore
531
+ drun.finish = lambda *_, **__: module.unset_globals() # type: ignore
532
+ drun._step = 0
533
+ drun._run_obj = None
534
+ drun._run_id = runid.generate_id()
535
+ drun._name = "dummy-" + drun.id
546
536
  module.set_global(
547
537
  run=drun,
548
538
  config=drun.config,
@@ -563,7 +553,7 @@ class _WandbInit:
563
553
  percent_done = handle.percent_done
564
554
  self.printer.progress_update(line, percent_done=percent_done)
565
555
 
566
- def init(self) -> Union[Run, RunDisabled]: # noqa: C901
556
+ def init(self) -> Run: # noqa: C901
567
557
  if logger is None:
568
558
  raise RuntimeError("Logger not initialized")
569
559
  logger.info("calling init triggers")
@@ -700,6 +690,12 @@ class _WandbInit:
700
690
  tel.feature.flow_control_custom = True
701
691
  if self.settings._require_core:
702
692
  tel.feature.core = True
693
+ if self.settings._shared:
694
+ wandb.termwarn(
695
+ "The `_shared` feature is experimental and may change. "
696
+ "Please contact support@wandb.com for guidance and to report any issues."
697
+ )
698
+ tel.feature.shared_mode = True
703
699
 
704
700
  tel.env.maybe_mp = _maybe_mp_process(backend)
705
701
 
@@ -853,7 +849,7 @@ def _attach(
853
849
  run_id: Optional[str] = None,
854
850
  *,
855
851
  run: Optional["Run"] = None,
856
- ) -> Union[Run, RunDisabled, None]:
852
+ ) -> Optional[Run]:
857
853
  """Attach to a run currently executing in another process/thread.
858
854
 
859
855
  Arguments:
@@ -907,7 +903,7 @@ def _attach(
907
903
  if run is None:
908
904
  run = Run(settings=settings)
909
905
  else:
910
- run._init(settings=settings)
906
+ run._init()
911
907
  run._set_library(_wl)
912
908
  run._set_backend(backend)
913
909
  backend._hack_set_run(run)
@@ -957,7 +953,7 @@ def init(
957
953
  fork_from: Optional[str] = None,
958
954
  resume_from: Optional[str] = None,
959
955
  settings: Union[Settings, Dict[str, Any], None] = None,
960
- ) -> Union[Run, RunDisabled]:
956
+ ) -> Run:
961
957
  r"""Start a new run to track and log to W&B.
962
958
 
963
959
  In an ML training pipeline, you could add `wandb.init()`
wandb/sdk/wandb_login.py CHANGED
@@ -54,16 +54,16 @@ def login(
54
54
  ) -> bool:
55
55
  """Set up W&B login credentials.
56
56
 
57
- By default, this will only store the credentials locally without
57
+ By default, this will only store credentials locally without
58
58
  verifying them with the W&B server. To verify credentials, pass
59
- verify=True.
59
+ `verify=True`.
60
60
 
61
61
  Arguments:
62
62
  anonymous: (string, optional) Can be "must", "allow", or "never".
63
- If set to "must" we'll always log in anonymously, if set to
64
- "allow" we'll only create an anonymous user if the user
65
- isn't already logged in.
66
- key: (string, optional) authentication key.
63
+ If set to "must", always log a user in anonymously. If set to
64
+ "allow", only create an anonymous user if the user
65
+ isn't already logged in. If set to "never", never log a
66
+ user anonymously. Default set to "never".
67
67
  relogin: (bool, optional) If true, will re-prompt for API key.
68
68
  host: (string, optional) The host to connect to.
69
69
  force: (bool, optional) If true, will force a relogin.
wandb/sdk/wandb_run.py CHANGED
@@ -235,10 +235,10 @@ class RunStatusChecker:
235
235
 
236
236
  with lock:
237
237
  if self._join_event.is_set():
238
- return
238
+ break
239
239
  set_handle(local_handle)
240
240
  try:
241
- result = local_handle.wait(timeout=timeout)
241
+ result = local_handle.wait(timeout=timeout, release=False)
242
242
  except MailboxError:
243
243
  # background threads are oportunistically getting results
244
244
  # from the internal process but the internal process could
@@ -253,6 +253,7 @@ class RunStatusChecker:
253
253
  if result:
254
254
  process(result)
255
255
  # if request finished, clear the handle to send on the next interval
256
+ local_handle.abandon()
256
257
  local_handle = None
257
258
 
258
259
  time_elapsed = time.monotonic() - time_probe
@@ -591,8 +592,12 @@ class Run:
591
592
  ) -> None:
592
593
  # pid is set, so we know if this run object was initialized by this process
593
594
  self._init_pid = os.getpid()
595
+ self._settings = settings
596
+
597
+ if settings._noop:
598
+ return
599
+
594
600
  self._init(
595
- settings=settings,
596
601
  config=config,
597
602
  sweep_config=sweep_config,
598
603
  launch_config=launch_config,
@@ -600,12 +605,10 @@ class Run:
600
605
 
601
606
  def _init(
602
607
  self,
603
- settings: Settings,
604
608
  config: Optional[Dict[str, Any]] = None,
605
609
  sweep_config: Optional[Dict[str, Any]] = None,
606
610
  launch_config: Optional[Dict[str, Any]] = None,
607
611
  ) -> None:
608
- self._settings = settings
609
612
  self._config = wandb_config.Config()
610
613
  self._config._set_callback(self._config_callback)
611
614
  self._config._set_artifact_callback(self._config_artifact_callback)
@@ -2703,29 +2706,48 @@ class Run:
2703
2706
  summary: Optional[str] = None,
2704
2707
  goal: Optional[str] = None,
2705
2708
  overwrite: Optional[bool] = None,
2706
- **kwargs: Any,
2707
2709
  ) -> wandb_metric.Metric:
2708
- """Define metric properties which will later be logged with `wandb.log()`.
2710
+ """Customize metrics logged with `wandb.log()`.
2709
2711
 
2710
2712
  Arguments:
2711
- name: Name of the metric.
2712
- step_metric: Independent variable associated with the metric.
2713
- step_sync: Automatically add `step_metric` to history if needed.
2714
- Defaults to True if step_metric is specified.
2713
+ name: The name of the metric to customize.
2714
+ step_metric: The name of another metric to serve as the X-axis
2715
+ for this metric in automatically generated charts.
2716
+ step_sync: Automatically insert the last value of step_metric into
2717
+ `run.log()` if it is not provided explicitly. Defaults to True
2718
+ if step_metric is specified.
2715
2719
  hidden: Hide this metric from automatic plots.
2716
2720
  summary: Specify aggregate metrics added to summary.
2717
- Supported aggregations: "min,max,mean,best,last,none"
2718
- Default aggregation is `copy`
2719
- Aggregation `best` defaults to `goal`==`minimize`
2720
- goal: Specify direction for optimizing the metric.
2721
- Supported directions: "minimize,maximize"
2721
+ Supported aggregations include "min", "max", "mean", "last",
2722
+ "best", "copy" and "none". "best" is used together with the
2723
+ goal parameter. "none" prevents a summary from being generated.
2724
+ "copy" is deprecated and should not be used.
2725
+ goal: Specify how to interpret the "best" summary type.
2726
+ Supported options are "minimize" and "maximize".
2727
+ overwrite: If false, then this call is merged with previous
2728
+ `define_metric` calls for the same metric by using their
2729
+ values for any unspecified parameters. If true, then
2730
+ unspecified parameters overwrite values specified by
2731
+ previous calls.
2722
2732
 
2723
2733
  Returns:
2724
- A metric object is returned that can be further specified.
2725
-
2734
+ An object that represents this call but can otherwise be discarded.
2726
2735
  """
2736
+ if summary and "copy" in summary:
2737
+ deprecate.deprecate(
2738
+ deprecate.Deprecated.run__define_metric_copy,
2739
+ "define_metric(summary='copy') is deprecated and will be removed.",
2740
+ self,
2741
+ )
2742
+
2727
2743
  return self._define_metric(
2728
- name, step_metric, step_sync, hidden, summary, goal, overwrite, **kwargs
2744
+ name,
2745
+ step_metric,
2746
+ step_sync,
2747
+ hidden,
2748
+ summary,
2749
+ goal,
2750
+ overwrite,
2729
2751
  )
2730
2752
 
2731
2753
  def _define_metric(
@@ -2737,12 +2759,9 @@ class Run:
2737
2759
  summary: Optional[str] = None,
2738
2760
  goal: Optional[str] = None,
2739
2761
  overwrite: Optional[bool] = None,
2740
- **kwargs: Any,
2741
2762
  ) -> wandb_metric.Metric:
2742
2763
  if not name:
2743
2764
  raise wandb.Error("define_metric() requires non-empty name argument")
2744
- for k in kwargs:
2745
- wandb.termwarn(f"Unhandled define_metric() arg: {k}")
2746
2765
  if isinstance(step_metric, wandb_metric.Metric):
2747
2766
  step_metric = step_metric.name
2748
2767
  for arg_name, arg_val, exp_type in (
@@ -1882,9 +1882,10 @@ class Settings(SettingsData):
1882
1882
  if self.resume_from is None:
1883
1883
  return
1884
1884
 
1885
- if self.run_id is not None:
1885
+ if self.run_id is not None and (self.resume_from.run != self.run_id):
1886
1886
  wandb.termwarn(
1887
- "You cannot specify both run_id and resume_from. " "Ignoring run_id."
1887
+ "Both `run_id` and `resume_from` have been specified with different ids. "
1888
+ "`run_id` will be ignored."
1888
1889
  )
1889
1890
  self.update({"run_id": self.resume_from.run}, source=Source.INIT)
1890
1891
 
wandb/wandb_agent.py CHANGED
@@ -43,6 +43,8 @@ class AgentProcess:
43
43
  kwargs = dict(creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
44
44
  else:
45
45
  kwargs = dict(preexec_fn=os.setpgrp)
46
+ if env.get(wandb.env.SERVICE):
47
+ env.pop(wandb.env.SERVICE)
46
48
  self._popen = subprocess.Popen(command, env=env, **kwargs)
47
49
  elif function:
48
50
  self._proc = multiprocessing.Process(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wandb
3
- Version: 0.17.5
3
+ Version: 0.17.6
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
@@ -71,7 +71,7 @@ Requires-Dist: google-cloud-storage; extra == 'gcp'
71
71
  Provides-Extra: importers
72
72
  Requires-Dist: filelock; extra == 'importers'
73
73
  Requires-Dist: mlflow; extra == 'importers'
74
- Requires-Dist: polars; extra == 'importers'
74
+ Requires-Dist: polars<=1.2.1; extra == 'importers'
75
75
  Requires-Dist: rich; extra == 'importers'
76
76
  Requires-Dist: tenacity; extra == 'importers'
77
77
  Provides-Extra: kubeflow
@@ -93,6 +93,7 @@ Requires-Dist: google-cloud-artifact-registry; extra == 'launch'
93
93
  Requires-Dist: google-cloud-compute; extra == 'launch'
94
94
  Requires-Dist: google-cloud-storage; extra == 'launch'
95
95
  Requires-Dist: iso8601; extra == 'launch'
96
+ Requires-Dist: jsonschema; extra == 'launch'
96
97
  Requires-Dist: kubernetes; extra == 'launch'
97
98
  Requires-Dist: kubernetes-asyncio; extra == 'launch'
98
99
  Requires-Dist: nbconvert; extra == 'launch'