wandb 0.17.1__py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.17.2__py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Sign up to get free protection for your applications and to get access to all the features.
wandb/__init__.py CHANGED
@@ -11,7 +11,7 @@ For scripts and interactive notebooks, see https://github.com/wandb/examples.
11
11
 
12
12
  For reference documentation, see https://docs.wandb.com/ref/python.
13
13
  """
14
- __version__ = "0.17.1"
14
+ __version__ = "0.17.2"
15
15
 
16
16
 
17
17
  # Used with pypi checks and other messages related to pip
@@ -214,9 +214,12 @@ from .analytics import Sentry as _Sentry
214
214
  if "dev" in __version__:
215
215
  import os
216
216
 
217
+ # disable error reporting in dev versions for the python client
217
218
  os.environ["WANDB_ERROR_REPORTING"] = os.environ.get(
218
219
  "WANDB_ERROR_REPORTING", "false"
219
220
  )
221
+ # turn on wandb-core for dev versions
222
+ os.environ["WANDB__REQUIRE_CORE"] = os.environ.get("WANDB__REQUIRE_CORE", "true")
220
223
 
221
224
  _sentry = _Sentry()
222
225
  _sentry.setup()
wandb/bin/wandb-core CHANGED
Binary file
wandb/cli/cli.py CHANGED
@@ -880,6 +880,14 @@ def sync(
880
880
  default=False,
881
881
  help="Resume a sweep to continue running new runs.",
882
882
  )
883
+ @click.option(
884
+ "--prior_run",
885
+ "-R",
886
+ "prior_runs",
887
+ multiple=True,
888
+ default=None,
889
+ help="ID of an existing run to add to this sweep",
890
+ )
883
891
  @click.argument("config_yaml_or_sweep_id")
884
892
  @click.pass_context
885
893
  @display_error
@@ -897,6 +905,7 @@ def sweep(
897
905
  cancel,
898
906
  pause,
899
907
  resume,
908
+ prior_runs,
900
909
  config_yaml_or_sweep_id,
901
910
  ):
902
911
  state_args = "stop", "cancel", "pause", "resume"
@@ -1038,6 +1047,7 @@ def sweep(
1038
1047
  project=project,
1039
1048
  entity=entity,
1040
1049
  obj_id=sweep_obj_id,
1050
+ prior_runs=prior_runs,
1041
1051
  )
1042
1052
  sweep_utils.handle_sweep_config_violations(warnings)
1043
1053
 
@@ -1104,6 +1114,14 @@ def sweep(
1104
1114
  default=None,
1105
1115
  help="Resume a launch sweep by passing an 8-char sweep id. Queue required",
1106
1116
  )
1117
+ @click.option(
1118
+ "--prior_run",
1119
+ "-R",
1120
+ "prior_runs",
1121
+ multiple=True,
1122
+ default=None,
1123
+ help="ID of an existing run to add to this sweep",
1124
+ )
1107
1125
  @click.argument("config", required=False, type=click.Path(exists=True))
1108
1126
  @click.pass_context
1109
1127
  @display_error
@@ -1114,6 +1132,7 @@ def launch_sweep(
1114
1132
  queue,
1115
1133
  config,
1116
1134
  resume_id,
1135
+ prior_runs,
1117
1136
  ):
1118
1137
  api = _get_cling_api()
1119
1138
  env = os.environ
@@ -1298,6 +1317,7 @@ def launch_sweep(
1298
1317
  obj_id=sweep_obj_id, # if resuming
1299
1318
  launch_scheduler=launch_scheduler_with_queue,
1300
1319
  state="PENDING",
1320
+ prior_runs=prior_runs,
1301
1321
  )
1302
1322
  sweep_utils.handle_sweep_config_violations(warnings)
1303
1323
  # Log nicely formatted sweep information
wandb/old/summary.py CHANGED
@@ -390,6 +390,11 @@ class HTTPSummary(Summary):
390
390
  self._client = client
391
391
  self._started = time.time()
392
392
 
393
+ def __delitem__(self, key):
394
+ if key not in self._json_dict:
395
+ raise KeyError(key)
396
+ del self._json_dict[key]
397
+
393
398
  def load(self):
394
399
  pass
395
400
 
@@ -2019,16 +2019,23 @@ class Artifact:
2019
2019
  def delete(self, delete_aliases: bool = False) -> None:
2020
2020
  """Delete an artifact and its files.
2021
2021
 
2022
+ If called on a linked artifact (i.e. a member of a portfolio collection): only the link is deleted, and the
2023
+ source artifact is unaffected.
2024
+
2022
2025
  Arguments:
2023
2026
  delete_aliases: If set to `True`, deletes all aliases associated with the artifact.
2024
2027
  Otherwise, this raises an exception if the artifact has existing
2025
2028
  aliases.
2029
+ This parameter is ignored if the artifact is linked (i.e. a member of a portfolio collection).
2026
2030
 
2027
2031
  Raises:
2028
2032
  ArtifactNotLoggedError: If the artifact is not logged.
2029
2033
  """
2030
2034
  self._ensure_logged("delete")
2031
- self._delete(delete_aliases)
2035
+ if self.collection.is_sequence():
2036
+ self._delete(delete_aliases)
2037
+ else:
2038
+ self._unlink()
2032
2039
 
2033
2040
  @normalize_exceptions
2034
2041
  def _delete(self, delete_aliases: bool = False) -> None:
@@ -390,10 +390,13 @@ if np:
390
390
  NumberType.types.append(np.uintp)
391
391
  NumberType.types.append(np.float32)
392
392
  NumberType.types.append(np.float64)
393
- NumberType.types.append(np.float_)
394
393
  NumberType.types.append(np.complex64)
395
394
  NumberType.types.append(np.complex128)
396
- NumberType.types.append(np.complex_)
395
+
396
+ numpy_major_version = np.__version__.split(".")[0]
397
+ if int(numpy_major_version) < 2:
398
+ NumberType.types.append(np.float_)
399
+ NumberType.types.append(np.complex_)
397
400
 
398
401
 
399
402
  class TimestampType(Type):
@@ -33,7 +33,7 @@ class Html(BatchableMedia):
33
33
  if data_is_path:
34
34
  assert isinstance(data, str)
35
35
  data_path = data
36
- with open(data_path) as file:
36
+ with open(data_path, encoding="utf-8") as file:
37
37
  self.html = file.read()
38
38
  elif isinstance(data, str):
39
39
  self.html = data
@@ -36,7 +36,7 @@ if TYPE_CHECKING: # pragma: no cover
36
36
 
37
37
  from ..wandb_run import Run as LocalRun
38
38
 
39
- numeric = Union[int, float, np.integer, np.float_]
39
+ numeric = Union[int, float, np.integer, np.float64]
40
40
  FileFormat3D = Literal[
41
41
  "obj",
42
42
  "gltf",
@@ -1180,6 +1180,7 @@ class Api:
1180
1180
  project_name (str): The project to download, (can include bucket)
1181
1181
  name (str): The run to download
1182
1182
  """
