nvalchemi.hooks.DynamicsContext#

class nvalchemi.hooks.DynamicsContext(*, batch, model=None, global_rank=0, workflow=None, step_count=0, converged_mask=None, active_graph_mask=None, graduated_mask=None)[source]#

Context object passed to dynamics hooks.

Parameters:
step_count#

Current dynamics step number.

Type:

int

converged_mask#

Boolean mask of samples that converged at the current hook stage. None when convergence has not fired for this dispatch.

Type:

Bool[torch.Tensor, “B”] | None

active_graph_mask#

Boolean mask of shape (batch.num_graphs,) selecting graphs active in the current dynamics dispatch. None when the dispatch has no status-based filtering (typically standalone BaseDynamics). In a FusedStage substage, it selects graphs whose status matches that substage.

Type:

Bool[torch.Tensor, “B”] | None

graduated_mask#

Boolean mask of shape (batch.num_graphs,) selecting the graphs that graduated during the current step, meaning their status reached the engine’s exit_status. Set only for ON_GRADUATE dispatches, where it may be all False; None at every other stage.

Type:

Bool[torch.Tensor, “B”] | None