nvalchemi.hooks.ReportingOrchestrator#

class nvalchemi.hooks.ReportingOrchestrator(reporters, *, frequency=1, stages=None, rank_zero_only=False, error_policy=ReportingErrorPolicy.RAISE, state=None)[source]#

Fan out hook contexts to reporting sinks.

ReportingOrchestrator is itself a normal hook. It uses _runs_on_stage so it can be registered with both training and dynamics hook registries while still choosing the workflow stages it observes.

Parameters:
  • reporters (Sequence[Reporter]) – Reporters to call in order for each reporting event.

  • frequency (int, optional) – Run every frequency workflow steps, using the existing hook registry gating. Default 1.

  • stages (set[Enum | str] | None, optional) – Stages to report. Enum values are matched by identity; strings are matched against enum member names. Defaults to {"AFTER_OPTIMIZER_STEP", "AFTER_STEP"}, which gives once-per-step training and dynamics reporting without importing either workflow.

  • rank_zero_only (bool, optional) – If True, suppress child reporters on nonzero ranks unless they expose requires_all_ranks=True for distributed collectives. Individual reporters may also expose rank_zero_only=True to request their own gating. Default False.

  • error_policy (ReportingErrorPolicy | str, optional) – Reporter failure handling policy. Default ReportingErrorPolicy.RAISE (the string "raise" is also accepted).

  • state (ReportingState | None, optional) – Shared reporting state. If omitted, a new state object is created.

close()[source]#

Close reporters in reverse order.

Return type:

None

property global_rank: int#

Return the current distributed rank, or zero outside distributed runs.

property is_rank_zero: bool#

Return whether this process is rank zero.