Skip to content

[PJRT] Use TPU profiler plugin#5793

Merged
will-cromar merged 1 commit intomasterfrom
wcromar/tpu-profiler-plugin
Nov 14, 2023
Merged

[PJRT] Use TPU profiler plugin#5793
will-cromar merged 1 commit intomasterfrom
wcromar/tpu-profiler-plugin

Conversation

@will-cromar
Copy link
Copy Markdown
Collaborator

@will-cromar will-cromar commented Nov 13, 2023

The tpu_tracer backend uses a static initializer that requires us to set TPU_LIBRARY_PATH, which required us to roll back #5731. Instead, use the new PJRT C API profiler extension API to register the TPU profiler.

  • Add new API profiler::RegisterProfilerForPlugin that we can reuse for other plugins as needed. Mostly copied from JAX's pybind to do the same thing: https://github.com/openxla/xla/blob/34b419269fa7477155086730670e2aa740d80a0d/xla/python/profiler.cc#L90-L105
  • If we register both the profielr plugin and the default tpu_tracer starting a profiler sessions triggers a crash. Since the issue is (again) a static initializer, define our own profiler_backends target that excludes tpu_tracer from the build entirely.
    • Piggyback fix: include the GPU device tracer again after openxla/xla@d73a491. We can remove this after we move GPU support into a plugin.

Confirmed that TPU device traces still show up after this change.

image

cc @jyingl3

Copy link
Copy Markdown
Collaborator

@alanwaketan alanwaketan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@will-cromar will-cromar merged commit 3b34cb2 into master Nov 14, 2023
@will-cromar will-cromar deleted the wcromar/tpu-profiler-plugin branch November 14, 2023 17:56
mbzomowski pushed a commit to mbzomowski-test-org/xla that referenced this pull request Nov 16, 2023
zpcore pushed a commit that referenced this pull request Nov 21, 2023
lsy323 pushed a commit to lsy323/xla that referenced this pull request Nov 28, 2023
chunnienc pushed a commit to chunnienc/xla that referenced this pull request Dec 14, 2023
golechwierowicz pushed a commit that referenced this pull request Jan 12, 2024
bhavya01 pushed a commit that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants