Skip to main content

trace-util

Upload your PyTorch profiler traces to a Hugging Face bucket and get back ready-to-open Perfetto UI links — printed straight to your terminal.

## Perfetto URLs ##
  0 aritra/aritra.json
    https://ui.perfetto.dev/#!/?url=https://huggingface.co/.../resolve/aritra/aritra.json
  1 something/something.json
    https://ui.perfetto.dev/#!/?url=https://huggingface.co/.../resolve/something/something.json

Install

# one-off run, no install (recommended)
uvx trace-util -b my-bucket -f ./traces

# or install into your environment
pip install trace-util
uv pip install trace-util

Usage

1. From the command line (recommended)

After running a PyTorch profiler and dumping the traces into a folder:

uvx trace-util -b my-bucket -f ./traces
Flag Description
-b, --bucket-name Name of the Hugging Face bucket to sync to (created if missing). Required.
-f, --folder-path Local folder containing the traces. Required.
--token Hugging Face token. Defaults to a cached / interactive login.
--no-delete Keep files already in the bucket that are not present locally (do not mirror).
--no-color Disable colored output (the NO_COLOR env var is also honored).

You can also run it as a module: python -m trace_util -b my-bucket -f ./traces.

2. Programmatically

The upload logic lives in trace_util.core.upload_traces, which returns the data instead of printing it — drop it into your own profiling scripts:

from trace_util import upload_traces

links = upload_traces(
    bucket_name="my-bucket",
    folder_path="./traces",
    delete=True,        # mirror the folder exactly
    do_login=False,     # skip login if HF_TOKEN is already set in the env
)

for link in links:
    print(link.path, "->", link.perfetto_url)

upload_traces returns a list of TraceLink(path, perfetto_url) named tuples. If you only want the URL formatting, use trace_util.format_perfetto_url.

How it works

  1. Authenticate with the Hugging Face Hub.
  2. Create the bucket (exist_ok=True, so re-runs are fine).
  3. sync_bucket your local folder into the bucket.
  4. List the bucket tree and turn every file into a Perfetto ?url= link.

Note: Perfetto fetches the trace from the URL in your browser, so the bucket files need to be reachable by Perfetto. The links print as plain text so they stay copy/curl-able on any terminal.

Development

This project uses uv.

uv sync                 # create the environment
uv run trace-util --help
uv build                # build the sdist + wheel into dist/

License

Apache-2.0

Metadata

Release files for trace-util 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trace-util 0.2.0
File Size Uploaded
trace_util-0.2.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trace-util 0.2.0
File Interpreter ABI Platform
trace_util-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / trace_util-0.2.0.tar.gz

Download URL trace_util-0.2.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1a843e30a66205cf96c245f0711edfdb3108e742acdb4682d31dbb494f9b64b0
BLAKE2b-256 checksum
How to use checksums
25dd096f262f17384a2f7d13d3d2415443dcd52b3038a3234e131479080f3e29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 23, 2026.

Transparency log

Release files / trace_util-0.2.0-py3-none-any.whl

Download URL trace_util-0.2.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31336343132f98ee73d874c12523a15f7a552a736a81f7b33153afab407cbcc0
BLAKE2b-256 checksum
How to use checksums
afabfa467cdaf69b2ae46615613672a3e87b8da33af0d250070a65d4476973e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page