Skip to content

Fix multi-host profiling and resolve profiler tracer collisions - #455

Merged
copybara-service[bot] merged 1 commit into
AI-Hypercomputer:mainfrom
richaguptaa17:fix-multihost-profiling
Aug 12, 2026
Merged

Fix multi-host profiling and resolve profiler tracer collisions#455
copybara-service[bot] merged 1 commit into
AI-Hypercomputer:mainfrom
richaguptaa17:fix-multihost-profiling

Conversation

@richaguptaa17

Copy link
Copy Markdown
Contributor
  • Enable ML Diagnostics profiler on secondary TPU worker processes by removing the jax.process_index() == 0 lock from _ml_diagnostics_profiler_enabled().
  • Refactor Profiler class in max_utils.py with active state tracking (_active). When both enable_ml_diagnostics and enable_profiler are True, prioritize ML Diagnostics and skip the standalone JAX profiler with a log warning to avoid RuntimeError tracer collisions.

- Enable ML Diagnostics profiler on secondary TPU worker processes by removing the jax.process_index() == 0 lock from _ml_diagnostics_profiler_enabled().
- Refactor Profiler class in max_utils.py with active state tracking (_active). When both enable_ml_diagnostics and enable_profiler are True, prioritize ML Diagnostics and skip the standalone JAX profiler with a log warning to avoid RuntimeError tracer collisions.
@richaguptaa17
richaguptaa17 requested a review from entrpn as a code owner July 31, 2026 11:33
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@mbohlool
mbohlool removed the request for review from entrpn August 6, 2026 10:06
trace_dir = self.config.tensorboard_dir
if trace_dir.startswith("gs://"):
local_dir = os.path.join("/tmp/profiler_traces", self.config.run_name)
if os.path.exists(local_dir):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In a multi-host setup, won't non-master hosts upload their trace files to the same GCS prefix and overwrite each other?

@richaguptaa17
richaguptaa17 requested a review from entrpn August 12, 2026 14:58
@mbohlool mbohlool assigned mbohlool and unassigned mbohlool Aug 12, 2026
@richaguptaa17
richaguptaa17 requested a review from mbohlool August 12, 2026 16:53
@copybara-service
copybara-service Bot merged commit a327ebd into AI-Hypercomputer:main Aug 12, 2026
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants