wandb 0.17.9__py3-none-macosx_11_0_arm64.whl → 0.18.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 (36) hide show
  1. wandb/__init__.py +1 -6
  2. wandb/__init__.pyi +27 -17
  3. wandb/analytics/sentry.py +1 -1
  4. wandb/bin/apple_gpu_stats +0 -0
  5. wandb/bin/wandb-core +0 -0
  6. wandb/cli/cli.py +15 -10
  7. wandb/env.py +1 -13
  8. wandb/integration/tensorboard/log.py +0 -3
  9. wandb/jupyter.py +18 -3
  10. wandb/proto/v3/wandb_internal_pb2.py +230 -230
  11. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  12. wandb/proto/v4/wandb_internal_pb2.py +230 -230
  13. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  14. wandb/proto/v5/wandb_internal_pb2.py +230 -230
  15. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  16. wandb/sdk/artifacts/_validators.py +45 -0
  17. wandb/sdk/artifacts/artifact.py +100 -45
  18. wandb/sdk/artifacts/artifact_saver.py +6 -0
  19. wandb/sdk/interface/interface.py +7 -4
  20. wandb/sdk/internal/internal_api.py +16 -6
  21. wandb/sdk/internal/sender.py +1 -0
  22. wandb/sdk/internal/system/assets/gpu_amd.py +11 -2
  23. wandb/sdk/launch/inputs/internal.py +2 -2
  24. wandb/sdk/lib/_settings_toposort_generated.py +1 -3
  25. wandb/sdk/service/server_sock.py +1 -1
  26. wandb/sdk/service/service.py +1 -2
  27. wandb/sdk/wandb_init.py +11 -6
  28. wandb/sdk/wandb_login.py +1 -0
  29. wandb/sdk/wandb_require.py +4 -20
  30. wandb/sdk/wandb_run.py +26 -10
  31. wandb/sdk/wandb_settings.py +1 -3
  32. {wandb-0.17.9.dist-info → wandb-0.18.0.dist-info}/METADATA +5 -5
  33. {wandb-0.17.9.dist-info → wandb-0.18.0.dist-info}/RECORD +36 -35
  34. {wandb-0.17.9.dist-info → wandb-0.18.0.dist-info}/WHEEL +0 -0
  35. {wandb-0.17.9.dist-info → wandb-0.18.0.dist-info}/entry_points.txt +0 -0
  36. {wandb-0.17.9.dist-info → wandb-0.18.0.dist-info}/licenses/LICENSE +0 -0
wandb/__init__.py CHANGED
@@ -8,7 +8,7 @@ For scripts and interactive notebooks, see https://github.com/wandb/examples.
8
8
 
9
9
  For reference documentation, see https://docs.wandb.com/ref/python.
10
10
  """
11
- __version__ = "0.17.9"
11
+ __version__ = "0.18.0"
12
12
 
13
13
  from typing import Optional
14
14
 
@@ -206,11 +206,6 @@ if "dev" in __version__:
206
206
  wandb.env.ERROR_REPORTING, "false"
207
207
  )
208
208
 
209
- # turn on wandb-core for dev versions
210
- if not wandb.env.is_require_legacy_service():
211
- os.environ[wandb.env._REQUIRE_CORE] = os.environ.get(
212
- wandb.env._REQUIRE_CORE, "true")
213
-
214
209
  _sentry = _Sentry()
215
210
  _sentry.setup()
216
211
 
wandb/__init__.pyi CHANGED
@@ -79,7 +79,7 @@ from wandb.sdk.wandb_run import Run
79
79
  from wandb.sdk.wandb_setup import _WandbSetup
80
80
  from wandb.wandb_controller import _WandbController
81
81
 
82
- __version__: str = "0.17.9"
82
+ __version__: str = "0.18.0"
83
83
 
84
84
  run: Optional[Run] = None
85
85
  config = wandb_config.Config
@@ -147,7 +147,7 @@ def setup(
147
147
 
148
148
  # Optional: Explicitly shut down the backend
149
149
  wandb.teardown()
150
- ```
150
+ ```
151
151
  """
152
152
  ...
153
153
 
@@ -343,6 +343,7 @@ def init(
343
343
  mode if a user isn't logged in to W&B. (default: `False`)
344
344
  sync_tensorboard: (bool, optional) Synchronize wandb logs from tensorboard or
345
345
  tensorboardX and save the relevant events file. (default: `False`)
346
+ tensorboard: (bool, optional) Alias for `sync_tensorboard`, deprecated.
346
347
  monitor_gym: (bool, optional) Automatically log videos of environment when
347
348
  using OpenAI Gym. (default: `False`)
348
349
  See [our guide to this integration](https://docs.wandb.com/guides/integrations/openai-gym).
@@ -356,6 +357,12 @@ def init(
356
357
  a moment in a previous run to fork a new run from. Creates a new run that picks up
357
358
  logging history from the specified run at the specified moment. The target run must
358
359
  be in the current project. Example: `fork_from="my-run-id?_step=1234"`.
360
+ resume_from: (str, optional) A string with the format {run_id}?_step={step} describing
361
+ a moment in a previous run to resume a run from. This allows users to truncate
362
+ the history logged to a run at an intermediate step and resume logging from that step.
363
+ It uses run forking under the hood. The target run must be in the
364
+ current project. Example: `resume_from="my-run-id?_step=1234"`.
365
+ settings: (dict, wandb.Settings, optional) Settings to use for this run. (default: None)
359
366
 
360
367
  Examples:
361
368
  ### Set where the run is logged
@@ -393,7 +400,7 @@ def init(
393
400
  KeyboardInterrupt: if user interrupts the run.
394
401
 
395
402
  Returns:
396
- A `Run` object.
403
+ A `Run` object.
397
404
  """
398
405
  ...
399
406
 
@@ -405,7 +412,7 @@ def finish(exit_code: Optional[int] = None, quiet: Optional[bool] = None) -> Non
405
412
 
406
413
  Arguments:
407
414
  exit_code: Set to something other than 0 to mark a run as failed
408
- quiet: Set to true to minimize log output
415
+ quiet: Set to true to minimize log output
409
416
  """
410
417
  ...
411
418
 
@@ -430,6 +437,7 @@ def login(
430
437
  "allow", only create an anonymous user if the user
431
438
  isn't already logged in. If set to "never", never log a
432
439
  user anonymously. Default set to "never".
440
+ key: (string, optional) The API key to use.
433
441
  relogin: (bool, optional) If true, will re-prompt for API key.
434
442
  host: (string, optional) The host to connect to.
435
443
  force: (bool, optional) If true, will force a relogin.
@@ -441,7 +449,7 @@ def login(
441
449
 
442
450
  Raises:
443
451
  AuthenticationError - if api_key fails verification with the server
444
- UsageError - if api_key cannot be configured and no tty
452
+ UsageError - if api_key cannot be configured and no tty
445
453
  """
446
454
  ...
447
455
 
@@ -675,7 +683,7 @@ def log(
675
683
 
676
684
  Raises:
677
685
  wandb.Error: if called before `wandb.init`
678
- ValueError: if invalid data is passed
686
+ ValueError: if invalid data is passed
679
687
  """
680
688
  ...
681
689
 
@@ -729,7 +737,7 @@ def save(
729
737
  Returns:
730
738
  Paths to the symlinks created for the matched files.
731
739
 
732
- For historical reasons, this may return a boolean in legacy code.
740
+ For historical reasons, this may return a boolean in legacy code.
733
741
  """
734
742
  ...
735
743
 
@@ -766,7 +774,7 @@ def sweep(
766
774
  prior_runs: The run IDs of existing runs to add to this sweep.
767
775
 
768
776
  Returns:
769
- sweep_id: str. A unique identifier for the sweep.
777
+ sweep_id: str. A unique identifier for the sweep.
770
778
  """
771
779
  ...
772
780
 
@@ -786,7 +794,7 @@ def controller(
786
794
  print(tuner.sweep_id)
787
795
  tuner.configure_search(...)
788
796
  tuner.configure_stopping(...)
789
- ```
797
+ ```
790
798
  """
791
799
  ...
792
800
 
@@ -816,7 +824,7 @@ def agent(
816
824
  project: The name of the project where W&B runs created from
817
825
  the sweep are sent to. If the project is not specified, the
818
826
  run is sent to a project labeled "Uncategorized".
819
- count: The number of sweep config trials to try.
827
+ count: The number of sweep config trials to try.
820
828
  """
821
829
  ...
822
830
 
@@ -853,7 +861,7 @@ def define_metric(
853
861
  previous calls.
854
862
 
855
863
  Returns:
856
- An object that represents this call but can otherwise be discarded.
864
+ An object that represents this call but can otherwise be discarded.
857
865
  """
858
866
  ...
859
867
 
@@ -862,6 +870,7 @@ def log_artifact(
862
870
  name: Optional[str] = None,
863
871
  type: Optional[str] = None,
864
872
  aliases: Optional[List[str]] = None,
873
+ tags: Optional[List[str]] = None,
865
874
  ) -> Artifact:
866
875
  """Declare an artifact as an output of a run.
867
876
 
@@ -882,9 +891,10 @@ def log_artifact(
882
891
  type: (str) The type of artifact to log, examples include `dataset`, `model`
883
892
  aliases: (list, optional) Aliases to apply to this artifact,
884
893
  defaults to `["latest"]`
894
+ tags: (list, optional) Tags to apply to this artifact, if any.
885
895
 
886
896
  Returns:
887
- An `Artifact` object.
897
+ An `Artifact` object.
888
898
  """
889
899
  ...
890
900
 
@@ -911,7 +921,7 @@ def use_artifact(
911
921
  Will be shown in UI.
912
922
 
913
923
  Returns:
914
- An `Artifact` object.
924
+ An `Artifact` object.
915
925
  """
916
926
  ...
917
927
 
@@ -957,7 +967,7 @@ def log_model(
957
967
  ValueError: if name has invalid special characters
958
968
 
959
969
  Returns:
960
- None
970
+ None
961
971
  """
962
972
  ...
963
973
 
@@ -998,7 +1008,7 @@ def use_model(name: str) -> FilePathStr:
998
1008
  AssertionError: if model artifact 'name' is of a type that does not contain the substring 'model'.
999
1009
 
1000
1010
  Returns:
1001
- path: (str) path to downloaded model artifact file(s).
1011
+ path: (str) path to downloaded model artifact file(s).
1002
1012
  """
1003
1013
  ...
1004
1014
 
@@ -1030,7 +1040,7 @@ def link_model(
1030
1040
  registered_model_name: (str) - the name of the registered model that the model is to be linked to.
1031
1041
  A registered model is a collection of model versions linked to the model registry, typically representing a
1032
1042
  team's specific ML Task. The entity that this registered model belongs to will be derived from the run
1033
- name: (str, optional) - the name of the model artifact that files in 'path' will be logged to. This will
1043
+ name: (str, optional) - the name of the model artifact that files in 'path' will be logged to. This will
1034
1044
  default to the basename of the path prepended with the current run id if not specified.
1035
1045
  aliases: (List[str], optional) - alias(es) that will only be applied on this linked artifact
1036
1046
  inside the registered model.
@@ -1069,6 +1079,6 @@ def link_model(
1069
1079
  ValueError: if name has invalid special characters
1070
1080
 
1071
1081
  Returns:
1072
- None
1082
+ None
1073
1083
  """
1074
1084
  ...
wandb/analytics/sentry.py CHANGED
@@ -211,7 +211,7 @@ class Sentry:
211
211
  "sweep_id",
212
212
  "deployment",
213
213
  "_disable_service",
214
- "_require_core",
214
+ "_require_legacy_service",
215
215
  "launch",
216
216
  )
217
217
 
wandb/bin/apple_gpu_stats CHANGED
Binary file
wandb/bin/wandb-core CHANGED
Binary file
wandb/cli/cli.py CHANGED
@@ -35,7 +35,7 @@ import wandb.sdk.verify.verify as wandb_verify
35
35
  from wandb import Config, Error, env, util, wandb_agent, wandb_sdk
36
36
  from wandb.apis import InternalApi, PublicApi
37
37
  from wandb.apis.public import RunQueue
38
- from wandb.errors import WandbCoreNotAvailableError
38
+ from wandb.errors import UsageError, WandbCoreNotAvailableError
39
39
  from wandb.integration.magic import magic_install
40
40
  from wandb.sdk.artifacts.artifact_file_cache import get_artifact_file_cache
41
41
  from wandb.sdk.launch import utils as launch_utils
@@ -123,6 +123,9 @@ _api = None # caching api instance allows patching from unit tests
123
123
 
124
124
  def _get_cling_api(reset=None):
125
125
  """Get a reference to the internal api with cling settings."""
126
+ # TODO: move CLI to wandb-core backend
127
+ wandb.require("legacy-service")
128
+
126
129
  global _api
127
130
  if reset:
128
131
  _api = None
@@ -226,6 +229,9 @@ def projects(entity, display=True):
226
229
  @click.option("--verify", default=False, is_flag=True, help="Verify login credentials")
227
230
  @display_error
228
231
  def login(key, host, cloud, relogin, anonymously, verify, no_offline=False):
232
+ # TODO: move CLI to wandb-core backend
233
+ wandb.require("legacy-service")
234
+
229
235
  # TODO: handle no_offline
230
236
  anon_mode = "must" if anonymously else "never"
231
237
 
@@ -433,8 +439,15 @@ def init(ctx, project, entity, reset, mode):
433
439
  def beta():
434
440
  """Beta versions of wandb CLI commands. Requires wandb-core."""
435
441
  # this is the future that requires wandb-core!
442
+ import wandb.env
443
+
436
444
  wandb._sentry.configure_scope(process_context="wandb_beta")
437
- wandb.require("core")
445
+
446
+ if wandb.env.is_require_legacy_service():
447
+ raise UsageError(
448
+ "wandb beta commands can only be used with wandb-core. "
449
+ f"Please make sure that `{wandb.env._REQUIRE_LEGACY_SERVICE}` is not set."
450
+ )
438
451
 
439
452
  try:
440
453
  get_core_path()
@@ -2942,14 +2955,6 @@ def enabled(service):
2942
2955
  )
2943
2956
 
2944
2957
 
2945
- @cli.command("gc", hidden=True, context_settings={"ignore_unknown_options": True})
2946
- @click.argument("args", nargs=-1)
2947
- def gc(args):
2948
- click.echo(
2949
- "`wandb gc` command has been removed. Use `wandb sync --clean` to clean up synced runs."
2950
- )
2951
-
2952
-
2953
2958
  @cli.command(context_settings=CONTEXT, help="Verify your local instance")
2954
2959
  @click.option("--host", default=None, help="Test a specific instance of W&B")
2955
2960
  def verify(host):
wandb/env.py CHANGED
@@ -90,7 +90,6 @@ _EXECUTABLE = "WANDB_EXECUTABLE"
90
90
  LAUNCH_QUEUE_NAME = "WANDB_LAUNCH_QUEUE_NAME"
91
91
  LAUNCH_QUEUE_ENTITY = "WANDB_LAUNCH_QUEUE_ENTITY"
92
92
  LAUNCH_TRACE_ID = "WANDB_LAUNCH_TRACE_ID"
93
- _REQUIRE_CORE = "WANDB__REQUIRE_CORE"
94
93
  _REQUIRE_LEGACY_SERVICE = "WANDB__REQUIRE_LEGACY_SERVICE"
95
94
 
96
95
  # For testing, to be removed in future version
@@ -154,19 +153,8 @@ def _env_as_bool(
154
153
  return False
155
154
 
156
155
 
157
- def is_require_core(env: Optional[Env] = None) -> bool:
158
- """Return whether wandb.require("core") was used.
159
-
160
- Note that this may contradict wandb.require("legacy-service").
161
- """
162
- return _env_as_bool(_REQUIRE_CORE, default="False", env=env)
163
-
164
-
165
156
  def is_require_legacy_service(env: Optional[Env] = None) -> bool:
166
- """Return whether wandb.require("legacy-service") was used.
167
-
168
- Note that this may contradict wandb.require("core").
169
- """
157
+ """Return whether wandb.require("legacy-service") was used."""
170
158
  return _env_as_bool(_REQUIRE_LEGACY_SERVICE, default="False", env=env)
171
159
 
172
160
 
@@ -54,9 +54,6 @@ def make_ndarray(tensor: Any) -> Optional["np.ndarray"]:
54
54
  def namespaced_tag(tag: str, namespace: str = "") -> str:
55
55
  if not namespace:
56
56
  return tag
57
- elif tag in namespace:
58
- # This happens with tensorboardX
59
- return namespace
60
57
  else:
61
58
  return namespace + "/" + tag
62
59
 
wandb/jupyter.py CHANGED
@@ -167,8 +167,6 @@ def notebook_metadata_from_jupyter_servers_and_kernel_id():
167
167
  urljoin(s["url"], "api/sessions"), params={"token": s.get("token", "")}
168
168
  ).json()
169
169
  for nn in res:
170
- # TODO: wandb/client#400 found a case where res returned an array of
171
- # strings...
172
170
  if isinstance(nn, dict) and nn.get("kernel") and "notebook" in nn:
173
171
  if nn["kernel"]["id"] == kernel_id:
174
172
  return {
@@ -176,7 +174,24 @@ def notebook_metadata_from_jupyter_servers_and_kernel_id():
176
174
  "path": nn["notebook"]["path"],
177
175
  "name": nn["notebook"]["name"],
178
176
  }
179
- return None
177
+
178
+ if not kernel_id:
179
+ return None
180
+
181
+ # Built-in notebook server in VS Code
182
+ try:
183
+ from IPython import get_ipython
184
+
185
+ ipython = get_ipython()
186
+ notebook_path = ipython.kernel.shell.user_ns.get("__vsc_ipynb_file__")
187
+ if notebook_path:
188
+ return {
189
+ "root": os.path.dirname(notebook_path),
190
+ "path": notebook_path,
191
+ "name": os.path.basename(notebook_path),
192
+ }
193
+ except Exception:
194
+ return None
180
195
 
181
196
 
182
197
  def notebook_metadata(silent: bool) -> Dict[str, str]: