wandb 0.21.2__py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.23.0rc1__py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.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 (274) hide show
  1. package_readme.md +57 -38
  2. wandb/__init__.py +4 -39
  3. wandb/__init__.pyi +16 -15
  4. wandb/_analytics.py +65 -0
  5. wandb/_iterutils.py +10 -2
  6. wandb/_pydantic/__init__.py +20 -13
  7. wandb/_pydantic/base.py +102 -79
  8. wandb/_pydantic/field_types.py +34 -0
  9. wandb/_pydantic/pagination.py +47 -0
  10. wandb/_pydantic/utils.py +4 -2
  11. wandb/_pydantic/v1_compat.py +66 -47
  12. wandb/_strutils.py +57 -0
  13. wandb/analytics/__init__.py +2 -2
  14. wandb/analytics/sentry.py +153 -115
  15. wandb/apis/__init__.py +5 -3
  16. wandb/apis/attrs.py +2 -0
  17. wandb/apis/importers/internals/internal.py +16 -23
  18. wandb/apis/internal.py +2 -4
  19. wandb/apis/normalize.py +4 -1
  20. wandb/apis/public/__init__.py +45 -2
  21. wandb/apis/public/api.py +335 -231
  22. wandb/apis/public/artifacts.py +426 -338
  23. wandb/apis/public/automations.py +2 -1
  24. wandb/apis/public/const.py +2 -0
  25. wandb/apis/public/files.py +69 -44
  26. wandb/apis/public/history.py +2 -0
  27. wandb/apis/public/jobs.py +20 -18
  28. wandb/apis/public/projects.py +6 -3
  29. wandb/apis/public/query_generator.py +3 -0
  30. wandb/apis/public/registries/__init__.py +7 -0
  31. wandb/apis/public/registries/_freezable_list.py +18 -20
  32. wandb/apis/public/registries/_members.py +110 -0
  33. wandb/apis/public/registries/_utils.py +47 -57
  34. wandb/apis/public/registries/registries_search.py +107 -98
  35. wandb/apis/public/registries/registry.py +486 -182
  36. wandb/apis/public/reports.py +2 -0
  37. wandb/apis/public/runs.py +305 -62
  38. wandb/apis/public/sweeps.py +10 -9
  39. wandb/apis/public/teams.py +10 -1
  40. wandb/apis/public/users.py +6 -1
  41. wandb/apis/public/utils.py +57 -32
  42. wandb/automations/_filters/expressions.py +3 -2
  43. wandb/automations/_filters/operators.py +6 -3
  44. wandb/automations/_filters/run_metrics.py +38 -33
  45. wandb/automations/_generated/__init__.py +54 -127
  46. wandb/automations/_generated/create_automation.py +2 -2
  47. wandb/automations/_generated/create_generic_webhook_integration.py +7 -12
  48. wandb/automations/_generated/delete_automation.py +2 -2
  49. wandb/automations/_generated/fragments.py +128 -225
  50. wandb/automations/_generated/generic_webhook_integrations_by_entity.py +3 -3
  51. wandb/automations/_generated/get_automations.py +3 -3
  52. wandb/automations/_generated/get_automations_by_entity.py +3 -3
  53. wandb/automations/_generated/input_types.py +9 -9
  54. wandb/automations/_generated/integrations_by_entity.py +3 -3
  55. wandb/automations/_generated/operations.py +6 -6
  56. wandb/automations/_generated/slack_integrations_by_entity.py +3 -3
  57. wandb/automations/_generated/update_automation.py +2 -2
  58. wandb/automations/_utils.py +10 -10
  59. wandb/automations/_validators.py +22 -2
  60. wandb/automations/actions.py +8 -6
  61. wandb/automations/automations.py +6 -5
  62. wandb/automations/events.py +22 -24
  63. wandb/automations/integrations.py +2 -2
  64. wandb/automations/scopes.py +1 -1
  65. wandb/beta/workflows.py +11 -11
  66. wandb/bin/gpu_stats +0 -0
  67. wandb/bin/wandb-core +0 -0
  68. wandb/cli/beta.py +73 -135
  69. wandb/cli/beta_leet.py +75 -0
  70. wandb/cli/beta_sync.py +224 -0
  71. wandb/cli/cli.py +58 -26
  72. wandb/errors/errors.py +3 -3
  73. wandb/errors/term.py +130 -16
  74. wandb/filesync/upload_job.py +3 -2
  75. wandb/integration/dspy/__init__.py +5 -0
  76. wandb/integration/dspy/dspy.py +422 -0
  77. wandb/integration/keras/keras.py +11 -11
  78. wandb/integration/langchain/wandb_tracer.py +5 -5
  79. wandb/integration/weave/weave.py +55 -0
  80. wandb/jupyter.py +21 -66
  81. wandb/old/settings.py +14 -9
  82. wandb/proto/v3/wandb_api_pb2.py +86 -0
  83. wandb/proto/v3/wandb_internal_pb2.py +235 -224
  84. wandb/proto/v3/wandb_server_pb2.py +39 -57
  85. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  86. wandb/proto/v3/wandb_sync_pb2.py +113 -0
  87. wandb/proto/v3/wandb_telemetry_pb2.py +12 -12
  88. wandb/proto/v4/wandb_api_pb2.py +37 -0
  89. wandb/proto/v4/wandb_internal_pb2.py +226 -224
  90. wandb/proto/v4/wandb_server_pb2.py +39 -41
  91. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  92. wandb/proto/v4/wandb_sync_pb2.py +46 -0
  93. wandb/proto/v4/wandb_telemetry_pb2.py +12 -12
  94. wandb/proto/v5/wandb_api_pb2.py +38 -0
  95. wandb/proto/v5/wandb_internal_pb2.py +226 -224
  96. wandb/proto/v5/wandb_server_pb2.py +39 -41
  97. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  98. wandb/proto/v5/wandb_sync_pb2.py +47 -0
  99. wandb/proto/v5/wandb_telemetry_pb2.py +12 -12
  100. wandb/proto/v6/wandb_api_pb2.py +48 -0
  101. wandb/proto/v6/wandb_base_pb2.py +3 -3
  102. wandb/proto/v6/wandb_internal_pb2.py +229 -227
  103. wandb/proto/v6/wandb_server_pb2.py +42 -44
  104. wandb/proto/v6/wandb_settings_pb2.py +5 -5
  105. wandb/proto/v6/wandb_sync_pb2.py +57 -0
  106. wandb/proto/v6/wandb_telemetry_pb2.py +15 -15
  107. wandb/proto/wandb_api_pb2.py +18 -0
  108. wandb/proto/wandb_generate_proto.py +2 -0
  109. wandb/proto/wandb_sync_pb2.py +12 -0
  110. wandb/sdk/__init__.py +0 -1
  111. wandb/sdk/artifacts/_factories.py +4 -7
  112. wandb/sdk/artifacts/_generated/__init__.py +228 -430
  113. wandb/sdk/artifacts/_generated/add_aliases.py +4 -6
  114. wandb/sdk/artifacts/_generated/add_artifact_collection_tags.py +26 -0
  115. wandb/sdk/artifacts/_generated/artifact_by_id.py +2 -2
  116. wandb/sdk/artifacts/_generated/artifact_by_name.py +3 -3
  117. wandb/sdk/artifacts/_generated/artifact_collection_membership_file_urls.py +28 -8
  118. wandb/sdk/artifacts/_generated/artifact_collection_membership_files.py +29 -8
  119. wandb/sdk/artifacts/_generated/artifact_created_by.py +9 -22
  120. wandb/sdk/artifacts/_generated/artifact_file_urls.py +19 -6
  121. wandb/sdk/artifacts/_generated/artifact_membership_by_name.py +26 -0
  122. wandb/sdk/artifacts/_generated/artifact_type.py +5 -5
  123. wandb/sdk/artifacts/_generated/artifact_used_by.py +8 -17
  124. wandb/sdk/artifacts/_generated/artifact_version_files.py +20 -8
  125. wandb/sdk/artifacts/_generated/create_registry_members.py +19 -0
  126. wandb/sdk/artifacts/_generated/delete_aliases.py +4 -6
  127. wandb/sdk/artifacts/_generated/delete_artifact.py +7 -11
  128. wandb/sdk/artifacts/_generated/delete_artifact_collection_tags.py +23 -0
  129. wandb/sdk/artifacts/_generated/delete_artifact_portfolio.py +6 -5
  130. wandb/sdk/artifacts/_generated/delete_artifact_sequence.py +6 -5
  131. wandb/sdk/artifacts/_generated/delete_registry.py +21 -0
  132. wandb/sdk/artifacts/_generated/delete_registry_members.py +19 -0
  133. wandb/sdk/artifacts/_generated/fetch_artifact_manifest.py +8 -20
  134. wandb/sdk/artifacts/_generated/fetch_linked_artifacts.py +13 -35
  135. wandb/sdk/artifacts/_generated/fetch_org_info_from_entity.py +28 -0
  136. wandb/sdk/artifacts/_generated/fetch_registries.py +18 -8
  137. wandb/sdk/{projects → artifacts}/_generated/fetch_registry.py +4 -4
  138. wandb/sdk/artifacts/_generated/fragments.py +239 -297
  139. wandb/sdk/artifacts/_generated/input_types.py +159 -7
  140. wandb/sdk/artifacts/_generated/link_artifact.py +7 -7
  141. wandb/sdk/artifacts/_generated/operations.py +1228 -574
  142. wandb/sdk/artifacts/_generated/project_artifact_collection.py +9 -77
  143. wandb/sdk/artifacts/_generated/project_artifact_collections.py +21 -9
  144. wandb/sdk/artifacts/_generated/project_artifact_type.py +3 -3
  145. wandb/sdk/artifacts/_generated/project_artifact_types.py +19 -6
  146. wandb/sdk/artifacts/_generated/project_artifacts.py +9 -9
  147. wandb/sdk/artifacts/_generated/registry_collections.py +21 -9
  148. wandb/sdk/artifacts/_generated/registry_team_members.py +24 -0
  149. wandb/sdk/artifacts/_generated/registry_user_members.py +22 -0
  150. wandb/sdk/artifacts/_generated/registry_versions.py +20 -9
  151. wandb/sdk/artifacts/_generated/rename_registry.py +25 -0
  152. wandb/sdk/artifacts/_generated/run_input_artifacts.py +7 -31
  153. wandb/sdk/artifacts/_generated/run_output_artifacts.py +7 -31
  154. wandb/sdk/artifacts/_generated/type_info.py +19 -0
  155. wandb/sdk/artifacts/_generated/unlink_artifact.py +4 -10
  156. wandb/sdk/artifacts/_generated/update_artifact.py +5 -9
  157. wandb/sdk/artifacts/_generated/update_artifact_collection_type.py +28 -0
  158. wandb/sdk/artifacts/_generated/update_artifact_portfolio.py +7 -16
  159. wandb/sdk/artifacts/_generated/update_artifact_sequence.py +7 -16
  160. wandb/sdk/artifacts/_generated/update_team_registry_role.py +19 -0
  161. wandb/sdk/artifacts/_generated/update_user_registry_role.py +19 -0
  162. wandb/sdk/artifacts/_generated/upsert_registry.py +25 -0
  163. wandb/sdk/artifacts/_gqlutils.py +216 -0
  164. wandb/sdk/artifacts/_internal_artifact.py +4 -4
  165. wandb/sdk/artifacts/_models/__init__.py +13 -0
  166. wandb/sdk/artifacts/_models/artifact_collection.py +114 -0
  167. wandb/sdk/artifacts/_models/base_model.py +20 -0
  168. wandb/sdk/artifacts/_models/manifest.py +27 -0
  169. wandb/sdk/artifacts/_models/pagination.py +26 -0
  170. wandb/sdk/artifacts/_models/registry.py +110 -0
  171. wandb/sdk/artifacts/_models/storage.py +29 -0
  172. wandb/sdk/artifacts/_validators.py +161 -122
  173. wandb/sdk/artifacts/artifact.py +571 -519
  174. wandb/sdk/artifacts/artifact_file_cache.py +12 -8
  175. wandb/sdk/artifacts/artifact_manifest.py +38 -32
  176. wandb/sdk/artifacts/artifact_manifest_entry.py +147 -140
  177. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +43 -61
  178. wandb/sdk/artifacts/artifact_saver.py +1 -1
  179. wandb/sdk/artifacts/exceptions.py +4 -3
  180. wandb/sdk/artifacts/storage_handler.py +18 -12
  181. wandb/sdk/artifacts/storage_handlers/_timing.py +34 -0
  182. wandb/sdk/artifacts/storage_handlers/azure_handler.py +11 -6
  183. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +143 -108
  184. wandb/sdk/artifacts/storage_handlers/http_handler.py +70 -61
  185. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +66 -59
  186. wandb/sdk/artifacts/storage_handlers/multi_handler.py +5 -4
  187. wandb/sdk/artifacts/storage_handlers/s3_handler.py +38 -35
  188. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +6 -4
  189. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +24 -21
  190. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +6 -3
  191. wandb/sdk/artifacts/storage_layout.py +9 -1
  192. wandb/sdk/artifacts/storage_policies/_factories.py +68 -0
  193. wandb/sdk/artifacts/storage_policies/_multipart.py +191 -0
  194. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +120 -365
  195. wandb/sdk/artifacts/storage_policy.py +26 -12
  196. wandb/sdk/backend/backend.py +7 -5
  197. wandb/sdk/data_types/bokeh.py +5 -1
  198. wandb/sdk/data_types/image.py +19 -8
  199. wandb/sdk/data_types/object_3d.py +67 -2
  200. wandb/sdk/interface/interface.py +165 -126
  201. wandb/sdk/interface/interface_queue.py +31 -12
  202. wandb/sdk/interface/interface_shared.py +70 -30
  203. wandb/sdk/interface/interface_sock.py +16 -6
  204. wandb/sdk/internal/_generated/__init__.py +2 -12
  205. wandb/sdk/internal/_generated/server_features_query.py +4 -4
  206. wandb/sdk/internal/datastore.py +0 -12
  207. wandb/sdk/internal/file_stream.py +4 -3
  208. wandb/sdk/internal/internal_api.py +348 -321
  209. wandb/sdk/internal/job_builder.py +27 -10
  210. wandb/sdk/internal/sender.py +8 -4
  211. wandb/sdk/internal/settings_static.py +2 -82
  212. wandb/sdk/launch/_launch.py +2 -2
  213. wandb/sdk/launch/agent/agent.py +9 -8
  214. wandb/sdk/launch/create_job.py +2 -1
  215. wandb/sdk/launch/inputs/internal.py +25 -24
  216. wandb/sdk/launch/inputs/schema.py +40 -7
  217. wandb/sdk/launch/runner/kubernetes_runner.py +25 -20
  218. wandb/sdk/launch/sweeps/scheduler.py +2 -1
  219. wandb/sdk/launch/sweeps/utils.py +2 -2
  220. wandb/sdk/launch/utils.py +82 -1
  221. wandb/sdk/lib/apikey.py +39 -68
  222. wandb/sdk/lib/asyncio_compat.py +89 -24
  223. wandb/sdk/lib/asyncio_manager.py +5 -5
  224. wandb/sdk/lib/config_util.py +4 -2
  225. wandb/sdk/lib/console_capture.py +38 -30
  226. wandb/sdk/lib/credentials.py +2 -2
  227. wandb/sdk/lib/deprecation.py +28 -0
  228. wandb/sdk/lib/disabled.py +6 -6
  229. wandb/sdk/lib/gql_request.py +20 -8
  230. wandb/sdk/lib/paths.py +23 -21
  231. wandb/sdk/lib/printer.py +9 -13
  232. wandb/sdk/lib/progress.py +164 -133
  233. wandb/sdk/lib/retry.py +5 -4
  234. wandb/sdk/lib/server.py +2 -1
  235. wandb/sdk/lib/service/service_client.py +5 -9
  236. wandb/sdk/lib/service/service_connection.py +77 -31
  237. wandb/sdk/lib/service/service_process.py +4 -4
  238. wandb/sdk/lib/timed_input.py +28 -21
  239. wandb/sdk/lib/wb_logging.py +2 -1
  240. wandb/sdk/mailbox/mailbox.py +1 -1
  241. wandb/sdk/mailbox/mailbox_handle.py +2 -0
  242. wandb/sdk/mailbox/wait_with_progress.py +1 -1
  243. wandb/sdk/wandb_init.py +71 -49
  244. wandb/sdk/wandb_login.py +87 -56
  245. wandb/sdk/wandb_run.py +111 -111
  246. wandb/sdk/wandb_settings.py +223 -44
  247. wandb/sdk/wandb_setup.py +7 -6
  248. wandb/sdk/wandb_summary.py +0 -1
  249. wandb/sdk/wandb_sweep.py +3 -2
  250. wandb/sync/sync.py +7 -4
  251. wandb/util.py +122 -157
  252. wandb/wandb_agent.py +44 -9
  253. {wandb-0.21.2.dist-info → wandb-0.23.0rc1.dist-info}/METADATA +60 -40
  254. {wandb-0.21.2.dist-info → wandb-0.23.0rc1.dist-info}/RECORD +816 -787
  255. wandb/proto/wandb_deprecated.py +0 -59
  256. wandb/proto/wandb_generate_deprecated.py +0 -30
  257. wandb/sdk/artifacts/_generated/artifact_via_membership_by_name.py +0 -26
  258. wandb/sdk/artifacts/_generated/create_artifact_collection_tag_assignments.py +0 -36
  259. wandb/sdk/artifacts/_generated/delete_artifact_collection_tag_assignments.py +0 -25
  260. wandb/sdk/artifacts/_generated/move_artifact_collection.py +0 -35
  261. wandb/sdk/artifacts/_graphql_fragments.py +0 -19
  262. wandb/sdk/lib/deprecate.py +0 -27
  263. wandb/sdk/projects/_generated/__init__.py +0 -47
  264. wandb/sdk/projects/_generated/delete_project.py +0 -22
  265. wandb/sdk/projects/_generated/enums.py +0 -4
  266. wandb/sdk/projects/_generated/fragments.py +0 -41
  267. wandb/sdk/projects/_generated/input_types.py +0 -13
  268. wandb/sdk/projects/_generated/operations.py +0 -88
  269. wandb/sdk/projects/_generated/rename_project.py +0 -27
  270. wandb/sdk/projects/_generated/upsert_registry_project.py +0 -27
  271. wandb/sdk/wandb_sync.py +0 -71
  272. {wandb-0.21.2.dist-info → wandb-0.23.0rc1.dist-info}/WHEEL +0 -0
  273. {wandb-0.21.2.dist-info → wandb-0.23.0rc1.dist-info}/entry_points.txt +0 -0
  274. {wandb-0.21.2.dist-info → wandb-0.23.0rc1.dist-info}/licenses/LICENSE +0 -0
