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
wandb/sdk/wandb_run.py CHANGED
@@ -327,8 +327,7 @@ class RunStatusChecker:
327
327
  class _run_decorator: # noqa: N801
328
328
  _is_attaching: str = ""
329
329
 
330
- class Dummy:
331
- ...
330
+ class Dummy: ...
332
331
 
333
332
  @classmethod
334
333
  def _attach(cls, func: Callable) -> Callable:
@@ -1866,16 +1865,19 @@ class Run:
1866
1865
  # => Saves files in an "are/myfiles/" folder in the run.
1867
1866
 
1868
1867
  wandb.save("/User/username/Documents/run123/*.txt")
1869
- # => Saves files in a "run123/" folder in the run.
1868
+ # => Saves files in a "run123/" folder in the run. See note below.
1870
1869
 
1871
1870
  wandb.save("/User/username/Documents/run123/*.txt", base_path="/User")
1872
1871
  # => Saves files in a "username/Documents/run123/" folder in the run.
1873
1872
 
1874
1873
  wandb.save("files/*/saveme.txt")
1875
1874
  # => Saves each "saveme.txt" file in an appropriate subdirectory
1876
- # of "files/".
1875
+ # of "files/".
1877
1876
  ```
1878
1877
 
1878
+ Note: when given an absolute path or glob and no `base_path`, one
1879
+ directory level is preserved as in the example above.
1880
+
1879
1881
  Arguments:
1880
1882
  glob_str: A relative or absolute path or Unix glob.
1881
1883
  base_path: A path to use to infer a directory structure; see examples.
@@ -1961,55 +1963,67 @@ class Run:
1961
1963
  with telemetry.context(run=self) as tel:
1962
1964
  tel.feature.save = True
1963
1965
 
1964
- # Paths to the symlinks created for the globbed files.
1965
- wandb_files = [
1966
- str(path)
1967
- for path in pathlib.Path(
1966
+ # Files in the files directory matched by the glob, including old and
1967
+ # new ones.
1968
+ globbed_files = set(
1969
+ pathlib.Path(
1968
1970
  self._settings.files_dir,
1969
1971
  ).glob(relative_glob_str)
1970
- ]
1972
+ )
1971
1973
 
1972
- had_symlinked_files = len(wandb_files) > 0
1974
+ had_symlinked_files = len(globbed_files) > 0
1973
1975
  is_star_glob = "*" in relative_glob_str
1974
1976
 
1975
1977
  # The base_path may itself be a glob, so we can't do
1976
1978
  # base_path.glob(relative_glob_str)
1977
1979
  for path_str in glob.glob(str(base_path / relative_glob_str)):
1978
- path = pathlib.Path(path_str).absolute()
1980
+ source_path = pathlib.Path(path_str).absolute()
1979
1981
 
1980
1982
  # We can't use relative_to() because base_path may be a glob.
1981
- saved_path = pathlib.Path(*path.parts[len(base_path.parts) :])
1983
+ relative_path = pathlib.Path(*source_path.parts[len(base_path.parts) :])
1982
1984
 
1983
- wandb_path = pathlib.Path(self._settings.files_dir, saved_path)
1985
+ target_path = pathlib.Path(self._settings.files_dir, relative_path)
1986
+ globbed_files.add(target_path)
1984
1987
 
1985
- wandb_files.append(str(wandb_path))
1986
- wandb_path.parent.mkdir(parents=True, exist_ok=True)
1988
+ # If the file is already where it needs to be, don't create a symlink.
1989
+ if source_path.resolve() == target_path.resolve():
1990
+ continue
1991
+
1992
+ target_path.parent.mkdir(parents=True, exist_ok=True)
1987
1993
 
1988
1994
  # Delete the symlink if it exists.
1989
1995
  try:
1990
- wandb_path.unlink()
1996
+ target_path.unlink()
1991
1997
  except FileNotFoundError:
1992
1998
  # In Python 3.8, we would pass missing_ok=True, but as of now
1993
1999
  # we support down to Python 3.7.
1994
2000
  pass
1995
2001
 
1996
- wandb_path.symlink_to(path)
2002
+ target_path.symlink_to(source_path)
1997
2003
 
1998
2004
  # Inform users that new files aren't detected automatically.
1999
2005
  if not had_symlinked_files and is_star_glob:
2000
- file_str = f"{len(wandb_files)} file"
2001
- if len(wandb_files) > 1:
2006
+ file_str = f"{len(globbed_files)} file"
2007
+ if len(globbed_files) > 1:
2002
2008
  file_str += "s"
2003
2009
  wandb.termwarn(
2004
2010
  f"Symlinked {file_str} into the W&B run directory, "
2005
2011
  "call wandb.save again to sync new files."
2006
2012
  )
2007
2013
 
2008
- files_dict: FilesDict = {"files": [(relative_glob_str, policy)]}
2014
+ files_dict: FilesDict = {
2015
+ "files": [
2016
+ (
2017
+ GlobStr(str(f.relative_to(self._settings.files_dir))),
2018
+ policy,
2019
+ )
2020
+ for f in globbed_files
2021
+ ]
2022
+ }
2009
2023
  if self._backend and self._backend.interface:
2010
2024
  self._backend.interface.publish_files(files_dict)
2011
2025
 
2012
- return wandb_files
2026
+ return [str(f) for f in globbed_files]
2013
2027
 
2014
2028
  @_run_decorator._attach
2015
2029
  def restore(
@@ -2341,16 +2355,17 @@ class Run:
2341
2355
  if self._settings._offline:
2342
2356
  return
2343
2357
  if self._backend and self._backend.interface:
2344
- logger.info("communicating current version")
2345
- version_handle = self._backend.interface.deliver_check_version(
2346
- current_version=wandb.__version__
2347
- )
2348
- version_result = version_handle.wait(timeout=30)
2349
- if not version_result:
2350
- version_handle.abandon()
2351
- return
2352
- self._check_version = version_result.response.check_version_response
2353
- logger.info(f"got version response {self._check_version}")
2358
+ if not self._settings._disable_update_check:
2359
+ logger.info("communicating current version")
2360
+ version_handle = self._backend.interface.deliver_check_version(
2361
+ current_version=wandb.__version__
2362
+ )
2363
+ version_result = version_handle.wait(timeout=30)
2364
+ if not version_result:
2365
+ version_handle.abandon()
2366
+ else:
2367
+ self._check_version = version_result.response.check_version_response
2368
+ logger.info("got version response %s", self._check_version)
2354
2369
 
2355
2370
  def _on_start(self) -> None:
2356
2371
  # would like to move _set_global to _on_ready to unify _on_start and _on_attach
@@ -3158,13 +3173,13 @@ class Run:
3158
3173
  )
3159
3174
  if entity and artifact._source_entity and entity != artifact._source_entity:
3160
3175
  raise ValueError(
3161
- f"Artifact {artifact.name} is owned by entity '{entity}'; it can't be "
3162
- f"moved to '{artifact._source_entity}'"
3176
+ f"Artifact {artifact.name} is owned by entity "
3177
+ f"'{artifact._source_entity}'; it can't be moved to '{entity}'"
3163
3178
  )
3164
3179
  if project and artifact._source_project and project != artifact._source_project:
3165
3180
  raise ValueError(
3166
- f"Artifact {artifact.name} exists in project '{project}'; it can't be "
3167
- f"moved to '{artifact._source_project}'"
3181
+ f"Artifact {artifact.name} exists in project "
3182
+ f"'{artifact._source_project}'; it can't be moved to '{project}'"
3168
3183
  )
3169
3184
 
3170
3185
  def _prepare_artifact(
@@ -3291,8 +3306,8 @@ class Run:
3291
3306
  path: (str) path to downloaded model artifact file(s).
3292
3307
  """
3293
3308
  artifact = self.use_artifact(artifact_or_name=name)
3294
- assert "model" in str(
3295
- artifact.type.lower()
3309
+ assert (
3310
+ "model" in str(artifact.type.lower())
3296
3311
  ), "You can only use this method for 'model' artifacts. For an artifact to be a 'model' artifact, its type property must contain the substring 'model'."
3297
3312
  path = artifact.download()
3298
3313
 
@@ -3384,8 +3399,8 @@ class Run:
3384
3399
  public_api = self._public_api()
3385
3400
  try:
3386
3401
  artifact = public_api.artifact(name=f"{name}:latest")
3387
- assert "model" in str(
3388
- artifact.type.lower()
3402
+ assert (
3403
+ "model" in str(artifact.type.lower())
3389
3404
  ), "You can only use this method for 'model' artifacts. For an artifact to be a 'model' artifact, its type property must contain the substring 'model'."
3390
3405
  artifact = self._log_artifact(
3391
3406
  artifact_or_path=path, name=name, type=artifact.type
@@ -3585,7 +3600,7 @@ class Run:
3585
3600
  if settings._offline or settings.silent:
3586
3601
  return
3587
3602
 
3588
- workspace_url = f"{settings.run_url}/workspace"
3603
+ run_url = settings.run_url
3589
3604
  project_url = settings.project_url
3590
3605
  sweep_url = settings.sweep_url
3591
3606
 
@@ -3596,7 +3611,7 @@ class Run:
3596
3611
 
3597
3612
  if printer._html:
3598
3613
  if not wandb.jupyter.maybe_display():
3599
- run_line = f"<strong>{printer.link(workspace_url, run_name)}</strong>"
3614
+ run_line = f"<strong>{printer.link(run_url, run_name)}</strong>"
3600
3615
  project_line, sweep_line = "", ""
3601
3616
 
3602
3617
  # TODO(settings): make settings the source of truth
@@ -3628,7 +3643,7 @@ class Run:
3628
3643
  f'{printer.emoji("broom")} View sweep at {printer.link(sweep_url)}'
3629
3644
  )
3630
3645
  printer.display(
3631
- f'{printer.emoji("rocket")} View run at {printer.link(workspace_url)}',
3646
+ f'{printer.emoji("rocket")} View run at {printer.link(run_url)}',
3632
3647
  )
3633
3648
 
3634
3649
  # TODO(settings) use `wandb_settings` (if self.settings.anonymous == "true":)
@@ -3871,10 +3886,13 @@ class Run:
3871
3886
  else:
3872
3887
  info = []
3873
3888
  if settings.run_name and settings.run_url:
3874
- run_workspace = f"{settings.run_url}/workspace"
3875
- info = [
3876
- f"{printer.emoji('rocket')} View run {printer.name(settings.run_name)} at: {printer.link(run_workspace)}"
3877
- ]
3889
+ info.append(
3890
+ f"{printer.emoji('rocket')} View run {printer.name(settings.run_name)} at: {printer.link(settings.run_url)}"
3891
+ )
3892
+ if settings.project_url:
3893
+ info.append(
3894
+ f"{printer.emoji('star')} View project at: {printer.link(settings.project_url)}"
3895
+ )
3878
3896
  if poll_exit_response and poll_exit_response.file_counts:
3879
3897
  logger.info("logging synced files")
3880
3898
  file_counts = poll_exit_response.file_counts
@@ -310,6 +310,7 @@ class SettingsData:
310
310
  )
311
311
  _disable_setproctitle: bool # Do not use setproctitle on internal process
312
312
  _disable_stats: bool # Do not collect system metrics
313
+ _disable_update_check: bool # Disable version check
313
314
  _disable_viewer: bool # Prevent early viewer query
314
315
  _disable_machine_info: bool # Disable automatic machine info collection
315
316
  _except_exit: bool
@@ -656,6 +657,7 @@ class Settings(SettingsData):
656
657
  "preprocessor": _str_as_bool,
657
658
  "hook": lambda x: self._disable_machine_info or x,
658
659
  },
660
+ _disable_update_check={"preprocessor": _str_as_bool},
659
661
  _disable_viewer={"preprocessor": _str_as_bool},
660
662
  _extra_http_headers={"preprocessor": _str_as_json},
661
663
  # Retry filestream requests for 2 hours before dropping chunk (how do we recover?)
@@ -1673,7 +1675,6 @@ class Settings(SettingsData):
1673
1675
  "WANDB_TRACELOG": "_tracelog",
1674
1676
  "WANDB_DISABLE_SERVICE": "_disable_service",
1675
1677
  "WANDB_SERVICE_TRANSPORT": "_service_transport",
1676
- "WANDB_REQUIRE_CORE": "_require_core",
1677
1678
  "WANDB_DIR": "root_dir",
1678
1679
  "WANDB_NAME": "run_name",
1679
1680
  "WANDB_NOTES": "run_notes",
wandb/sklearn/__init__.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Create informative charts for scikit-learn models and log them to W&B."""
2
+
2
3
  from .plot import (
3
4
  plot_calibration_curve,
4
5
  plot_class_proportions,
@@ -1,4 +1,5 @@
1
1
  """Create and logs charts introspecting models built with scikit-learn to W&B."""
2
+
2
3
  from .classifier import calibration_curve as plot_calibration_curve
3
4
  from .classifier import class_proportions as plot_class_proportions
4
5
  from .classifier import classifier as plot_classifier
@@ -1,4 +1,5 @@
1
1
  """Define plots for classification models built with scikit-learn."""
2
+
2
3
  from warnings import simplefilter
3
4
 
4
5
  import numpy as np
@@ -1,4 +1,5 @@
1
1
  """Define plots for clustering models built with scikit-learn."""
2
+
2
3
  from warnings import simplefilter
3
4
 
4
5
  import pandas as pd
@@ -1,4 +1,5 @@
1
1
  """Define plots for regression models built with scikit-learn."""
2
+
2
3
  from warnings import simplefilter
3
4
 
4
5
  import numpy as np
@@ -1,4 +1,5 @@
1
1
  """Define plots used by multiple sklearn model classes."""
2
+
2
3
  from warnings import simplefilter
3
4
 
4
5
  import numpy as np
wandb/sklearn/utils.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Shared utilities for the modules in wandb.sklearn."""
2
+
2
3
  from collections.abc import Iterable, Sequence
3
4
 
4
5
  import numpy as np
wandb/testing/relay.py CHANGED
@@ -586,11 +586,11 @@ class InjectedResponse:
586
586
 
587
587
 
588
588
  class RelayControlProtocol(Protocol):
589
- def process(self, request: "flask.Request") -> None:
590
- ... # pragma: no cover
589
+ def process(self, request: "flask.Request") -> None: ... # pragma: no cover
591
590
 
592
- def control(self, request: "flask.Request") -> Mapping[str, str]:
593
- ... # pragma: no cover
591
+ def control(
592
+ self, request: "flask.Request"
593
+ ) -> Mapping[str, str]: ... # pragma: no cover
594
594
 
595
595
 
596
596
  class RelayServer:
wandb/trigger.py CHANGED
@@ -6,6 +6,7 @@ Usage:
6
6
  trigger.call('on_something', *args, **kwargs)
7
7
  trigger.unregister('on_something', func)
8
8
  """
9
+
9
10
  from typing import Any, Callable
10
11
 
11
12
  _triggers = {}
wandb/util.py CHANGED
@@ -11,6 +11,7 @@ import logging
11
11
  import math
12
12
  import numbers
13
13
  import os
14
+ import pathlib
14
15
  import platform
15
16
  import queue
16
17
  import random
@@ -55,7 +56,13 @@ import yaml
55
56
 
56
57
  import wandb
57
58
  import wandb.env
58
- from wandb.errors import AuthenticationError, CommError, UsageError, term
59
+ from wandb.errors import (
60
+ AuthenticationError,
61
+ CommError,
62
+ UsageError,
63
+ WandbCoreNotAvailableError,
64
+ term,
65
+ )
59
66
  from wandb.sdk.internal.thread_local_settings import _thread_local_api_settings
60
67
  from wandb.sdk.lib import filesystem, runid
61
68
  from wandb.sdk.lib.json_util import dump, dumps
@@ -1842,15 +1849,6 @@ def sample_with_exponential_decay_weights(
1842
1849
  return sampled_xs, sampled_ys, sampled_keys
1843
1850
 
1844
1851
 
1845
- def get_core_path() -> str:
1846
- core_path: str = os.environ.get("_WANDB_CORE_PATH", "")
1847
- wandb_core = get_module("wandb_core")
1848
- if not core_path and wandb_core:
1849
- _check_wandb_core_version_compatibility(wandb_core.__version__)
1850
- core_path = wandb_core.get_core_path()
1851
- return core_path
1852
-
1853
-
1854
1852
  @dataclasses.dataclass(frozen=True)
1855
1853
  class InstalledDistribution:
1856
1854
  """An installed distribution.
@@ -1888,15 +1886,40 @@ def parse_version(version: str) -> "packaging.version.Version":
1888
1886
  try:
1889
1887
  from packaging.version import parse as parse_version # type: ignore
1890
1888
  except ImportError:
1891
- from pkg_resources import parse_version
1889
+ from pkg_resources import parse_version # type: ignore[assignment]
1892
1890
 
1893
1891
  return parse_version(version)
1894
1892
 
1895
1893
 
1896
- def _check_wandb_core_version_compatibility(core_version: str) -> None:
1897
- """Checks if the installed wandb-core version is compatible with the wandb version."""
1898
- if parse_version(core_version) < parse_version(wandb._minimum_core_version):
1899
- raise ImportError(
1900
- f"Requires wandb-core version {wandb._minimum_core_version} or later, "
1901
- f"but you have {core_version}. Run `pip install --upgrade wandb-core` to upgrade."
1894
+ def get_core_path() -> str:
1895
+ """Returns the path to the wandb-core binary.
1896
+
1897
+ The path can be set explicitly via the _WANDB_CORE_PATH environment
1898
+ variable. Otherwise, the path to the binary in the current package
1899
+ is returned.
1900
+
1901
+ Returns:
1902
+ str: The path to the wandb-core package.
1903
+
1904
+ Raises:
1905
+ WandbCoreNotAvailableError: If wandb-core was not built for the current system.
1906
+ """
1907
+ # NOTE: Environment variable _WANDB_CORE_PATH is a temporary development feature
1908
+ # to assist in running the core service from a live development directory.
1909
+ path_from_env: str = os.environ.get("_WANDB_CORE_PATH", "")
1910
+ if path_from_env:
1911
+ wandb.termwarn(
1912
+ f"Using wandb-core from path `_WANDB_CORE_PATH={path_from_env}`. "
1913
+ "This is a development feature and may not work as expected."
1914
+ )
1915
+ return path_from_env
1916
+
1917
+ bin_path = pathlib.Path(__file__).parent / "bin" / "wandb-core"
1918
+ if not bin_path.exists():
1919
+ raise WandbCoreNotAvailableError(
1920
+ f"Looks like wandb-core is not compiled for your system ({platform.platform()}):"
1921
+ " Please contact support at support@wandb.com to request `wandb-core`"
1922
+ " support for your system."
1902
1923
  )
1924
+
1925
+ return str(bin_path)
wandb/wandb_controller.py CHANGED
@@ -47,7 +47,6 @@ Example:
47
47
  tuner.stop_runs(runs)
48
48
  """
49
49
 
50
-
51
50
  import json
52
51
  import os
53
52
  import random
wandb/wandb_torch.py CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
 
3
- """PyTorch-specific functionality
4
- """
3
+ """PyTorch-specific functionality"""
5
4
 
6
5
  import itertools
7
6
  from functools import reduce
@@ -1,7 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: wandb
3
- Version: 0.16.5
3
+ Version: 0.17.0rc1
4
4
  Summary: A CLI and library for interacting with the Weights & Biases API.
5
+ Project-URL: Source, https://github.com/wandb/wandb
6
+ Project-URL: Bug Reports, https://github.com/wandb/wandb/issues
7
+ Project-URL: Documentation, https://docs.wandb.ai/
5
8
  Author-email: Weights & Biases <support@wandb.com>
6
9
  License: MIT License
7
10
 
@@ -24,104 +27,100 @@ License: MIT License
24
27
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
28
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
29
  SOFTWARE.
27
-
28
- Project-URL: Source, https://github.com/wandb/wandb
29
- Project-URL: Bug Reports, https://github.com/wandb/wandb/issues
30
- Project-URL: Documentation, https://docs.wandb.ai/
30
+ License-File: LICENSE
31
31
  Classifier: Development Status :: 5 - Production/Stable
32
32
  Classifier: Intended Audience :: Developers
33
33
  Classifier: Intended Audience :: Science/Research
34
34
  Classifier: License :: OSI Approved :: MIT License
35
35
  Classifier: Natural Language :: English
36
36
  Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3 :: Only
37
38
  Classifier: Programming Language :: Python :: 3.7
38
39
  Classifier: Programming Language :: Python :: 3.8
39
40
  Classifier: Programming Language :: Python :: 3.9
40
41
  Classifier: Programming Language :: Python :: 3.10
41
42
  Classifier: Programming Language :: Python :: 3.11
42
43
  Classifier: Programming Language :: Python :: 3.12
43
- Classifier: Programming Language :: Python :: 3 :: Only
44
44
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
45
45
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
46
46
  Classifier: Topic :: System :: Logging
47
47
  Classifier: Topic :: System :: Monitoring
48
48
  Requires-Python: >=3.7
49
- Description-Content-Type: text/markdown
50
- License-File: LICENSE
51
- Requires-Dist: Click !=8.0.0,>=7.1
52
- Requires-Dist: GitPython !=3.1.29,>=1.0.0
53
- Requires-Dist: requests <3,>=2.0.0
54
- Requires-Dist: psutil >=5.0.0
55
- Requires-Dist: sentry-sdk >=1.0.0
56
- Requires-Dist: docker-pycreds >=0.4.0
57
- Requires-Dist: PyYAML
49
+ Requires-Dist: appdirs>=1.4.3
50
+ Requires-Dist: click!=8.0.0,>=7.1
51
+ Requires-Dist: docker-pycreds>=0.4.0
52
+ Requires-Dist: gitpython!=3.1.29,>=1.0.0
53
+ Requires-Dist: protobuf!=4.21.0,<5,>=3.12.0; python_version < '3.9' and sys_platform == 'linux'
54
+ Requires-Dist: protobuf!=4.21.0,<5,>=3.15.0; python_version == '3.9' and sys_platform == 'linux'
55
+ Requires-Dist: protobuf!=4.21.0,<5,>=3.19.0; python_version > '3.9' and sys_platform == 'linux'
56
+ Requires-Dist: protobuf!=4.21.0,<5,>=3.19.0; sys_platform != 'linux'
57
+ Requires-Dist: psutil>=5.0.0
58
+ Requires-Dist: pyyaml
59
+ Requires-Dist: requests<3,>=2.0.0
60
+ Requires-Dist: sentry-sdk>=1.0.0
58
61
  Requires-Dist: setproctitle
59
62
  Requires-Dist: setuptools
60
- Requires-Dist: appdirs >=1.4.3
61
- Requires-Dist: typing-extensions ; python_version < "3.10"
62
- Requires-Dist: protobuf !=4.21.0,<5,>=3.12.0 ; python_version < "3.9" and sys_platform == "linux"
63
- Requires-Dist: protobuf !=4.21.0,<5,>=3.15.0 ; python_version == "3.9" and sys_platform == "linux"
64
- Requires-Dist: protobuf !=4.21.0,<5,>=3.19.0 ; python_version > "3.9" and sys_platform == "linux"
65
- Requires-Dist: protobuf !=4.21.0,<5,>=3.19.0 ; sys_platform != "linux"
63
+ Requires-Dist: typing-extensions; python_version < '3.10'
66
64
  Provides-Extra: async
67
- Requires-Dist: httpx >=0.23.0 ; extra == 'async'
65
+ Requires-Dist: httpx>=0.23.0; extra == 'async'
68
66
  Provides-Extra: aws
69
- Requires-Dist: boto3 ; extra == 'aws'
67
+ Requires-Dist: boto3; extra == 'aws'
70
68
  Provides-Extra: azure
71
- Requires-Dist: azure-identity ; extra == 'azure'
72
- Requires-Dist: azure-storage-blob ; extra == 'azure'
69
+ Requires-Dist: azure-identity; extra == 'azure'
70
+ Requires-Dist: azure-storage-blob; extra == 'azure'
73
71
  Provides-Extra: gcp
74
- Requires-Dist: google-cloud-storage ; extra == 'gcp'
72
+ Requires-Dist: google-cloud-storage; extra == 'gcp'
75
73
  Provides-Extra: importers
76
- Requires-Dist: polars ; extra == 'importers'
77
- Requires-Dist: rich ; extra == 'importers'
78
- Requires-Dist: filelock ; extra == 'importers'
79
- Requires-Dist: mlflow ; extra == 'importers'
80
- Requires-Dist: tenacity ; extra == 'importers'
74
+ Requires-Dist: filelock; extra == 'importers'
75
+ Requires-Dist: mlflow; extra == 'importers'
76
+ Requires-Dist: polars; extra == 'importers'
77
+ Requires-Dist: rich; extra == 'importers'
78
+ Requires-Dist: tenacity; extra == 'importers'
81
79
  Provides-Extra: kubeflow
82
- Requires-Dist: kubernetes ; extra == 'kubeflow'
83
- Requires-Dist: minio ; extra == 'kubeflow'
84
- Requires-Dist: google-cloud-storage ; extra == 'kubeflow'
85
- Requires-Dist: sh ; extra == 'kubeflow'
80
+ Requires-Dist: google-cloud-storage; extra == 'kubeflow'
81
+ Requires-Dist: kubernetes; extra == 'kubeflow'
82
+ Requires-Dist: minio; extra == 'kubeflow'
83
+ Requires-Dist: sh; extra == 'kubeflow'
86
84
  Provides-Extra: launch
87
- Requires-Dist: awscli ; extra == 'launch'
88
- Requires-Dist: azure-identity ; extra == 'launch'
89
- Requires-Dist: azure-containerregistry ; extra == 'launch'
90
- Requires-Dist: azure-storage-blob ; extra == 'launch'
91
- Requires-Dist: boto3 ; extra == 'launch'
92
- Requires-Dist: botocore ; extra == 'launch'
93
- Requires-Dist: chardet ; extra == 'launch'
94
- Requires-Dist: google-auth ; extra == 'launch'
95
- Requires-Dist: google-cloud-aiplatform ; extra == 'launch'
96
- Requires-Dist: google-cloud-artifact-registry ; extra == 'launch'
97
- Requires-Dist: google-cloud-compute ; extra == 'launch'
98
- Requires-Dist: google-cloud-storage ; extra == 'launch'
99
- Requires-Dist: iso8601 ; extra == 'launch'
100
- Requires-Dist: kubernetes ; extra == 'launch'
101
- Requires-Dist: kubernetes-asyncio ; extra == 'launch'
102
- Requires-Dist: optuna ; extra == 'launch'
103
- Requires-Dist: nbconvert ; extra == 'launch'
104
- Requires-Dist: nbformat ; extra == 'launch'
105
- Requires-Dist: pydantic ; extra == 'launch'
106
- Requires-Dist: typing-extensions ; extra == 'launch'
107
- Requires-Dist: tomli ; extra == 'launch'
108
- Requires-Dist: PyYAML >=6.0.0 ; extra == 'launch'
85
+ Requires-Dist: awscli; extra == 'launch'
86
+ Requires-Dist: azure-containerregistry; extra == 'launch'
87
+ Requires-Dist: azure-identity; extra == 'launch'
88
+ Requires-Dist: azure-storage-blob; extra == 'launch'
89
+ Requires-Dist: boto3; extra == 'launch'
90
+ Requires-Dist: botocore; extra == 'launch'
91
+ Requires-Dist: chardet; extra == 'launch'
92
+ Requires-Dist: google-auth; extra == 'launch'
93
+ Requires-Dist: google-cloud-aiplatform; extra == 'launch'
94
+ Requires-Dist: google-cloud-artifact-registry; extra == 'launch'
95
+ Requires-Dist: google-cloud-compute; extra == 'launch'
96
+ Requires-Dist: google-cloud-storage; extra == 'launch'
97
+ Requires-Dist: iso8601; extra == 'launch'
98
+ Requires-Dist: kubernetes; extra == 'launch'
99
+ Requires-Dist: kubernetes-asyncio; extra == 'launch'
100
+ Requires-Dist: nbconvert; extra == 'launch'
101
+ Requires-Dist: nbformat; extra == 'launch'
102
+ Requires-Dist: optuna; extra == 'launch'
103
+ Requires-Dist: pydantic; extra == 'launch'
104
+ Requires-Dist: pyyaml>=6.0.0; extra == 'launch'
105
+ Requires-Dist: tomli; extra == 'launch'
106
+ Requires-Dist: typing-extensions; extra == 'launch'
109
107
  Provides-Extra: media
110
- Requires-Dist: numpy ; extra == 'media'
111
- Requires-Dist: moviepy ; extra == 'media'
112
- Requires-Dist: pillow ; extra == 'media'
113
- Requires-Dist: bokeh ; extra == 'media'
114
- Requires-Dist: soundfile ; extra == 'media'
115
- Requires-Dist: plotly >=5.18.0 ; extra == 'media'
116
- Requires-Dist: rdkit-pypi ; extra == 'media'
108
+ Requires-Dist: bokeh; extra == 'media'
109
+ Requires-Dist: moviepy; extra == 'media'
110
+ Requires-Dist: numpy; extra == 'media'
111
+ Requires-Dist: pillow; extra == 'media'
112
+ Requires-Dist: plotly>=5.18.0; extra == 'media'
113
+ Requires-Dist: rdkit-pypi; extra == 'media'
114
+ Requires-Dist: soundfile; extra == 'media'
117
115
  Provides-Extra: models
118
- Requires-Dist: cloudpickle ; extra == 'models'
116
+ Requires-Dist: cloudpickle; extra == 'models'
119
117
  Provides-Extra: perf
120
- Requires-Dist: orjson ; extra == 'perf'
118
+ Requires-Dist: orjson; extra == 'perf'
121
119
  Provides-Extra: reports
122
- Requires-Dist: pydantic >=2.0.0 ; extra == 'reports'
120
+ Requires-Dist: pydantic>=2.0.0; extra == 'reports'
123
121
  Provides-Extra: sweeps
124
- Requires-Dist: sweeps >=0.2.0 ; extra == 'sweeps'
122
+ Requires-Dist: sweeps>=0.2.0; extra == 'sweeps'
123
+ Description-Content-Type: text/markdown
125
124
 
126
125
  <div align="center">
127
126
  <img src="https://i.imgur.com/RUtiVzH.png" width="600" /><br><br>