wandb 0.19.9__py3-none-win_amd64.whl → 0.19.11__py3-none-win_amd64.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 (156) hide show
  1. wandb/__init__.py +1 -1
  2. wandb/__init__.pyi +6 -3
  3. wandb/_pydantic/__init__.py +14 -8
  4. wandb/_pydantic/base.py +51 -36
  5. wandb/_pydantic/utils.py +73 -0
  6. wandb/_pydantic/v1_compat.py +79 -57
  7. wandb/apis/public/__init__.py +2 -2
  8. wandb/apis/public/api.py +684 -4
  9. wandb/apis/public/artifacts.py +377 -677
  10. wandb/apis/public/automations.py +69 -0
  11. wandb/apis/public/integrations.py +180 -0
  12. wandb/apis/public/projects.py +29 -0
  13. wandb/apis/public/registries/__init__.py +0 -0
  14. wandb/apis/public/registries/_freezable_list.py +179 -0
  15. wandb/apis/public/{registries.py → registries/registries_search.py} +22 -129
  16. wandb/apis/public/registries/registry.py +357 -0
  17. wandb/apis/public/registries/utils.py +140 -0
  18. wandb/apis/public/runs.py +58 -56
  19. wandb/apis/public/utils.py +107 -1
  20. wandb/automations/__init__.py +73 -0
  21. wandb/automations/_filters/__init__.py +40 -0
  22. wandb/automations/_filters/expressions.py +181 -0
  23. wandb/automations/_filters/operators.py +258 -0
  24. wandb/automations/_filters/run_metrics.py +332 -0
  25. wandb/automations/_generated/__init__.py +177 -0
  26. wandb/automations/_generated/create_automation.py +17 -0
  27. wandb/automations/_generated/create_generic_webhook_integration.py +43 -0
  28. wandb/automations/_generated/delete_automation.py +17 -0
  29. wandb/automations/_generated/enums.py +33 -0
  30. wandb/automations/_generated/fragments.py +358 -0
  31. wandb/automations/_generated/generic_webhook_integrations_by_entity.py +22 -0
  32. wandb/automations/_generated/get_automations.py +24 -0
  33. wandb/automations/_generated/get_automations_by_entity.py +26 -0
  34. wandb/automations/_generated/input_types.py +104 -0
  35. wandb/automations/_generated/integrations_by_entity.py +22 -0
  36. wandb/automations/_generated/operations.py +647 -0
  37. wandb/automations/_generated/slack_integrations_by_entity.py +22 -0
  38. wandb/automations/_generated/update_automation.py +17 -0
  39. wandb/automations/_utils.py +237 -0
  40. wandb/automations/_validators.py +165 -0
  41. wandb/automations/actions.py +220 -0
  42. wandb/automations/automations.py +87 -0
  43. wandb/automations/events.py +287 -0
  44. wandb/automations/integrations.py +45 -0
  45. wandb/automations/scopes.py +78 -0
  46. wandb/beta/workflows.py +9 -10
  47. wandb/bin/gpu_stats.exe +0 -0
  48. wandb/bin/wandb-core +0 -0
  49. wandb/cli/cli.py +3 -3
  50. wandb/env.py +11 -0
  51. wandb/integration/keras/keras.py +2 -1
  52. wandb/integration/langchain/wandb_tracer.py +2 -1
  53. wandb/jupyter.py +137 -118
  54. wandb/old/settings.py +4 -1
  55. wandb/old/summary.py +0 -2
  56. wandb/proto/v3/wandb_internal_pb2.py +297 -292
  57. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  58. wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
  59. wandb/proto/v4/wandb_internal_pb2.py +292 -292
  60. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  61. wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
  62. wandb/proto/v5/wandb_internal_pb2.py +292 -292
  63. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  64. wandb/proto/v5/wandb_telemetry_pb2.py +10 -10
  65. wandb/proto/v6/wandb_base_pb2.py +41 -0
  66. wandb/proto/v6/wandb_internal_pb2.py +393 -0
  67. wandb/proto/v6/wandb_server_pb2.py +78 -0
  68. wandb/proto/v6/wandb_settings_pb2.py +58 -0
  69. wandb/proto/v6/wandb_telemetry_pb2.py +52 -0
  70. wandb/proto/wandb_base_pb2.py +2 -0
  71. wandb/proto/wandb_deprecated.py +8 -0
  72. wandb/proto/wandb_internal_pb2.py +3 -1
  73. wandb/proto/wandb_server_pb2.py +2 -0
  74. wandb/proto/wandb_settings_pb2.py +2 -0
  75. wandb/proto/wandb_telemetry_pb2.py +2 -0
  76. wandb/sdk/artifacts/_generated/__init__.py +289 -0
  77. wandb/sdk/artifacts/_generated/add_aliases.py +21 -0
  78. wandb/sdk/artifacts/_generated/artifact_collection_membership_files.py +43 -0
  79. wandb/sdk/artifacts/_generated/artifact_version_files.py +36 -0
  80. wandb/sdk/artifacts/_generated/create_artifact_collection_tag_assignments.py +36 -0
  81. wandb/sdk/artifacts/_generated/delete_aliases.py +21 -0
  82. wandb/sdk/artifacts/_generated/delete_artifact_collection_tag_assignments.py +25 -0
  83. wandb/sdk/artifacts/_generated/delete_artifact_portfolio.py +35 -0
  84. wandb/sdk/artifacts/_generated/delete_artifact_sequence.py +35 -0
  85. wandb/sdk/artifacts/_generated/enums.py +17 -0
  86. wandb/sdk/artifacts/_generated/fetch_linked_artifacts.py +67 -0
  87. wandb/sdk/artifacts/_generated/fragments.py +221 -0
  88. wandb/sdk/artifacts/_generated/input_types.py +28 -0
  89. wandb/sdk/artifacts/_generated/move_artifact_collection.py +35 -0
  90. wandb/sdk/artifacts/_generated/operations.py +611 -0
  91. wandb/sdk/artifacts/_generated/project_artifact_collection.py +101 -0
  92. wandb/sdk/artifacts/_generated/project_artifact_collections.py +33 -0
  93. wandb/sdk/artifacts/_generated/project_artifact_type.py +24 -0
  94. wandb/sdk/artifacts/_generated/project_artifact_types.py +24 -0
  95. wandb/sdk/artifacts/_generated/project_artifacts.py +42 -0
  96. wandb/sdk/artifacts/_generated/run_input_artifacts.py +51 -0
  97. wandb/sdk/artifacts/_generated/run_output_artifacts.py +51 -0
  98. wandb/sdk/artifacts/_generated/update_artifact.py +26 -0
  99. wandb/sdk/artifacts/_generated/update_artifact_portfolio.py +35 -0
  100. wandb/sdk/artifacts/_generated/update_artifact_sequence.py +35 -0
  101. wandb/sdk/artifacts/_graphql_fragments.py +57 -79
  102. wandb/sdk/artifacts/_validators.py +120 -1
  103. wandb/sdk/artifacts/artifact.py +419 -215
  104. wandb/sdk/artifacts/artifact_file_cache.py +4 -6
  105. wandb/sdk/artifacts/artifact_manifest_entry.py +13 -3
  106. wandb/sdk/artifacts/storage_handlers/azure_handler.py +1 -0
  107. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +182 -1
  108. wandb/sdk/artifacts/storage_policy.py +3 -0
  109. wandb/sdk/data_types/base_types/media.py +2 -3
  110. wandb/sdk/data_types/base_types/wb_value.py +34 -11
  111. wandb/sdk/data_types/html.py +36 -9
  112. wandb/sdk/data_types/image.py +12 -12
  113. wandb/sdk/data_types/table.py +5 -0
  114. wandb/sdk/data_types/trace_tree.py +2 -0
  115. wandb/sdk/data_types/utils.py +1 -1
  116. wandb/sdk/data_types/video.py +59 -57
  117. wandb/sdk/interface/interface.py +4 -3
  118. wandb/sdk/internal/internal_api.py +21 -31
  119. wandb/sdk/internal/profiler.py +6 -5
  120. wandb/sdk/internal/run.py +13 -6
  121. wandb/sdk/internal/sender.py +5 -2
  122. wandb/sdk/launch/sweeps/utils.py +8 -0
  123. wandb/sdk/lib/apikey.py +25 -4
  124. wandb/sdk/lib/asyncio_compat.py +1 -1
  125. wandb/sdk/lib/deprecate.py +13 -22
  126. wandb/sdk/lib/disabled.py +2 -1
  127. wandb/sdk/lib/printer.py +37 -8
  128. wandb/sdk/lib/printer_asyncio.py +46 -0
  129. wandb/sdk/lib/redirect.py +10 -5
  130. wandb/sdk/projects/_generated/__init__.py +47 -0
  131. wandb/sdk/projects/_generated/delete_project.py +22 -0
  132. wandb/sdk/projects/_generated/enums.py +4 -0
  133. wandb/sdk/projects/_generated/fetch_registry.py +22 -0
  134. wandb/sdk/projects/_generated/fragments.py +41 -0
  135. wandb/sdk/projects/_generated/input_types.py +13 -0
  136. wandb/sdk/projects/_generated/operations.py +88 -0
  137. wandb/sdk/projects/_generated/rename_project.py +27 -0
  138. wandb/sdk/projects/_generated/upsert_registry_project.py +27 -0
  139. wandb/sdk/service/server_sock.py +19 -14
  140. wandb/sdk/service/service.py +18 -8
  141. wandb/sdk/service/streams.py +5 -0
  142. wandb/sdk/verify/verify.py +6 -3
  143. wandb/sdk/wandb_init.py +217 -70
  144. wandb/sdk/wandb_login.py +13 -4
  145. wandb/sdk/wandb_run.py +419 -295
  146. wandb/sdk/wandb_settings.py +27 -10
  147. wandb/sdk/wandb_setup.py +61 -0
  148. wandb/util.py +33 -29
  149. {wandb-0.19.9.dist-info → wandb-0.19.11.dist-info}/METADATA +5 -5
  150. {wandb-0.19.9.dist-info → wandb-0.19.11.dist-info}/RECORD +153 -83
  151. wandb/_globals.py +0 -19
  152. wandb/sdk/internal/_generated/base.py +0 -226
  153. wandb/sdk/internal/_generated/typing_compat.py +0 -14
  154. {wandb-0.19.9.dist-info → wandb-0.19.11.dist-info}/WHEEL +0 -0
  155. {wandb-0.19.9.dist-info → wandb-0.19.11.dist-info}/entry_points.txt +0 -0
  156. {wandb-0.19.9.dist-info → wandb-0.19.11.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,46 @@
1
+ import asyncio
2
+ from typing import Callable, TypeVar
3
+
4
+ from wandb.sdk.lib import asyncio_compat, printer
5
+
6
+ _T = TypeVar("_T")
7
+
8
+
9
+ def run_async_with_spinner(
10
+ spinner_printer: printer.Printer,
11
+ text: str,
12
+ func: Callable[[], _T],
13
+ ) -> _T:
14
+ """Run a slow function while displaying a loading icon.
15
+
16
+ Args:
17
+ spinner_printer: The printer to use to display text.
18
+ text: The text to display next to the spinner while the function runs.
19
+ func: The function to run.
20
+
21
+ Returns:
22
+ The result of func.
23
+ """
24
+
25
+ async def _loop_run_with_spinner() -> _T:
26
+ func_running = asyncio.Event()
27
+
28
+ async def update_spinner() -> None:
29
+ tick = 0
30
+ with spinner_printer.dynamic_text() as text_area:
31
+ if text_area:
32
+ while not func_running.is_set():
33
+ spinner = spinner_printer.loading_symbol(tick)
34
+ text_area.set_text(f"{spinner} {text}")
35
+ tick += 1
36
+ await asyncio.sleep(0.1)
37
+ else:
38
+ spinner_printer.display(text)
39
+
40
+ async with asyncio_compat.open_task_group() as group:
41
+ group.start_soon(update_spinner())
42
+ res = await asyncio.get_running_loop().run_in_executor(None, func)
43
+ func_running.set()
44
+ return res
45
+
46
+ return asyncio_compat.run(_loop_run_with_spinner)
wandb/sdk/lib/redirect.py CHANGED
@@ -534,12 +534,15 @@ class StreamWrapper(RedirectBase):
534
534
  self,
535
535
  src: Literal["stdout", "stderr"],
536
536
  cbs: Iterable[Callable[[str], None]] = (),
537
+ *,
538
+ flush_periodically: bool,
537
539
  ) -> None:
538
540
  super().__init__(src=src, cbs=cbs)
539
541
  self._uninstall: Callable[[], None] | None = None
540
542
  self._emulator = TerminalEmulator()
541
543
  self._queue: queue.Queue[str] = queue.Queue()
542
544
  self._stopped = threading.Event()
545
+ self._flush_periodically = flush_periodically
543
546
 
544
547
  def _emulator_write(self) -> None:
545
548
  while True:
@@ -600,7 +603,7 @@ class StreamWrapper(RedirectBase):
600
603
  self._emulator_write_thread.daemon = True
601
604
  self._emulator_write_thread.start()
602
605
 
603
- if not wandb.run or wandb.run._settings.mode == "online":
606
+ if self._flush_periodically:
604
607
  self._callback_thread = threading.Thread(target=self._callback)
605
608
  self._callback_thread.daemon = True
606
609
  self._callback_thread.start()
@@ -732,10 +735,11 @@ _redirects: dict[str, Redirect | None] = {"stdout": None, "stderr": None}
732
735
  class Redirect(RedirectBase):
733
736
  """Redirect low level file descriptors."""
734
737
 
735
- def __init__(self, src, cbs=()):
738
+ def __init__(self, src, cbs=(), *, flush_periodically: bool):
736
739
  super().__init__(src=src, cbs=cbs)