package_readme.md CHANGED
@@ -1,88 +1,107 @@
1
1
  <div align="center">
2
- <img src="https://i.imgur.com/RUtiVzH.png" width="600" /><br><br>
2
+ <img src="https://i.imgur.com/dQLeGCc.png" width="600" /><br><br>
3
3
  </div>
4
4
 
5
- # Weights and Biases [![PyPI](https://img.shields.io/pypi/v/wandb)](https://pypi.python.org/pypi/wandb) [![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/wandb)](https://anaconda.org/conda-forge/wandb) [![CircleCI](https://img.shields.io/circleci/build/github/wandb/wandb/main)](https://circleci.com/gh/wandb/wandb) [![Codecov](https://img.shields.io/codecov/c/gh/wandb/wandb)](https://codecov.io/gh/wandb/wandb)
5
+ <p align="center">
6
+ <a href="https://pypi.python.org/pypi/wandb"><img src="https://img.shields.io/pypi/v/wandb" /></a>
7
+ <a href="https://anaconda.org/conda-forge/wandb"><img src="https://img.shields.io/conda/vn/conda-forge/wandb" /></a>
8
+ <a href="https://pypi.python.org/pypi/wandb"><img src="https://img.shields.io/pypi/pyversions/wandb" /></a>
9
+ <a href="https://circleci.com/gh/wandb/wandb"><img src="https://img.shields.io/circleci/build/github/wandb/wandb/main" /></a>
10
+ <a href="https://codecov.io/gh/wandb/wandb"><img src="https://img.shields.io/codecov/c/gh/wandb/wandb" /></a>
11
+ </p>
12
+ <p align='center'>
13
+ <a href="https://colab.research.google.com/github/wandb/examples/blob/master/colabs/intro/Intro_to_Weights_%26_Biases.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" /></a>
14
+ </p>
6
15
 
7
- Use W&B to build better models faster. Track and visualize all the pieces of your machine learning pipeline, from datasets to production machine learning models. Get started with W&B today, [sign up for an account!](https://wandb.com?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=readme)
16
+ Use W&B to build better models faster. Track and visualize all the pieces of your machine learning pipeline, from datasets to production machine learning models. Get started with W&B today, [sign up for a W&B account](https://wandb.com?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=readme)!
8
17
 
18
+ <br>
9
19
 
20
+ Building an LLM app? Track, debug, evaluate, and monitor LLM apps with [Weave](https://wandb.github.io/weave?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=readme), our new suite of tools for GenAI.
10
21
 
11
- See the [W&B Developer Guide](https://docs.wandb.ai/?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=documentation) and [API Reference Guide](https://docs.wandb.ai/ref?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=documentation) for a full technical description of the W&B platform.
22
+ &nbsp;
23
+
24
+ # Documentation
25
+
26
+ See the [W&B Developer Guide](https://docs.wandb.ai/?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=documentation) and [API Reference Guide](https://docs.wandb.ai/training/api-reference#api-overview?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=documentation) for a full technical description of the W&B platform.
12
27
 
13
28
  &nbsp;
14
29
 
15
30
  # Quickstart
16
31
 
17
- Get started with W&B in four steps:
32
+ Install W&B to track, visualize, and manage machine learning experiments of any size.
18
33
 
19
- 1. First, sign up for a [W&B account](https://wandb.ai/login?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=quickstart).
20
-
21
- 2. Second, install the W&B SDK with [pip](https://pip.pypa.io/en/stable/). Navigate to your terminal and type the following command:
34
+ ## Install the wandb library
22
35
 
23
36
  ```shell
24
37
  pip install wandb
25
38
  ```
26
39
 
27
- 3. Third, log into W&B:
40
+ ## Sign up and create an API key
28
41
 
29
- ```python
30
- wandb.login()
31
- ```
42
+ Sign up for a [W&B account](https://wandb.ai/login?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=quickstart). Optionally, use the `wandb login` CLI to configure an API key on your machine. You can skip this step -- W&B will prompt you for an API key the first time you use it.
32
43
 
33
- 4. Use the example code snippet below as a template to integrate W&B to your Python script:
44
+ ## Create a machine learning training experiment
45
+
46
+ In your Python script or notebook, initialize a W&B run with `wandb.init()`.
47
+ Specify hyperparameters and log metrics and other information to W&B.
34
48
 
35
49
  ```python
36
50
  import wandb
37
51
 
38
- # Start a W&B Run with wandb.init
39
- run = wandb.init(project="my_first_project")
40
-
41
- # Save model inputs and hyperparameters in a wandb.config object
42
- config = run.config
43
- config.learning_rate = 0.01
52
+ # Project that the run is recorded to
53
+ project = "my-awesome-project"
44
54
 
45
- # Model training code here ...
55
+ # Dictionary with hyperparameters
56
+ config = {"epochs" : 1337, "lr" : 3e-4}
46
57
 
47
- # Log metrics over time to visualize performance with wandb.log
48
- for i in range(10):
49
- run.log({"loss": ...})
58
+ # The `with` syntax marks the run as finished upon exiting the `with` block,
59
+ # and it marks the run "failed" if there's an exception.
60
+ #
61
+ # In a notebook, it may be more convenient to write `run = wandb.init()`
62
+ # and manually call `run.finish()` instead of using a `with` block.
63
+ with wandb.init(project=project, config=config) as run:
64
+ # Training code here
50
65
 
51
- # Mark the run as finished, and finish uploading all data
52
- run.finish()
66
+ # Log values to W&B with run.log()
67
+ run.log({"accuracy": 0.9, "loss": 0.1})
53
68
  ```
54
69
 
55
- For example, if the preceding code was stored in a script called train.py:
70
+ Visit [wandb.ai/home](https://wandb.ai/home) to view recorded metrics such as accuracy and loss and how they changed during each training step. Each run object appears in the Runs column with generated names.
56
71
 
57
- ```shell
58
- python train.py
59
- ```
72
+ &nbsp;
60
73
 
61
- You will see a URL in your terminal logs when your script starts and finishes. Data is staged locally in a directory named _wandb_ relative to your script. Navigate to the W&B App to view a dashboard of your first W&B Experiment. Use the W&B App to compare multiple experiments in a unified place, dive into the results of a single run, and much more!
74
+ # Integrations
75
+
76
+ W&B [integrates](https://docs.wandb.ai/models/integrations) with popular ML frameworks and libraries making it fast and easy to set up experiment tracking and data versioning inside existing projects.
77
+
78
+ For developers adding W&B to a new framework, follow the [W&B Developer Guide](https://docs.wandb.ai/models/integrations/add-wandb-to-any-library).
62
79
 
63
80
  &nbsp;
64
81
 
65
- # Integrations
82
+ # W&B Hosting Options
83
+
84
+ Weights & Biases is available in the cloud or installed on your private infrastructure. Set up a W&B Server in a production environment in one of three ways:
66
85
 
67
- Use your favorite framework with W&B. W&B integrations make it fast and easy to set up experiment tracking and data versioning inside existing projects. For more information on how to integrate W&B with the framework of your choice, see [W&B Integrations](https://docs.wandb.ai/guides/integrations) in the W&B Developer Guide.
86
+ 1. [Multi-tenant Cloud](https://docs.wandb.ai/platform/hosting/hosting-options/multi_tenant_cloud?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=hosting): Fully managed platform deployed in W&B’s Google Cloud Platform (GCP) account in GCP’s North America regions.
87
+ 2. [Dedicated Cloud](https://docs.wandb.ai/platform/hosting/hosting-options/dedicated_cloud?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=hosting): Single-tenant, fully managed platform deployed in W&B’s AWS, GCP, or Azure cloud accounts. Each Dedicated Cloud instance has its own isolated network, compute and storage from other W&B Dedicated Cloud instances.
88
+ 3. [Self-Managed](https://docs.wandb.ai/platform/hosting/hosting-options/self-managed?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=hosting): Deploy W&B Server on your AWS, GCP, or Azure cloud account or within your on-premises infrastructure.
89
+
90
+ See the [Hosting documentation](https://docs.wandb.ai/guides/hosting?utm_source=github&utm_medium=code&utm_campaign=wandb&utm_content=hosting) in the W&B Developer Guide for more information.
68
91
 
69
92
  &nbsp;
70
93
 
71
94
  # Python Version Support
72
95
 
73
- We are committed to supporting our minimum required Python version for *at least* six months after its official end-of-life (EOL) date, as defined by the Python Software Foundation. You can find a list of Python EOL dates [here](https://devguide.python.org/versions/).
96
+ We are committed to supporting our minimum required Python version for _at least_ six months after its official end-of-life (EOL) date, as defined by the Python Software Foundation. You can find a list of Python EOL dates [here](https://devguide.python.org/versions/).
74
97
 
75
98
  When we discontinue support for a Python version, we will increment the library’s minor version number to reflect this change.
76
99
 
77
100
  &nbsp;
78
101
 
79
102
  # Contribution guidelines
80
- Weights & Biases ❤️ open source, and we welcome contributions from the community! See the [Contribution guide](https://github.com/wandb/wandb/blob/main/CONTRIBUTING.md) for more information on the development workflow and the internals of the wandb library. For wandb bugs and feature requests, visit [GitHub Issues](https://github.com/wandb/wandb/issues) or contact support@wandb.com.
81
103
 
82
- &nbsp;
83
-
84
- # Academic Researchers
85
- Reach out to W&B Support at support@wandb.com to get a [free academic license](https://www.wandb.com/academic) for you and your research group.
104
+ Weights & Biases ❤️ open source, and we welcome contributions from the community! See the [Contribution guide](https://github.com/wandb/wandb/blob/main/CONTRIBUTING.md) for more information on the development workflow and the internals of the wandb library. For wandb bugs and feature requests, visit [GitHub Issues](https://github.com/wandb/wandb/issues) or contact support@wandb.com.
86
105
 
87
106
  &nbsp;
88
107
 
wandb/__init__.py CHANGED
@@ -6,11 +6,11 @@ For guides and examples, see https://docs.wandb.ai.
6
6
 
7
7
  For scripts and interactive notebooks, see https://github.com/wandb/examples.
8
8
 
9
- For reference documentation, see https://docs.wandb.com/ref/python.
9
+ For reference documentation, see https://docs.wandb.ai/models/ref/python.
10
10
  """
11
11
  from __future__ import annotations
12
12
 
13
- __version__ = "0.21.2"
13
+ __version__ = "0.23.0rc1"
14
14
 
15
15
 
16
16
  from wandb.errors import Error
@@ -31,7 +31,6 @@ wandb.wandb_lib = wandb_sdk.lib # type: ignore
31
31
  init = wandb_sdk.init
32
32
  setup = wandb_sdk.setup
33
33
  attach = _attach = wandb_sdk._attach
34
- _sync = wandb_sdk._sync
35
34
  teardown = _teardown = wandb_sdk.teardown
36
35
  finish = wandb_sdk.finish
37
36
  join = finish
@@ -53,7 +52,6 @@ _lazyloader = wandb.wandb_lib.lazyloader # type: ignore
53
52
 
54
53
  from wandb.integration.torch import wandb_torch
55
54
 
56
- # Move this (keras.__init__ expects it at top level)
57
55
  from wandb.sdk.data_types._private import _cleanup_media_tmp_dir
58
56
 
59
57
  _cleanup_media_tmp_dir()
@@ -61,8 +59,6 @@ _cleanup_media_tmp_dir()
61
59
  from wandb.data_types import Graph
62
60
  from wandb.data_types import Image
63
61
  from wandb.data_types import Plotly
64
-
65
- # from wandb.data_types import Bokeh # keeping out of top level for now since Bokeh plots have poor UI
66
62
  from wandb.data_types import Video
67
63
  from wandb.data_types import Audio
68
64
  from wandb.data_types import Table
@@ -84,31 +80,6 @@ from wandb.sdk.wandb_run import Run
84
80
  # Artifact import types
85
81
  from wandb.sdk.artifacts.artifact_ttl import ArtifactTTL
86
82
 
87
- # Used to make sure we don't use some code in the incorrect process context
88
- _IS_INTERNAL_PROCESS = False
89
-
90
-
91
- def _set_internal_process(disable=False):
92
- global _IS_INTERNAL_PROCESS
93
- if _IS_INTERNAL_PROCESS is None:
94
- return
95
- if disable:
96
- _IS_INTERNAL_PROCESS = None
97
- return
98
- _IS_INTERNAL_PROCESS = True
99
-
100
-
101
- def _assert_is_internal_process():
102
- if _IS_INTERNAL_PROCESS is None:
103
- return
104
- assert _IS_INTERNAL_PROCESS
105
-
106
-
107
- def _assert_is_user_process():
108
- if _IS_INTERNAL_PROCESS is None:
109
- return
110
- assert not _IS_INTERNAL_PROCESS
111
-
112
83
 
113
84
  # globals
114
85
  Api = PublicApi
@@ -177,10 +148,9 @@ def ensure_configured():
177
148
 
178
149
 
179
150
  def set_trace():
180
- import pdb # TODO: support other debuggers
151
+ import pdb
181
152
 
182
- # frame = sys._getframe().f_back
183
- pdb.set_trace() # TODO: pass the parent stack...
153
+ pdb.set_trace()
184
154
 
185
155
 
186
156
  def load_ipython_extension(ipython):
@@ -193,8 +163,6 @@ if wandb_sdk.lib.ipython.in_notebook():
193
163
  load_ipython_extension(get_ipython())
194
164
 
195
165
 
196
- from .analytics import Sentry as _Sentry
197
-
198
166
  if "dev" in __version__:
199
167
  import wandb.env
200
168
  import os
@@ -205,9 +173,6 @@ if "dev" in __version__:
205
173
  "false",
206
174
  )
207
175
 
208
- _sentry = _Sentry()
209
- _sentry.setup()
210
-
211
176
 
212
177
  __all__ = (
213
178
  "__version__",
wandb/__init__.pyi CHANGED
@@ -75,7 +75,6 @@ from typing import (
75
75
  )
76
76
 
77
77
  import wandb.plot as plot
78
- from wandb.analytics import Sentry
79
78
  from wandb.apis import InternalApi
80
79
  from wandb.apis import PublicApi as Api
81
80
  from wandb.data_types import (
@@ -107,14 +106,13 @@ if TYPE_CHECKING:
107
106
  import wandb
108
107
  from wandb.plot import CustomChart
109
108
 
110
- __version__: str = "0.21.2"
109
+ __version__: str = "0.23.0rc1"
111
110
 
112
111
  run: Run | None
113
112
  config: wandb_config.Config
114
113
  summary: wandb_summary.Summary
115
114
 
116
115
  # private attributes
117
- _sentry: Sentry
118
116
  api: InternalApi
119
117
  patched: Dict[str, List[Callable]]
120
118
 
@@ -388,8 +386,8 @@ def init(
388
386
  enable on your settings page.
389
387
  tensorboard: Deprecated. Use `sync_tensorboard` instead.
390
388
  sync_tensorboard: Enables automatic syncing of W&B logs from TensorBoard
391
- or TensorBoardX, saving relevant event files for viewing in the W&B UI.
392
- saving relevant event files for viewing in the W&B UI. (Default: `False`)
389
+ or TensorBoardX, saving relevant event files for viewing in
390
+ the W&B UI.
393
391
  monitor_gym: Enables automatic logging of videos of the environment when
394
392
  using OpenAI Gym.
395
393
  settings: Specifies a dictionary or `wandb.Settings` object with advanced
@@ -446,14 +444,14 @@ def finish(
446
444
  ...
447
445
 
448
446
  def login(
449
- anonymous: Optional[Literal["must", "allow", "never"]] = None,
450
- key: Optional[str] = None,
451
- relogin: Optional[bool] = None,
452
- host: Optional[str] = None,
453
- force: Optional[bool] = None,
454
- timeout: Optional[int] = None,
447
+ anonymous: Literal["must", "allow", "never"] | None = None,
448
+ key: str | None = None,
449
+ relogin: bool | None = None,
450
+ host: str | None = None,
451
+ force: bool | None = None,
452
+ timeout: int | None = None,
455
453
  verify: bool = False,
456
- referrer: Optional[str] = None,
454
+ referrer: str | None = None,
457
455
  ) -> bool:
458
456
  """Set up W&B login credentials.
459
457
 
@@ -580,7 +578,7 @@ def log(
580
578
  run.log({"accuracy": 0.8}, step=current_step)
581
579
  current_step += 1
582
580
  run.log({"train-loss": 0.4}, step=current_step)
583
- run.log({"accuracy": 0.9}, step=current_step)
581
+ run.log({"accuracy": 0.9}, step=current_step, commit=True)
584
582
  ```
585
583
 
586
584
  Args:
@@ -754,6 +752,9 @@ def save(
754
752
  When given an absolute path or glob and no `base_path`, one
755
753
  directory level is preserved as in the example above.
756
754
 
755
+ Files are automatically deduplicated: calling `save()` multiple times
756
+ on the same file without modifications will not re-upload it.
757
+
757
758
  Args:
758
759
  glob_str: A relative or absolute path or Unix glob.
759
760
  base_path: A path to use to infer a directory structure; see examples.
@@ -778,10 +779,10 @@ def save(
778
779
  run.save("these/are/myfiles/*", base_path="these")
779
780
  # => Saves files in an "are/myfiles/" folder in the run.
780
781
 
781
- run.save("/User/username/Documents/run123/*.txt")
782
+ run.save("/Users/username/Documents/run123/*.txt")
782
783
  # => Saves files in a "run123/" folder in the run. See note below.
783
784
 
784
- run.save("/User/username/Documents/run123/*.txt", base_path="/User")
785
+ run.save("/Users/username/Documents/run123/*.txt", base_path="/Users")
785
786
  # => Saves files in a "username/Documents/run123/" folder in the run.
786
787
 
787
788
  run.save("files/*/saveme.txt")
wandb/_analytics.py ADDED
@@ -0,0 +1,65 @@
1
+ from __future__ import annotations
2
+
3
+ from contextvars import ContextVar
4
+ from dataclasses import dataclass, field
5
+ from functools import wraps
6
+ from typing import Callable, Final, TypeVar
7
+ from uuid import UUID, uuid4
8
+
9
+ from typing_extensions import ParamSpec
10
+
11
+ from wandb._strutils import nameof
12
+
13
+ P = ParamSpec("P")
14
+ R = TypeVar("R")
15
+
16
+ # Header keys for tracking the calling function
17
+ X_WANDB_PYTHON_FUNC: Final[str] = "X-Wandb-Python-Func"
18
+ X_WANDB_PYTHON_CALL_ID: Final[str] = "X-Wandb-Python-Call-Id"
19
+
20
+
21
+ @dataclass(frozen=True)
22
+ class TrackedFuncInfo:
23
+ func: str
24
+ """The fully qualified namespace of the tracked function."""
25
+
26
+ call_id: UUID = field(default_factory=uuid4)
27
+ """A unique identifier assigned to each invocation."""
28
+
29
+ def to_headers(self) -> dict[str, str]:
30
+ return {
31
+ X_WANDB_PYTHON_FUNC: self.func,
32
+ X_WANDB_PYTHON_CALL_ID: str(self.call_id),
33
+ }
34
+
35
+
36
+ _current_func: ContextVar[TrackedFuncInfo] = ContextVar("_current_func")
37
+ """An internal, threadsafe context variable to hold the current function being tracked."""
38
+
39
+
40
+ def tracked(func: Callable[P, R]) -> Callable[P, R]:
41
+ """A decorator to inject the calling function name into any GraphQL request headers.
42
+
43
+ If a tracked function calls another tracked function, only the outermost function in
44
+ the call stack will be tracked.
45
+ """
46
+ func_namespace = f"{func.__module__}.{nameof(func)}"
47
+
48
+ @wraps(func)
49
+ def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
50
+ # Don't override the current tracked function if it's already set
51
+ if tracked_func():
52
+ return func(*args, **kwargs)
53
+
54
+ token = _current_func.set(TrackedFuncInfo(func=func_namespace))
55
+ try:
56
+ return func(*args, **kwargs)
57
+ finally:
58
+ _current_func.reset(token)
59
+
60
+ return wrapper
61
+
62
+
63
+ def tracked_func() -> TrackedFuncInfo | None:
64
+ """Returns info on the current tracked function, if any, otherwise None."""
65
+ return _current_func.get(None)
wandb/_iterutils.py CHANGED
@@ -1,9 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from collections.abc import Hashable
3
4
  from typing import TYPE_CHECKING, Any, Iterable, TypeVar, Union, overload
4
5
 
5
6
  if TYPE_CHECKING:
6
7
  T = TypeVar("T")
8
+ HashableT = TypeVar("HashableT", bound=Hashable)
7
9
  ClassInfo = Union[type[T], tuple[type[T], ...]]
8
10
 
9
11
 
@@ -12,9 +14,9 @@ def always_list(obj: Iterable[T], base_type: ClassInfo = ...) -> list[T]: ...
12
14
  @overload
13
15
  def always_list(obj: T, base_type: ClassInfo = ...) -> list[T]: ...
14
16
  def always_list(obj: Any, base_type: Any = (str, bytes)) -> list[T]:
15
- """Return a guaranteed list of objects from a single instance OR iterable of such objects.
17
+ """Return a guaranteed list of objects from one instance OR an iterable of such items.
16
18
 
17
- By default, assume the returned list should have string-like elements (i.e. `str`/`bytes`).
19
+ By default, assume the returned list should have string-like elements (`str`/`bytes`).
18
20
 
19
21
  Adapted from `more_itertools.always_iterable`, but simplified for internal use. See:
20
22
  https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.always_iterable
@@ -22,6 +24,12 @@ def always_list(obj: Any, base_type: Any = (str, bytes)) -> list[T]:
22
24
  return [obj] if isinstance(obj, base_type) else list(obj)
23
25
 
24
26
 
27
+ def unique_list(iterable: Iterable[HashableT]) -> list[HashableT]:
28
+ """Return a deduplicated list of items from the given iterable, preserving order."""
29
+ # Trick for O(1) uniqueness check that maintains order
30
+ return list(dict.fromkeys(iterable))
31
+
32
+
25
33
  def one(
26
34
  iterable: Iterable[T],
27
35
  too_short: type[Exception] | Exception | None = None,
@@ -1,30 +1,37 @@
1
1
  """Internal utilities for working with pydantic."""
2
2
 
3
- from .base import (
4
- CompatBaseModel,
5
- GQLBase,
6
- GQLId,
7
- SerializedToJson,
8
- Typename,
9
- ensure_json,
10
- )
11
- from .utils import IS_PYDANTIC_V2, from_json, gql_typename, pydantic_isinstance, to_json
12
- from .v1_compat import AliasChoices, computed_field, field_validator, model_validator
13
-
14
3
  __all__ = [
15
4
  "IS_PYDANTIC_V2",
16
5
  "CompatBaseModel",
6
+ "JsonableModel",
17
7
  "GQLBase",
8
+ "GQLInput",
9
+ "GQLResult",
10
+ "Connection",
11
+ "ConnectionWithTotal",
12
+ "Edge",
13
+ "PageInfo",
18
14
  "Typename",
19
15
  "GQLId",
20
- "SerializedToJson",
21
16
  "AliasChoices",
22
17
  "computed_field",
23
18
  "field_validator",
24
19
  "model_validator",
25
20
  "pydantic_isinstance",
21
+ "to_camel",
26
22
  "to_json",
27
23
  "from_json",
28
- "ensure_json",
29
24
  "gql_typename",
30
25
  ]
26
+
27
+ from .base import CompatBaseModel, GQLBase, GQLInput, GQLResult, JsonableModel
28
+ from .field_types import GQLId, Typename
29
+ from .pagination import Connection, ConnectionWithTotal, Edge, PageInfo
30
+ from .utils import IS_PYDANTIC_V2, from_json, gql_typename, pydantic_isinstance, to_json
31
+ from .v1_compat import (
32
+ AliasChoices,
33
+ computed_field,
34
+ field_validator,
35
+ model_validator,
36
+ to_camel,
37
+ )