lens.state
Module-level span group state — importable anywhere without circular deps.
Holds a frozenset of enabled span groups so that any module can call
:func:is_span_group_enabled without importing the full nemo.lens package.
Span groups are registered once via :func:set_enabled_span_groups (called
from :func:~nemo.lens.handle.setup_telemetry). Before that call every
:func:is_span_group_enabled query returns False.
Module Contents
Functions
Data
API
Return the current PP trace carrier, or None.
Return True if the named span group is currently enabled.
This is the primary check at every instrumentation site (~2ns overhead).
Returns False before :func:set_enabled_span_groups is called.
Register the active span groups.
Called once from :func:~nemo.lens.handle.setup_telemetry.
Subsequent calls override the previous value (useful for testing).
Store the pipeline-parallel trace carrier for cross-stage linking.
Called from the training loop after :func:broadcast_trace_context.