tensorboard-plugin-profile 2.22.2__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.
@@ -0,0 +1,22 @@
1
+ # Copyright 2025 The XProf Authors. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the 'License');
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an 'AS IS' BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Passthrough __init__.py pointing to xprof."""
16
+
17
+ from xprof import convert
18
+ from xprof import profile_plugin
19
+ from xprof import profile_plugin_loader
20
+ from xprof import protobuf
21
+ from xprof import server
22
+ from xprof import version
@@ -0,0 +1,346 @@
1
+ Metadata-Version: 2.4
2
+ Name: tensorboard_plugin_profile
3
+ Version: 2.22.2
4
+ Summary: XProf Profiler Plugin
5
+ Home-page: https://github.com/openxla/xprof
6
+ Author: Google Inc.
7
+ Author-email: packages@tensorflow.org
8
+ License: Apache 2.0
9
+ Keywords: jax pytorch xla tensorflow tensorboard xprof profile plugin
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Education
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Requires-Python: >= 3.10
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: xprof==2.22.2
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: keywords
28
+ Dynamic: license
29
+ Dynamic: requires-dist
30
+ Dynamic: requires-python
31
+ Dynamic: summary
32
+
33
+ # XProf (+ Tensorboard Profiler Plugin)
34
+
35
+ XProf offers a number of tools to analyse and visualize the
36
+ performance of your model across multiple devices. Some of the tools include:
37
+
38
+ * **Overview**: A high-level overview of the performance of your model. This
39
+ is an aggregated overview for your host and all devices. It includes:
40
+ * Performance summary and breakdown of step times.
41
+ * A graph of individual step times.
42
+ * High level details of the run environment.
43
+ * **Trace Viewer**: Displays a timeline of the execution of your model that shows:
44
+ * The duration of each op.
45
+ * Which part of the system (host or device) executed an op.
46
+ * The communication between devices.
47
+ * **Memory Profile Viewer**: Monitors the memory usage of your model.
48
+ * **Graph Viewer**: A visualization of the graph structure of HLOs of your model.
49
+
50
+ To learn more about the various XProf tools, check out the [XProf documentation](https://openxla.org/xprof)
51
+
52
+ ## Demo
53
+ First time user? Come and check out this [Colab Demo](https://docs.jaxstack.ai/en/latest/JAX_for_LLM_pretraining.html).
54
+
55
+ ## Quick Start
56
+
57
+ ### Prerequisites
58
+
59
+ * xprof >= 2.20.0
60
+ * (optional) TensorBoard >= 2.20.0
61
+
62
+ Note: XProf requires access to the Internet to load the [Google Chart library](https://developers.google.com/chart/interactive/docs/basic_load_libs#basic-library-loading).
63
+ Some charts and tables may be missing if you run XProf entirely offline on
64
+ your local machine, behind a corporate firewall, or in a datacenter.
65
+
66
+ If you use Google Cloud to run your workloads, we recommend the
67
+ [xprofiler tool](https://github.com/AI-Hypercomputer/cloud-diagnostics-xprof).
68
+ It provides a streamlined profile collection and viewing experience using VMs
69
+ running XProf.
70
+
71
+ ### Installation
72
+
73
+ To get the most recent release version of XProf, install it via pip:
74
+
75
+ ```
76
+ $ pip install xprof
77
+ ```
78
+
79
+ or with TensorBoard:
80
+
81
+ ```
82
+ $ pip install xprof tensorboard
83
+ ```
84
+
85
+ *Note: For Python 3.12+ users, if you encounter `ModuleNotFoundError: No module
86
+ named 'pkg_resources'`, install an older version of setuptools:*
87
+
88
+ ```
89
+ pip install "setuptools<70"
90
+ ```
91
+
92
+ ## Running XProf
93
+
94
+ XProf can be launched as a standalone server or used as a plugin within
95
+ TensorBoard. For large-scale use, it can be deployed in a distributed mode with
96
+ separate aggregator and worker instances ([more details on it later in the
97
+ doc](#distributed-profiling)).
98
+
99
+ ### Command-Line Arguments
100
+
101
+ When launching XProf from the command line, you can use the following arguments:
102
+
103
+ * **`logdir`** (optional): The directory containing XProf profile data (files
104
+ ending in `.xplane.pb`). This can be provided as a positional argument or
105
+ with `-l` or `--logdir`. If provided, XProf will load and display profiles
106
+ from this directory. If omitted, XProf will start without loading any
107
+ profiles, and you can dynamically load profiles using `session_path` or
108
+ `run_path` URL parameters, as described in the [Log Directory
109
+ Structure](#log-directory-structure) section.
110
+ * **`-p <port>`**, **`--port <port>`**: The port for the XProf web server.
111
+ Defaults to `8791`.
112
+ * **`-gp <grpc_port>`**, **`--grpc_port <grpc_port>`**: The port for the gRPC
113
+ server used for distributed processing. Defaults to `50051`. This must be
114
+ different from `--port`.
115
+ * **`-wsa <addresses>`**, **`--worker_service_address <addresses>`**: A
116
+ comma-separated list of worker addresses (e.g., `host1:50051,host2:50051`)
117
+ for distributed processing. Defaults to to `0.0.0.0:<grpc_port>`.
118
+ * **`-hcpb`**, **`--hide_capture_profile_button`**: If set, hides the 'Capture
119
+ Profile' button in the UI.
120
+
121
+ ### Standalone
122
+
123
+ If you have profile data in a directory (e.g., `profiler/demo`), you can view it
124
+ by running:
125
+
126
+ ```
127
+ $ xprof profiler/demo --port=6006
128
+ ```
129
+
130
+ Or with the optional flag:
131
+
132
+ ```
133
+ $ xprof --logdir=profiler/demo --port=6006
134
+ ```
135
+
136
+ ### With TensorBoard
137
+
138
+ If you have TensorBoard installed, you can run:
139
+
140
+ ```
141
+ $ tensorboard --logdir=profiler/demo
142
+ ```
143
+
144
+ If you are behind a corporate firewall, you may need to include the `--bind_all`
145
+ tensorboard flag.
146
+
147
+ Go to `localhost:6006/#profile` of your browser, you should now see the demo
148
+ overview page show up.
149
+ Congratulations! You're now ready to capture a profile.
150
+
151
+ ### Log Directory Structure
152
+
153
+ When using XProf, profile data must be placed in a specific directory structure.
154
+ XProf expects `.xplane.pb` files to be in the following path:
155
+
156
+ ```
157
+ <log_dir>/plugins/profile/<session_name>/
158
+ ```
159
+
160
+ * `<log_dir>`: This is the root directory that you supply to `tensorboard
161
+ --logdir`.
162
+ * `plugins/profile/`: This is a required subdirectory.
163
+ * `<session_name>/`: Each subdirectory inside `plugins/profile/` represents a
164
+ single profiling session. The name of this directory will appear in the
165
+ TensorBoard UI dropdown to select the session.
166
+
167
+ **Example:**
168
+
169
+ If your log directory is structured like this:
170
+
171
+ ```
172
+ /path/to/your/log_dir/
173
+ └── plugins/
174
+ └── profile/
175
+ ├── my_experiment_run_1/
176
+ │ └── host0.xplane.pb
177
+ └── benchmark_20251107/
178
+ └── host1.xplane.pb
179
+ ```
180
+
181
+ You would launch TensorBoard with:
182
+
183
+ ```bash
184
+ tensorboard --logdir /path/to/your/log_dir/
185
+ ```
186
+
187
+ The runs `my_experiment_run_1` and `benchmark_20251107` will be available in the
188
+ "Sessions" tab of the UI.
189
+
190
+ You can also dynamically load sessions from a GCS bucket or local filesystem by
191
+ passing URL parameters when loading XProf in your browser. This method works
192
+ whether or not you provided a `logdir` at startup and is useful for viewing
193
+ profiles from various locations without restarting XProf.
194
+
195
+ For example, if you start XProf with no log directory:
196
+
197
+ ```bash
198
+ xprof
199
+ ```
200
+
201
+ You can load sessions using the following URL parameters.
202
+
203
+ Assume you have profile data stored on GCS or locally, structured like this:
204
+
205
+ ```
206
+ gs://your-bucket/profile_runs/
207
+ ├── my_experiment_run_1/
208
+ │ ├── host0.xplane.pb
209
+ │ └── host1.xplane.pb
210
+ └── benchmark_20251107/
211
+ └── host0.xplane.pb
212
+ ```
213
+
214
+ There are two URL parameters you can use:
215
+
216
+ * **`session_path`**: Use this to load a *single* session directly. The path
217
+ should point to a directory containing `.xplane.pb` files for one session.
218
+
219
+ * GCS Example:
220
+ `http://localhost:8791/?session_path=gs://your-bucket/profile_runs/my_experiment_run_1`
221
+ * Local Path Example:
222
+ `http://localhost:8791/?session_path=/path/to/profile_runs/my_experiment_run_1`
223
+ * Result: XProf will load the `my_experiment_run_1`
224
+ session, and you will see its data in the UI.
225
+
226
+ * **`run_path`**: Use this to point to a directory that contains *multiple*
227
+ session directories.
228
+
229
+ * GCS Example:
230
+ `http://localhost:8791/?run_path=gs://your-bucket/profile_runs/`
231
+ * Local Path Example:
232
+ `http://localhost:8791/?run_path=/path/to/profile_runs/`
233
+ * Result: XProf will list all session directories found under `run_path`
234
+ (i.e., `my_experiment_run_1` and `benchmark_20251107`) in the "Sessions"
235
+ dropdown in the UI, allowing you to switch between them.
236
+
237
+ **Loading Precedence**
238
+
239
+ If multiple sources are provided, XProf uses the following order of precedence
240
+ to determine which profiles to load:
241
+
242
+ 1. **`session_path`** URL parameter
243
+ 2. **`run_path`** URL parameter
244
+ 3. **`logdir`** command-line argument
245
+
246
+ ### Distributed Profiling
247
+
248
+ XProf supports distributed profile processing by using an aggregator that
249
+ distributes work to multiple XProf workers. This is useful for processing large
250
+ profiles or handling multiple users.
251
+
252
+ **Note**: Currently, distributed processing only benefits the following tools:
253
+ `overview_page`, `framework_op_stats`, `input_pipeline`, and `pod_viewer`.
254
+
255
+ **Note**: The ports used in these examples (`6006` for the aggregator HTTP
256
+ server, `9999` for the worker HTTP server, and `50051` for the worker gRPC
257
+ server) are suggestions and can be customized.
258
+
259
+ **Worker Node**
260
+
261
+ Each worker node should run XProf with a gRPC port exposed so it can receive
262
+ processing requests. You should also hide the capture button as workers are not
263
+ meant to be interacted with directly.
264
+
265
+ ```
266
+ $ xprof --grpc_port=50051 --port=9999 --hide_capture_profile_button
267
+ ```
268
+
269
+ **Aggregator Node**
270
+
271
+ The aggregator node runs XProf with the `--worker_service_address` flag pointing
272
+ to all available workers. Users will interact with aggregator node's UI.
273
+
274
+ ```
275
+ $ xprof --worker_service_address=<worker1_ip>:50051,<worker2_ip>:50051 --port=6006 --logdir=profiler/demo
276
+ ```
277
+
278
+ Replace `<worker1_ip>, <worker2_ip>` with the addresses of your worker machines.
279
+ Requests sent to the aggregator on port 6006 will be distributed among the
280
+ workers for processing.
281
+
282
+ For deploying a distributed XProf setup in a Kubernetes environment, see
283
+ [Kubernetes Deployment Guide](docs/kubernetes_deployment.md).
284
+
285
+ ## Nightlies
286
+
287
+ Every night, a nightly version of the package is released under the name of
288
+ `xprof-nightly`. This package contains the latest changes made by the XProf
289
+ developers.
290
+
291
+ To install the nightly version of profiler:
292
+
293
+ ```
294
+ $ pip uninstall xprof tensorboard-plugin-profile
295
+ $ pip install xprof-nightly
296
+ ```
297
+
298
+ ## Building from source
299
+
300
+ If the pip packages don't work for you, you can build XProf from source using
301
+ Bazel.
302
+
303
+ **1. Set up Bazel**
304
+
305
+ Bazel is the build system used for XProf. Bazelisk is a wrapper for Bazel that
306
+ simplifies Bazel version management. Download the appropriate `.deb` package for
307
+ your system from the
308
+ [Bazelisk releases page](https://github.com/bazelbuild/bazelisk/releases) and
309
+ install the downloaded package:
310
+
311
+ ```
312
+ sudo apt install ~/Downloads/bazelisk-amd64.deb
313
+ ```
314
+
315
+ **2. Obtain the Repository**
316
+
317
+ Clone the XProf GitHub repository to your local machine:
318
+
319
+ ```
320
+ git clone https://github.com/openxla/xprof.git
321
+ cd xprof
322
+ ```
323
+
324
+ **3. Build the Project**
325
+
326
+ Build the pip Package: Use Bazel to build the XProf pip package:
327
+
328
+ ```
329
+ bazel run --config=public_cache plugin:build_pip_package
330
+ ```
331
+
332
+ Navigate to the Bazel Output Directory and install:
333
+
334
+ ```
335
+ cd /tmp/profile-pip
336
+ pip install .
337
+ ```
338
+
339
+ ## Next Steps
340
+
341
+ * [JAX Profiling Guide](https://jax.readthedocs.io/en/latest/profiling.html#xprof-tensorboard-profiling)
342
+ * [PyTorch/XLA Profiling Guide](https://cloud.google.com/tpu/docs/pytorch-xla-performance-profiling-tpu-vm)
343
+ * [TensorFlow Profiling Guide](https://tensorflow.org/guide/profiler)
344
+ * [Cloud TPU Profiling Guide](https://cloud.google.com/tpu/docs/cloud-tpu-tools)
345
+ * [Colab Tutorial](https://www.tensorflow.org/tensorboard/tensorboard_profiling_keras)
346
+ * [Tensorflow Colab](https://www.tensorflow.org/tensorboard/tensorboard_profiling_keras)
@@ -0,0 +1,5 @@
1
+ tensorboard_plugin_profile/__init__.py,sha256=S02OWyVtjEtTuaAFJkR3t8Q9GQj0ECwn1ZTN81RET6c,911
2
+ tensorboard_plugin_profile-2.22.2.dist-info/METADATA,sha256=kKrfQQVVLobr5InbRk9khuwu_W4Z0VIQuU17N1YnclE,11964
3
+ tensorboard_plugin_profile-2.22.2.dist-info/WHEEL,sha256=QR8DNjG6Lr6bNErJWJgF4dP2dJ2N7NpY-BWly1OvcTM,97
4
+ tensorboard_plugin_profile-2.22.2.dist-info/top_level.txt,sha256=lhPzC2a84VfVAbBlTgLUSZwuuUl9uTj5R1zZMylY1g8,27
5
+ tensorboard_plugin_profile-2.22.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-win_amd64
5
+
@@ -0,0 +1 @@
1
+ tensorboard_plugin_profile