Skip to content

Support multiple config loaders coexisting#1281

Open
sanrise wants to merge 2 commits intopytorch:mainfrom
sanrise:export-D91278953
Open

Support multiple config loaders coexisting#1281
sanrise wants to merge 2 commits intopytorch:mainfrom
sanrise:export-D91278953

Conversation

@sanrise
Copy link
Contributor

@sanrise sanrise commented Mar 3, 2026

Summary:
The previous single-slot design (setDaemonConfigLoaderFactory) only allowed one config loader at a time, making DaemonConfigLoader and PortConfigLoader mutually exclusive. This change enables both to coexist, which is necessary for hybrid environments where Kubernetes pods may use TCP-based tracing (PortConfigLoader) alongside Dynolog's IPC-based communication (DaemonConfigLoader).

The ConfigLoader now maintains a vector of loaders and iterates through them, returning the first non-empty config. Test-only reset APIs are added (guarded by KINETO_ENABLE_TEST_RESET_APIS) to enable isolated unit testing of the singleton.

Differential Revision: D91278953

sanrise added 2 commits March 2, 2026 18:17
Summary:

This implements Phase 1.1 of the lightweight on-demand GPU tracing system for Kubernetes environments. It provides an alternative to DaemonConfigLoader that receives trace configs via a TCP port instead of IPC Fabric, enabling GPU tracing in K8s pods without requiring a full Dynolog daemon.

The PortConfigLoader implements the IDaemonConfigLoader interface with a simple JSON protocol (PING/TRACE commands) and includes a socket abstraction layer (ISocket) for testability. Unit tests use MockSocket to enable deterministic testing without binding to real ports.

Differential Revision: D91278956
Summary:
The previous single-slot design (`setDaemonConfigLoaderFactory`) only allowed one config loader at a time, making DaemonConfigLoader and PortConfigLoader mutually exclusive. This change enables both to coexist, which is necessary for hybrid environments where Kubernetes pods may use TCP-based tracing (PortConfigLoader) alongside Dynolog's IPC-based communication (DaemonConfigLoader).

The ConfigLoader now maintains a vector of loaders and iterates through them, returning the first non-empty config. Test-only reset APIs are added (guarded by `KINETO_ENABLE_TEST_RESET_APIS`) to enable isolated unit testing of the singleton.

Differential Revision: D91278953
@meta-cla meta-cla bot added the cla signed label Mar 3, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 3, 2026

@sanrise has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91278953.

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.

1 participant