nip.timing.run.GraphIsomorphismSoloAgentRunTimeable#

class nip.timing.run.GraphIsomorphismSoloAgentRunTimeable(*, param_scale: float = 1.0, wait: int = 2, warmup: int = 1, active: int = 3, repeat: int = 2, force_cpu: bool = False, pretrain: bool = False)[source]#

Timeable for running the graph isomorphism scenario with solo agents.

Methods Summary

__init__(*[, param_scale, wait, warmup, ...])

_get_params()

Get the parameters which define the experiment.

_get_profiler_args(log_dir, record_shapes, ...)

Get the arguments for the PyTorch profiler.

run(profiler)

Run the experiment.

time([log_dir, record_shapes, ...])

Time the action.

Attributes

dataset

scenario

trainer

agent_name

Methods

__init__(*, param_scale: float = 1.0, wait: int = 2, warmup: int = 1, active: int = 3, repeat: int = 2, force_cpu: bool = False, pretrain: bool = False)[source]#
_get_params() HyperParameters[source]#

Get the parameters which define the experiment.

Returns:

hyper_params (HyperParameters) – The parameters of the experiment.

_get_profiler_args(log_dir: str | None, record_shapes: bool, profile_memory: bool, with_stack: bool) dict[source]#

Get the arguments for the PyTorch profiler.

Parameters:
  • log_dir (str, optional) – The directory to save the profiling results to, if any.

  • record_shapes (bool) – Whether to record tensor shapes. This introduces an additional overhead.

  • profile_memory (bool) – Whether to profile memory usage.

  • with_stack (bool) – Whether to record the stack trace. This introduces an additional overhead.

Returns:

profiler_args (dict) – The arguments for the PyTorch profiler.

run(profiler: profile)[source]#

Run the experiment.

Parameters:

profiler (torch.profiler.profile) – The profiler to use.

time(log_dir: str | None = None, record_shapes: bool = True, profile_memory: bool = True, with_stack: bool = False) profile[source]#

Time the action.

Parameters:
  • log_dir (str, optional) – The directory to save the profiling results to, if any.

  • record_shapes (bool) – Whether to record tensor shapes. This introduces an additional overhead.

  • profile_memory (bool) – Whether to profile memory usage.

  • with_stack (bool) – Whether to record the stack trace. This introduces an additional overhead.

Returns:

profiler (torch.profiler.profile) – The PyTorch profiler containing the timing information.