wandb 0.18.6__py3-none-any.whl → 0.19.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package_readme.md +8 -0
  2. wandb/__init__.py +5 -7
  3. wandb/__init__.pyi +51 -30
  4. wandb/analytics/sentry.py +4 -10
  5. wandb/apis/importers/internals/internal.py +6 -6
  6. wandb/apis/importers/internals/protocols.py +11 -7
  7. wandb/apis/public/api.py +5 -1
  8. wandb/apis/public/jobs.py +1 -7
  9. wandb/apis/public/reports.py +6 -17
  10. wandb/apis/public/runs.py +12 -10
  11. wandb/bin/gpu_stats +0 -0
  12. wandb/cli/cli.py +9 -45
  13. wandb/env.py +3 -5
  14. wandb/errors/links.py +1 -1
  15. wandb/errors/term.py +1 -6
  16. wandb/filesync/dir_watcher.py +3 -3
  17. wandb/filesync/step_upload.py +2 -5
  18. wandb/integration/fastai/__init__.py +1 -6
  19. wandb/integration/gym/__init__.py +1 -7
  20. wandb/integration/keras/callbacks/metrics_logger.py +1 -8
  21. wandb/integration/keras/callbacks/model_checkpoint.py +1 -8
  22. wandb/integration/keras/keras.py +3 -5
  23. wandb/integration/lightgbm/__init__.py +1 -1
  24. wandb/integration/sb3/sb3.py +1 -7
  25. wandb/integration/sklearn/utils.py +1 -1
  26. wandb/integration/tensorboard/log.py +1 -2
  27. wandb/integration/torch/wandb_torch.py +1 -1
  28. wandb/integration/ultralytics/bbox_utils.py +9 -2
  29. wandb/jupyter.py +4 -4
  30. wandb/proto/v3/wandb_internal_pb2.py +31 -31
  31. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  32. wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
  33. wandb/proto/v4/wandb_internal_pb2.py +31 -31
  34. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  35. wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
  36. wandb/proto/v5/wandb_internal_pb2.py +31 -31
  37. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  38. wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
  39. wandb/proto/wandb_deprecated.py +3 -11
  40. wandb/proto/wandb_generate_deprecated.py +3 -7
  41. wandb/sdk/artifacts/artifact.py +3 -11
  42. wandb/sdk/artifacts/artifact_file_cache.py +2 -5
  43. wandb/sdk/artifacts/artifact_saver.py +2 -6
  44. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +2 -4
  45. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +2 -4
  46. wandb/sdk/artifacts/storage_handlers/s3_handler.py +2 -4
  47. wandb/sdk/backend/backend.py +1 -1
  48. wandb/sdk/data_types/base_types/wb_value.py +20 -10
  49. wandb/sdk/data_types/histogram.py +1 -3
  50. wandb/sdk/data_types/object_3d.py +2 -6
  51. wandb/sdk/data_types/table.py +1 -1
  52. wandb/sdk/data_types/utils.py +1 -2
  53. wandb/sdk/data_types/video.py +15 -4
  54. wandb/sdk/integration_utils/auto_logging.py +1 -8
  55. wandb/sdk/interface/interface.py +12 -5
  56. wandb/sdk/interface/interface_queue.py +0 -6
  57. wandb/sdk/interface/interface_shared.py +9 -0
  58. wandb/sdk/interface/router.py +1 -2
  59. wandb/sdk/interface/router_queue.py +0 -3
  60. wandb/sdk/interface/router_relay.py +0 -2
  61. wandb/sdk/internal/file_stream.py +1 -4
  62. wandb/sdk/internal/flow_control.py +1 -1
  63. wandb/sdk/internal/handler.py +8 -5
  64. wandb/sdk/internal/internal.py +3 -17
  65. wandb/sdk/internal/internal_api.py +3 -10
  66. wandb/sdk/internal/internal_util.py +0 -3
  67. wandb/sdk/internal/job_builder.py +20 -12
  68. wandb/sdk/internal/progress.py +1 -5
  69. wandb/sdk/internal/sender.py +9 -15
  70. wandb/sdk/internal/settings_static.py +4 -10
  71. wandb/sdk/internal/system/assets/cpu.py +2 -2
  72. wandb/sdk/internal/system/assets/disk.py +3 -3
  73. wandb/sdk/internal/system/assets/gpu.py +7 -7
  74. wandb/sdk/internal/system/assets/gpu_amd.py +1 -7
  75. wandb/sdk/internal/system/assets/interfaces.py +11 -13
  76. wandb/sdk/internal/system/assets/ipu.py +1 -1
  77. wandb/sdk/internal/system/assets/memory.py +2 -2
  78. wandb/sdk/internal/system/assets/open_metrics.py +2 -8
  79. wandb/sdk/internal/system/assets/trainium.py +3 -9
  80. wandb/sdk/internal/system/system_info.py +14 -13
  81. wandb/sdk/internal/system/system_monitor.py +5 -12
  82. wandb/sdk/internal/tb_watcher.py +1 -1
  83. wandb/sdk/internal/writer.py +2 -4
  84. wandb/sdk/launch/__init__.py +2 -1
  85. wandb/sdk/launch/agent/run_queue_item_file_saver.py +1 -7
  86. wandb/sdk/launch/create_job.py +2 -3
  87. wandb/sdk/launch/runner/abstract.py +1 -6
  88. wandb/sdk/launch/runner/kubernetes_monitor.py +2 -4
  89. wandb/sdk/lib/apikey.py +2 -6
  90. wandb/sdk/lib/fsm.py +12 -6
  91. wandb/sdk/lib/ipython.py +1 -6
  92. wandb/sdk/lib/module.py +0 -3
  93. wandb/sdk/lib/progress.py +2 -3
  94. wandb/sdk/lib/run_moment.py +1 -7
  95. wandb/sdk/lib/server.py +10 -24
  96. wandb/sdk/lib/sock_client.py +0 -5
  97. wandb/sdk/service/server.py +3 -12
  98. wandb/sdk/service/server_sock.py +0 -2
  99. wandb/sdk/service/service.py +5 -5
  100. wandb/sdk/wandb_init.py +215 -166
  101. wandb/sdk/wandb_login.py +17 -27
  102. wandb/sdk/wandb_run.py +129 -161
  103. wandb/sdk/wandb_settings.py +978 -1760
  104. wandb/sdk/wandb_setup.py +87 -94
  105. wandb/sdk/wandb_watch.py +1 -1
  106. wandb/sync/sync.py +1 -2
  107. wandb/util.py +7 -40
  108. wandb/wandb_controller.py +10 -12
  109. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/METADATA +13 -4
  110. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/RECORD +113 -119
  111. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/WHEEL +1 -1
  112. wandb/integration/magic.py +0 -556
  113. wandb/magic.py +0 -3
  114. wandb/sdk/lib/_settings_toposort_generate.py +0 -159
  115. wandb/sdk/lib/_settings_toposort_generated.py +0 -250
  116. wandb/sdk/lib/reporting.py +0 -99
  117. wandb/sdk/lib/tracelog.py +0 -255
  118. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/entry_points.txt +0 -0
  119. {wandb-0.18.6.dist-info → wandb-0.19.0.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/lib/tracelog.py DELETED
@@ -1,255 +0,0 @@
1
- """tracelog.
2
-
3
- Functions:
4
- log_message_queue - message put() to queue
5
- log_message_dequeue - message get() from queue
6
- log_message_send - message sent to socket
7
- log_message_recv - message received from socket
8
- log_message_process - message processed by thread
9
- log_message_link - message linked to another message
10
- log_message_assert - message encountered problem
11
-
12
- """
13
-
14
- import datetime
15
- import logging
16
- import secrets
17
- import sys
18
- import threading
19
- from typing import TYPE_CHECKING, Optional, cast
20
-
21
- if TYPE_CHECKING:
22
- import multiprocessing
23
- import queue
24
- import socket
25
- from typing import Union
26
-
27
- from wandb.proto import wandb_internal_pb2 as pb
28
- from wandb.proto import wandb_server_pb2 as spb
29
-
30
- MessageQueueType = Union[pb.Record, pb.Result]
31
- MessageType = Union[pb.Record, pb.Result, spb.ServerRequest, spb.ServerResponse]
32
- QueueType = Union[multiprocessing.Queue, queue.Queue]
33
- TransportType = Union[socket.socket, str]
34
-
35
-
36
- # Supported modes:
37
- # logger - tracelog output goes to python logging (default)
38
- # stdout - tracelog output goes to stdout
39
- # stderr - tracelog output goes to stderr
40
- tracelog_mode: Optional[str] = "logger"
41
-
42
- logger = logging.getLogger(__name__)
43
-
44
-
45
- ANNOTATE_QUEUE_NAME = "_DEBUGLOG_QUEUE_NAME"
46
-
47
- # capture stdout and stderr before anyone messes with them
48
- stdout_write = sys.__stdout__.write # type: ignore
49
- stderr_write = sys.__stderr__.write # type: ignore
50
-
51
-
52
- def _log(
53
- msg_type: str,
54
- log_type: str,
55
- is_response: bool = False,
56
- record: Optional["pb.Record"] = None,
57
- result: Optional["pb.Result"] = None,
58
- resource: Optional[str] = None,
59
- ) -> None:
60
- prefix = "TRACELOG(1)"
61
- tname = threading.current_thread().name
62
- now = datetime.datetime.now()
63
- ts = now.strftime("%H%M%S.%f")
64
- arrow = "<-" if is_response else "->"
65
- resource = resource or "unknown"
66
- uuid = ""
67
- data = record or result
68
- record_id = ""
69
- if data:
70
- uuid = data.uuid or uuid
71
- record_id = data._info._tracelog_id
72
- uuid = uuid or "-"
73
- record_id = record_id or "-"
74
- relay = ""
75
- if data and data.control and data.control.relay_id:
76
- relay = data.control.relay_id
77
- relay = relay or "-"
78
- line = f"{prefix} {arrow} {ts} {record_id:16} {log_type:7} {resource:8} {tname:16} {msg_type:32} {uuid:32} {relay:32}"
79
- if tracelog_mode == "stdout":
80
- stdout_write(f"{line}\n")
81
- elif tracelog_mode == "stderr":
82
- stderr_write(f"{line}\n")
83
- elif tracelog_mode == "logger":
84
- logger.info(line)
85
-
86
-
87
- def _record_msg_type(record: "pb.Record") -> str:
88
- msg_type = str(record.WhichOneof("record_type"))
89
- if msg_type == "request":
90
- request = record.request
91
- msg_type = str(request.WhichOneof("request_type"))
92
- return msg_type
93
-
94
-
95
- def _result_msg_type(result: "pb.Result") -> str:
96
- msg_type = str(result.WhichOneof("result_type"))
97
- if msg_type == "response":
98
- response = result.response
99
- msg_type = str(response.WhichOneof("response_type"))
100
- return msg_type
101
-
102
-
103
- def _log_message(
104
- msg: "MessageType", log_type: str, resource: Optional[str] = None
105
- ) -> None:
106
- record: Optional[pb.Record] = None
107
- result: Optional[pb.Result] = None
108
- is_response = False
109
- msg_type: str
110
- # Note: using strings to avoid an import
111
- message_type_str = type(msg).__name__
112
- if message_type_str == "Record":
113
- record = cast("pb.Record", msg)
114
- msg_type = _record_msg_type(record)
115
- elif message_type_str == "Result":
116
- is_response = True
117
- result = cast("pb.Result", msg)
118
- msg_type = _result_msg_type(result)
119
- elif message_type_str == "ServerRequest":
120
- server_request = cast("spb.ServerRequest", msg)
121
- msg_type = str(server_request.WhichOneof("server_request_type"))
122
- if msg_type == "record_publish":
123
- record = server_request.record_publish
124
- sub_msg_type = _record_msg_type(record)
125
- msg_type = f"pub-{sub_msg_type}"
126
- elif msg_type == "record_communicate":
127
- record = server_request.record_communicate
128
- sub_msg_type = _record_msg_type(record)
129
- msg_type = f"comm-{sub_msg_type}"
130
- # print("SRV", server_request)
131
- elif message_type_str == "ServerResponse":
132
- is_response = True
133
- server_response = cast("spb.ServerResponse", msg)
134
- msg_type = str(server_response.WhichOneof("server_response_type"))
135
- if msg_type == "result_communicate":
136
- result = server_response.result_communicate
137
- sub_msg_type = _result_msg_type(result)
138
- msg_type = f"comm-{sub_msg_type}"
139
- else:
140
- raise AssertionError(f"Unknown message type {message_type_str}")
141
- _log(
142
- msg_type,
143
- is_response=is_response,
144
- record=record,
145
- result=result,
146
- log_type=log_type,
147
- resource=resource,
148
- )
149
-
150
-
151
- def _log_message_queue(msg: "MessageQueueType", q: "QueueType") -> None:
152
- _annotate_message(msg)
153
- resource = getattr(q, ANNOTATE_QUEUE_NAME, None)
154
- _log_message(msg, "queue", resource=resource)
155
-
156
-
157
- def _log_message_dequeue(msg: "MessageQueueType", q: "QueueType") -> None:
158
- resource = getattr(q, ANNOTATE_QUEUE_NAME, None)
159
- _log_message(msg, "dequeue", resource=resource)
160
-
161
-
162
- def _log_message_send(msg: "MessageType", t: "TransportType") -> None:
163
- _log_message(msg, "send")
164
-
165
-
166
- def _log_message_recv(msg: "MessageType", t: "TransportType") -> None:
167
- _log_message(msg, "recv")
168
-
169
-
170
- def _log_message_process(msg: "MessageType") -> None:
171
- _log_message(msg, "process")
172
-
173
-
174
- def _log_message_link(src: "MessageType", dest: "MessageType") -> None:
175
- _log_message(src, "source")
176
- _log_message(dest, "dest")
177
-
178
-
179
- def _log_message_assert(msg: "MessageType") -> None:
180
- _log_message(msg, "assert")
181
-
182
-
183
- def _annotate_queue(q: "QueueType", name: str) -> None:
184
- setattr(q, ANNOTATE_QUEUE_NAME, name)
185
-
186
-
187
- def _annotate_message(msg: "MessageQueueType") -> None:
188
- record_id = secrets.token_hex(8)
189
- msg._info._tracelog_id = record_id
190
-
191
-
192
- #
193
- # Default functions when logging is disabled
194
- #
195
-
196
-
197
- def log_message_queue(msg: "MessageQueueType", q: "QueueType") -> None:
198
- return None
199
-
200
-
201
- def log_message_dequeue(msg: "MessageQueueType", q: "QueueType") -> None:
202
- return None
203
-
204
-
205
- def log_message_send(msg: "MessageType", t: "TransportType") -> None:
206
- return None
207
-
208
-
209
- def log_message_recv(msg: "MessageType", t: "TransportType") -> None:
210
- return None
211
-
212
-
213
- def log_message_process(msg: "MessageType") -> None:
214
- return None
215
-
216
-
217
- def log_message_link(src: "MessageType", dest: "MessageType") -> None:
218
- return None
219
-
220
-
221
- def log_message_assert(msg: "MessageType") -> None:
222
- return None
223
-
224
-
225
- def annotate_queue(q: "QueueType", name: str) -> None:
226
- return None
227
-
228
-
229
- def annotate_message(msg: "MessageQueueType") -> None:
230
- return None
231
-
232
-
233
- def enable(log_mode: Optional[str] = None) -> None:
234
- global tracelog_mode
235
- if log_mode:
236
- tracelog_mode = log_mode
237
-
238
- global log_message_queue
239
- global log_message_dequeue
240
- global log_message_send
241
- global log_message_recv
242
- global log_message_process
243
- global log_message_link
244
- global log_message_assert
245
- global annotate_queue
246
- global annotate_message
247
- log_message_queue = _log_message_queue
248
- log_message_dequeue = _log_message_dequeue
249
- log_message_send = _log_message_send
250
- log_message_recv = _log_message_recv
251
- log_message_process = _log_message_process
252
- log_message_link = _log_message_link
253
- log_message_assert = _log_message_assert
254
- annotate_queue = _annotate_queue
255
- annotate_message = _annotate_message