1183
+ # Pulling wandbConfig.start_time is required so that we can determine if a run has actually started
1183
1184
  query = gql(
1184
1185
  """
1185
1186
  query RunResumeStatus($project: String, $entity: String, $name: String!) {
@@ -1203,6 +1204,7 @@ class Api:
1203
1204
  eventsTail
1204
1205
  config
1205
1206
  tags
1207
+ wandbConfig(keys: ["t"])
1206
1208
  }
1207
1209
  }
1208
1210
  }
@@ -3036,6 +3038,7 @@ class Api:
3036
3038
  project: Optional[str] = None,
3037
3039
  entity: Optional[str] = None,
3038
3040
  state: Optional[str] = None,
3041
+ prior_runs: Optional[List[str]] = None,
3039
3042
  ) -> Tuple[str, List[str]]:
3040
3043
  """Upsert a sweep object.
3041
3044
 
@@ -3048,6 +3051,7 @@ class Api:
3048
3051
  project (str): project to use
3049
3052
  entity (str): entity to use
3050
3053
  state (str): state
3054
+ prior_runs (list): IDs of existing runs to add to the sweep
3051
3055
  """
3052
3056
  project_query = """
3053
3057
  project {
@@ -3068,7 +3072,8 @@ class Api:
3068
3072
  $projectName: String,
3069
3073
  $controller: JSONString,
3070
3074
  $scheduler: JSONString,
3071
- $state: String
3075
+ $state: String,
3076
+ $priorRunsFilters: JSONString,
3072
3077
  ) {
3073
3078
  upsertSweep(input: {
3074
3079
  id: $id,
@@ -3078,7 +3083,8 @@ class Api:
3078
3083
  projectName: $projectName,
3079
3084
  controller: $controller,
3080
3085
  scheduler: $scheduler,
3081
- state: $state
3086
+ state: $state,
3087
+ priorRunsFilters: $priorRunsFilters,
3082
3088
  }) {
3083
3089
  sweep {
3084
3090
  name
@@ -3127,6 +3133,9 @@ class Api:
3127
3133
  config_str = yaml.dump(
3128
3134
  json.loads(json.dumps(config)), Dumper=util.NonOctalStringDumper
3129
3135
  )
3136
+ filters = None
3137
+ if prior_runs:
3138
+ filters = json.dumps({"$or": [{"name": r} for r in prior_runs]})
3130
3139
 
3131
3140
  err: Optional[Exception] = None
3132
3141
  for mutation in mutations:
@@ -3140,6 +3149,7 @@ class Api:
3140
3149
  "controller": controller,
3141
3150
  "launchScheduler": launch_scheduler,
3142
3151
  "scheduler": scheduler,
3152
+ "priorRunsFilters": filters,
3143
3153
  }
3144
3154
  if state:
3145
3155
  variables["state"] = state
@@ -754,14 +754,14 @@ class SendManager:
754
754
  project_name=run.project,
755
755
  name=run.run_id,
756
756
  )
757
-
758
- if not resume_status:
757
+ # No resume status = run does not exist; No t key in wandbConfig = run exists but hasn't been inited
758
+ if not resume_status or '"t":' not in resume_status.get("wandbConfig", ""):
759
759
  if self._settings.resume == "must":
760
760
  error = wandb_internal_pb2.ErrorInfo()
761
761
  error.code = wandb_internal_pb2.ErrorInfo.ErrorCode.USAGE
762
762
  error.message = (
763
763
  "You provided an invalid value for the `resume` argument."
764
- f" The value 'must' is not a valid option for resuming a run ({run.run_id}) that does not exist."
764
+ f" The value 'must' is not a valid option for resuming a run ({run.run_id}) that has not been initialized."
765
765
  " Please check your inputs and try again with a valid run ID."
766
766
  " If you are trying to start a new run, please omit the `resume` argument or use `resume='allow'`."
767
767
  )
@@ -410,5 +410,7 @@ class GPU:
410
410
 
411
411
  except pynvml.NVMLError:
412
412
  pass
413
+ except Exception as e:
414
+ logger.error(f"Error Probing GPU: {e}")
413
415
 
414
416
  return info
@@ -141,7 +141,7 @@ class LaunchProject:
141
141
  elif self.job is not None:
142
142
  self.source = LaunchSource.JOB
143
143
  self.project_dir = tempfile.mkdtemp()
144
- if self.uri and self.uri.startswith("placeholder"):
144
+ elif self.uri and self.uri.startswith("placeholder"):
145
145
  self.source = LaunchSource.SCHEDULER
146
146
  self.project_dir = os.getcwd()
147
147
  self._entry_point = self.override_entrypoint
wandb/sdk/wandb_run.py CHANGED
@@ -2614,11 +2614,6 @@ class Run:
2614
2614
  exit_handle = self._backend.interface.deliver_exit(self._exit_code)
2615
2615
  exit_handle.add_probe(on_probe=self._on_probe_exit)
2616
2616
 
2617
- # this message is confusing, we should remove it
2618
- # self._footer_exit_status_info(
2619
- # self._exit_code, settings=self._settings, printer=self._printer
2620
- # )
2621
-
2622
2617
  # wait for the exit to complete
2623
2618
  _ = exit_handle.wait(timeout=-1, on_progress=self._on_progress_exit)
2624
2619
 
@@ -3764,6 +3759,11 @@ class Run:
3764
3759
  settings=settings,
3765
3760
  printer=printer,
3766
3761
  )
3762
+ Run._footer_notify_wandb_core(
3763
+ quiet=quiet,
3764
+ settings=settings,
3765
+ printer=printer,
3766
+ )
3767
3767
  Run._footer_local_warn(
3768
3768
  server_info_response=server_info_response,
3769
3769
  quiet=quiet,
@@ -3786,26 +3786,6 @@ class Run:
3786
3786
  printer=printer,
3787
3787
  )
3788
3788
 
3789
- @staticmethod
3790
- def _footer_exit_status_info(
3791
- exit_code: Optional[int],
3792
- *,
3793
- settings: "Settings",
3794
- printer: Union["PrinterTerm", "PrinterJupyter"],
3795
- ) -> None:
3796
- if settings.silent:
3797
- return
3798
-
3799
- status = "(success)." if not exit_code else f"(failed {exit_code})."
3800
- info = [
3801
- f"Waiting for W&B process to finish... {printer.status(status, bool(exit_code))}"
3802
- ]
3803
-
3804
- if not settings._offline and exit_code:
3805
- info.append(f"Press {printer.abort()} to abort syncing.")
3806
-
3807
- printer.display(f'{" ".join(info)}')
3808
-
3809
3789
  # fixme: Temporary hack until we move to rich which allows multiple spinners
3810
3790
  @staticmethod
3811
3791
  def _footer_file_pusher_status_info(
@@ -4154,6 +4134,24 @@ class Run:
4154
4134
  if package_problem and check_version.upgrade_message:
4155
4135
  printer.display(check_version.upgrade_message)
4156
4136
 
4137
+ @staticmethod
4138
+ def _footer_notify_wandb_core(
4139
+ *,
4140
+ quiet: Optional[bool] = None,
4141
+ settings: "Settings",
4142
+ printer: Union["PrinterTerm", "PrinterJupyter"],
4143
+ ) -> None:
4144
+ """Prints a message advertising the upcoming core release."""
4145
+ if quiet or settings._require_core:
4146
+ return
4147
+
4148
+ printer.display(
4149
+ "The new W&B backend becomes opt-out in version 0.18.0;"
4150
+ ' try it out with `wandb.require("core")`!'
4151
+ " See https://wandb.me/wandb-core for more information.",
4152
+ level="warn",
4153
+ )
4154
+
4157
4155
  @staticmethod
4158
4156
  def _footer_reporter_warn_err(
4159
4157
  reporter: Optional[Reporter] = None,
wandb/util.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import colorsys
2
2
  import contextlib
3
3
  import dataclasses
4
+ import enum
4
5
  import functools
5
6
  import gzip
6
7
  import importlib
@@ -637,6 +638,8 @@ def json_friendly( # noqa: C901
637
638
  elif isinstance(obj, set):
638
639
  # set is not json serializable, so we convert it to tuple
639
640
  obj = tuple(obj)
641
+ elif isinstance(obj, enum.Enum):
642
+ obj = obj.name
640
643
  else:
641
644
  converted = False
642
645
  if getsizeof(obj) > VALUE_BYTES_LIMIT:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wandb
3
- Version: 0.17.1
3
+ Version: 0.17.2
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