737
740
  self._installed = False
738
741
  self._emulator = TerminalEmulator()
742
+ self._flush_periodically = flush_periodically
739
743
 
740
744
  def _pipe(self):
741
745
  if pty:
@@ -767,7 +771,7 @@ class Redirect(RedirectBase):
767
771
  self._emulator_write_thread = threading.Thread(target=self._emulator_write)
768
772
  self._emulator_write_thread.daemon = True
769
773
  self._emulator_write_thread.start()
770
- if not wandb.run or wandb.run._settings.mode == "online":
774
+ if self._flush_periodically:
771
775
  self._callback_thread = threading.Thread(target=self._callback)
772
776
  self._callback_thread.daemon = True
773
777
  self._callback_thread.start()
@@ -776,8 +780,9 @@ class Redirect(RedirectBase):
776
780
  if not self._installed:
777
781
  return
778
782
  self._installed = False
779
- # If the user printed a very long string (millions of chars) right before wandb.finish(),
780
- # it will take a while for it to reach pipe relay. 1 second is enough time for ~5 million chars.
783
+ # If the user printed a very long string (millions of chars) right
784
+ # before run.finish(), it will take a while for it to reach pipe relay.
785
+ # 1 second is enough time for ~5 million chars.
781
786
  time.sleep(1)
782
787
  self._stopped.set()
783
788
  os.dup2(self._orig_src_fd, self.src_fd)
@@ -0,0 +1,47 @@
1
+ # Generated by ariadne-codegen
2
+
3
+ from .delete_project import DeleteProject, DeleteProjectDeleteModel
4
+ from .fetch_registry import FetchRegistry, FetchRegistryEntity
5
+ from .fragments import (
6
+ RegistryFragment,
7
+ RegistryFragmentArtifactTypes,
8
+ RegistryFragmentArtifactTypesEdges,
9
+ RegistryFragmentArtifactTypesEdgesNode,
10
+ )
11
+ from .input_types import ArtifactTypeInput
12
+ from .operations import (
13
+ DELETE_PROJECT_GQL,
14
+ FETCH_REGISTRY_GQL,
15
+ RENAME_PROJECT_GQL,
16
+ UPSERT_REGISTRY_PROJECT_GQL,
17
+ )
18
+ from .rename_project import (
19
+ RenameProject,
20
+ RenameProjectRenameProject,
21
+ RenameProjectRenameProjectProject,
22
+ )
23
+ from .upsert_registry_project import (
24
+ UpsertRegistryProject,
25
+ UpsertRegistryProjectUpsertModel,
26
+ )
27
+
28
+ __all__ = [
29
+ "DELETE_PROJECT_GQL",
30
+ "FETCH_REGISTRY_GQL",
31
+ "RENAME_PROJECT_GQL",
32
+ "UPSERT_REGISTRY_PROJECT_GQL",
33
+ "FetchRegistry",
34
+ "FetchRegistryEntity",
35
+ "RenameProject",
36
+ "RenameProjectRenameProject",
37
+ "RenameProjectRenameProjectProject",
38
+ "UpsertRegistryProject",
39
+ "UpsertRegistryProjectUpsertModel",
40
+ "DeleteProject",
41
+ "DeleteProjectDeleteModel",
42
+ "ArtifactTypeInput",
43
+ "RegistryFragment",
44
+ "RegistryFragmentArtifactTypes",
45
+ "RegistryFragmentArtifactTypesEdges",
46
+ "RegistryFragmentArtifactTypesEdgesNode",
47
+ ]
@@ -0,0 +1,22 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: tools/graphql_codegen/projects/
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Literal, Optional
7
+
8
+ from pydantic import Field
9
+
10
+ from wandb._pydantic import GQLBase, Typename
11
+
12
+
13
+ class DeleteProject(GQLBase):
14
+ delete_model: Optional[DeleteProjectDeleteModel] = Field(alias="deleteModel")
15
+
16
+
17
+ class DeleteProjectDeleteModel(GQLBase):
18
+ success: Optional[bool]
19
+ typename__: Typename[Literal["DeleteModelPayload"]]
20
+
21
+
22
+ DeleteProject.model_rebuild()
@@ -0,0 +1,4 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: core/api/graphql/schemas/schema-latest.graphql
3
+
4
+ from __future__ import annotations
@@ -0,0 +1,22 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: tools/graphql_codegen/projects/
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Optional
7
+
8
+ from wandb._pydantic import GQLBase
9
+
10
+ from .fragments import RegistryFragment
11
+
12
+
13
+ class FetchRegistry(GQLBase):
14
+ entity: Optional[FetchRegistryEntity]
15
+
16
+
17
+ class FetchRegistryEntity(GQLBase):
18
+ project: Optional[RegistryFragment]
19
+
20
+
21
+ FetchRegistry.model_rebuild()
22
+ FetchRegistryEntity.model_rebuild()
@@ -0,0 +1,41 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: tools/graphql_codegen/projects/
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import List, Optional
7
+
8
+ from pydantic import Field
9
+
10
+ from wandb._pydantic import GQLBase, GQLId
11
+
12
+
13
+ class RegistryFragment(GQLBase):
14
+ id: GQLId
15
+ allow_all_artifact_types_in_registry: bool = Field(
16
+ alias="allowAllArtifactTypesInRegistry"
17
+ )
18
+ artifact_types: RegistryFragmentArtifactTypes = Field(alias="artifactTypes")
19
+ name: str
20
+ description: Optional[str]
21
+ created_at: str = Field(alias="createdAt")
22
+ updated_at: Optional[str] = Field(alias="updatedAt")
23
+ access: Optional[str]
24
+
25
+
26
+ class RegistryFragmentArtifactTypes(GQLBase):
27
+ edges: List[RegistryFragmentArtifactTypesEdges]
28
+
29
+
30
+ class RegistryFragmentArtifactTypesEdges(GQLBase):
31
+ node: Optional[RegistryFragmentArtifactTypesEdgesNode]
32
+
33
+
34
+ class RegistryFragmentArtifactTypesEdgesNode(GQLBase):
35
+ name: str
36
+
37
+
38
+ RegistryFragment.model_rebuild()
39
+ RegistryFragmentArtifactTypes.model_rebuild()
40
+ RegistryFragmentArtifactTypesEdges.model_rebuild()
41
+ RegistryFragmentArtifactTypesEdgesNode.model_rebuild()
@@ -0,0 +1,13 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: core/api/graphql/schemas/schema-latest.graphql
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Optional
7
+
8
+ from wandb._pydantic import GQLBase
9
+
10
+
11
+ class ArtifactTypeInput(GQLBase):
12
+ name: str
13
+ description: Optional[str] = None
@@ -0,0 +1,88 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: tools/graphql_codegen/projects/
3
+
4
+ __all__ = [
5
+ "DELETE_PROJECT_GQL",
6
+ "FETCH_REGISTRY_GQL",
7
+ "RENAME_PROJECT_GQL",
8
+ "UPSERT_REGISTRY_PROJECT_GQL",
9
+ ]
10
+
11
+ FETCH_REGISTRY_GQL = """
12
+ query FetchRegistry($name: String, $entityName: String) {
13
+ entity(name: $entityName) {
14
+ project(name: $name) {
15
+ ...RegistryFragment
16
+ }
17
+ }
18
+ }
19
+
20
+ fragment RegistryFragment on Project {
21
+ id
22
+ allowAllArtifactTypesInRegistry
23
+ artifactTypes(includeAll: true) {
24
+ edges {
25
+ node {
26
+ name
27
+ }
28
+ }
29
+ }
30
+ name
31
+ description
32
+ createdAt
33
+ updatedAt
34
+ access
35
+ }
36
+ """
37
+
38
+ RENAME_PROJECT_GQL = """
39
+ mutation renameProject($entityName: String!, $oldProjectName: String!, $newProjectName: String!) {
40
+ renameProject(
41
+ input: {entityName: $entityName, oldProjectName: $oldProjectName, newProjectName: $newProjectName}
42
+ ) {
43
+ project {
44
+ name
45
+ }
46
+ inserted
47
+ }
48
+ }
49
+ """
50
+
51
+ UPSERT_REGISTRY_PROJECT_GQL = """
52
+ mutation UpsertRegistryProject($description: String, $entityName: String, $name: String, $access: String, $allowAllArtifactTypesInRegistry: Boolean, $artifactTypes: [ArtifactTypeInput!]) {
53
+ upsertModel(
54
+ input: {description: $description, entityName: $entityName, name: $name, access: $access, allowAllArtifactTypesInRegistry: $allowAllArtifactTypesInRegistry, artifactTypes: $artifactTypes}
55
+ ) {
56
+ project {
57
+ ...RegistryFragment
58
+ }
59
+ inserted
60
+ }
61
+ }
62
+
63
+ fragment RegistryFragment on Project {
64
+ id
65
+ allowAllArtifactTypesInRegistry
66
+ artifactTypes(includeAll: true) {
67
+ edges {
68
+ node {
69
+ name
70
+ }
71
+ }
72
+ }
73
+ name
74
+ description
75
+ createdAt
76
+ updatedAt
77
+ access
78
+ }
79
+ """
80
+
81
+ DELETE_PROJECT_GQL = """
82
+ mutation deleteProject($id: String!) {
83
+ deleteModel(input: {id: $id}) {
84
+ success
85
+ __typename
86
+ }
87
+ }
88
+ """
@@ -0,0 +1,27 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: tools/graphql_codegen/projects/
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Optional
7
+
8
+ from pydantic import Field
9
+
10
+ from wandb._pydantic import GQLBase
11
+
12
+
13
+ class RenameProject(GQLBase):
14
+ rename_project: Optional[RenameProjectRenameProject] = Field(alias="renameProject")
15
+
16
+
17
+ class RenameProjectRenameProject(GQLBase):
18
+ project: Optional[RenameProjectRenameProjectProject]
19
+ inserted: Optional[bool]
20
+
21
+
22
+ class RenameProjectRenameProjectProject(GQLBase):
23
+ name: str
24
+
25
+
26
+ RenameProject.model_rebuild()
27
+ RenameProjectRenameProject.model_rebuild()
@@ -0,0 +1,27 @@
1
+ # Generated by ariadne-codegen
2
+ # Source: tools/graphql_codegen/projects/
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Optional
7
+
8
+ from pydantic import Field
9
+
10
+ from wandb._pydantic import GQLBase
11
+
12
+ from .fragments import RegistryFragment
13
+
14
+
15
+ class UpsertRegistryProject(GQLBase):
16
+ upsert_model: Optional[UpsertRegistryProjectUpsertModel] = Field(
17
+ alias="upsertModel"
18
+ )
19
+
20
+
21
+ class UpsertRegistryProjectUpsertModel(GQLBase):
22
+ project: Optional[RegistryFragment]
23
+ inserted: Optional[bool]
24
+
25
+
26
+ UpsertRegistryProject.model_rebuild()
27
+ UpsertRegistryProjectUpsertModel.model_rebuild()
@@ -5,6 +5,7 @@ import time
5
5
  from typing import TYPE_CHECKING, Any, Callable, Dict, Optional
6
6
 
7
7
  import wandb
8
+ from wandb.proto import wandb_internal_pb2 as pb
8
9
  from wandb.proto import wandb_server_pb2 as spb
9
10
  from wandb.sdk.internal.settings_static import SettingsStatic
10
11
 
@@ -156,27 +157,31 @@ class SockServerReadThread(threading.Thread):
156
157
  inform_attach_response=inform_attach_response,
157
158
  )
158
159
  self._sock_client.send_server_response(response)
159
- iface = self._mux.get_stream(stream_id).interface
160
-
161
- assert iface
162
160
 
163
161
  def server_record_communicate(self, sreq: "spb.ServerRequest") -> None:
164
- record = sreq.record_communicate
165
- # encode relay information so the right socket picks up the data
166
- record.control.relay_id = self._sock_client._sockid
167
- stream_id = record._info.stream_id
168
- iface = self._mux.get_stream(stream_id).interface
169
- assert iface.record_q
170
- iface.record_q.put(record)
162
+ self._put_record(sreq.record_communicate)
171
163
 
172
164
  def server_record_publish(self, sreq: "spb.ServerRequest") -> None:
173
- record = sreq.record_publish
165
+ self._put_record(sreq.record_publish)
166
+
167
+ def _put_record(self, record: "pb.Record") -> None:
174
168
  # encode relay information so the right socket picks up the data
175
169
  record.control.relay_id = self._sock_client._sockid
176
170
  stream_id = record._info.stream_id
177
- iface = self._mux.get_stream(stream_id).interface
178
- assert iface.record_q
179
- iface.record_q.put(record)
171
+
172
+ try:
173
+ iface = self._mux.get_stream(stream_id).interface
174
+
175
+ except KeyError:
176
+ # We should log the error but cannot because it may print to console
177
+ # due to how logging is set up. This error usually happens if
178
+ # a record is sent when no run is active, but during this time the
179
+ # logger prints to the console.
180
+ pass
181
+
182
+ else:
183
+ assert iface.record_q
184
+ iface.record_q.put(record)
180
185
 
181
186
  def server_inform_finish(self, sreq: "spb.ServerRequest") -> None:
182
187
  request = sreq.inform_finish
@@ -14,10 +14,15 @@ import tempfile
14
14
  import time
15
15
  from typing import TYPE_CHECKING, Any, Dict, Optional
16
16
 
17
- from wandb import _sentry, termlog
18
- from wandb.env import core_debug, error_reporting_enabled, is_require_legacy_service
17
+ from wandb import _sentry
18
+ from wandb.env import (
19
+ core_debug,
20
+ dcgm_profiling_enabled,
21
+ error_reporting_enabled,
22
+ is_require_legacy_service,
23
+ )
19
24
  from wandb.errors import Error, WandbCoreNotAvailableError
20
- from wandb.errors.links import url_registry
25
+ from wandb.errors.term import termlog, termwarn
21
26
  from wandb.util import get_core_path, get_module
22
27
 
23
28
  from . import _startup_debug, port_file
@@ -162,14 +167,19 @@ class _Service:
162
167
  if core_debug(default="False"):
163
168
  service_args.extend(["--log-level", "-4"])
164
169
 
170
+ if dcgm_profiling_enabled():
171
+ service_args.append("--enable-dcgm-profiling")
172
+
165
173
  exec_cmd_list = []
166
- termlog(
167
- "Using wandb-core as the SDK backend. Please refer to "
168
- f"{url_registry.url('wandb-core')} for more information.",
169
- repeat=False,
170
- )
171
174
  else:
172
175
  service_args.extend(["wandb", "service", "--debug"])
176
+ termwarn(
177
+ "Using legacy-service, which is deprecated. If this is"
178
+ " unintentional, you can fix it by ensuring you do not call"
179
+ " `wandb.require('legacy-service')` and do not set the"
180
+ " WANDB_X_REQUIRE_LEGACY_SERVICE environment"
181
+ " variable."
182
+ )
173
183
 
174
184
  service_args += [
175
185
  "--port-filename",
@@ -198,6 +198,11 @@ class StreamMux:
198
198
  return stream_id in self._streams
199
199
 
200
200
  def get_stream(self, stream_id: str) -> StreamRecord:
201
+ """Returns the StreamRecord for the ID.
202
+
203
+ Raises:
204
+ KeyError: If a corresponding StreamRecord does not exist.
205
+ """
201
206
  with self._streams_lock:
202
207
  stream = self._streams[stream_id]
203
208
  return stream
@@ -132,7 +132,10 @@ def check_run(api: Api) -> bool:
132
132
  f.close()
133
133
 
134
134
  with wandb.init(
135
- id=nice_id("check_run"), reinit=True, config=config, project=PROJECT_NAME
135
+ id=nice_id("check_run"),
136
+ reinit=True,
137
+ config=config,
138
+ project=PROJECT_NAME,
136
139
  ) as run:
137
140
  run_id = run.id
138
141
  entity = run.entity
@@ -155,7 +158,7 @@ def check_run(api: Api) -> bool:
155
158
  "Failed to log to media. Contact W&B for support."
156
159
  )
157
160
 
158
- wandb.save(filepath)
161
+ run.save(filepath)
159
162
  public_api = wandb.Api()
160
163
  prev_run = public_api.run(f"{entity}/{PROJECT_NAME}/{run_id}")
161
164
  # raise Exception(prev_run.__dict__)
@@ -379,7 +382,7 @@ def check_graphql_put(api: Api, host: str) -> Tuple[bool, Optional[str]]:
379
382
  project=PROJECT_NAME,
380
383
  config={"test": "put to graphql"},
381
384
  ) as run:
382
- wandb.save(gql_fp)
385
+ run.save(gql_fp)
383
386
  public_api = wandb.Api()
384
387
  prev_run = public_api.run(f"{run.entity}/{PROJECT_NAME}/{run.id}")
385
388
  if prev_run is None: