Skip to content

Add local_rank configuration support to ExporterOptions to allow worker rank identification in distributed multi-host/multi-rank environments. - #770

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_969642718
Open

Add local_rank configuration support to ExporterOptions to allow worker rank identification in distributed multi-host/multi-rank environments.#770
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_969642718

Conversation

@copybara-service

Copy link
Copy Markdown

Add local_rank configuration support to ExporterOptions to allow worker rank identification in distributed multi-host/multi-rank environments.

Key improvements:

  • Add local_rank field (std::optional<std::string>) to ExporterOptions in metrics_backend.h.
  • Update InitializeFromEnvironment and InitializeFromBackendNames in metrics_api to accept ExporterOptions and resolve local_rank (falling back to the LOCAL_RANK environment variable when unset or empty).
  • Extend Python binding configure_telemetry in telemetry_binding.cc with optional local_rank parameter (supporting strings and integers).
  • Add unit tests in C++ (metrics_api_test.cc) and Python (telemetry_binding_test.py) covering explicit rank passing, LOCAL_RANK environment fallback, empty rank strings, and invalid type handling.

…worker rank identification in distributed multi-host/multi-rank environments.

Key improvements:
- Add `local_rank` field (`std::optional<std::string>`) to `ExporterOptions` in `metrics_backend.h`.
- Update `InitializeFromEnvironment` and `InitializeFromBackendNames` in `metrics_api` to accept `ExporterOptions` and resolve `local_rank` (falling back to the `LOCAL_RANK` environment variable when unset or empty).
- Extend Python binding `configure_telemetry` in `telemetry_binding.cc` with optional `local_rank` parameter (supporting strings and integers).
- Add unit tests in C++ (`metrics_api_test.cc`) and Python (`telemetry_binding_test.py`) covering explicit rank passing, `LOCAL_RANK` environment fallback, empty rank strings, and invalid type handling.

PiperOrigin-RevId: 969642718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant