Skip to content

DnnProf

DnnProf

softneuro.core.DnnProf(dnn=None)

DnnProf class used for optimizing Dnn (see DnnOptimizer).

Attributes

  • affinity_masks: Affinity masks for profiling.
  • dnn: Target dnn to be profiled.
  • elapsed_sec: Elapsed seconds of the profiling.
  • estimate_mode: Estimation mode of profiling data.
  • is_canceled: Whether profiling is canceled or not.
  • is_preparing: Whether preparing or not.
  • progress: Progress of the profiling.
  • run_num: The number of routine profiler runs.
  • schemas: Schemas (routine groups) to be profiled.
  • thread_num: Number of threads for profiling.

add

DnnProf.add(i_routine, i_layer=None)

Adds a profiling routine to a layer.

Arguments

  • i_routine: The profiling routine.
  • i_layer: The layer to which the profiling routine is added. If NULL is given, the profiling routine is added to all layers in a main net.

cancel

DnnProf.cancel()

Cancels profiling.


load

DnnProf.load(*args)

Loads from a file.

Arguments

  • i_filename: Profiling file name.
  • i_dnn_filename: Dnn file name.
  • i_pass: The password of the dnn file, use NULL for the dnn file without password.

profile

DnnProf.profile()

Profiles with a callback function for progress.


progressed

DnnProf.progressed()

Default callback function for profiling progress.

Returns

Type : func,Default callback function for profiling progress.


remove

DnnProf.remove(i_routine=None, i_layer=None)

Removes a profiling routine from a layer.

Arguments

  • i_routine: The profiling routine. If NULL or an empty string () is given, all profiling routines are removed from the layer.
  • i_layer: The layer from which the profiling routine is removed. If NULL is given, the profiling routine is removed from all layers.

reset

DnnProf.reset(i_routine=None, i_layer=None)

Resets profiling data.

Arguments

  • i_routine: The profiling routine to be reset. If NULL or an empty string () is given, all profiling routines are reset.
  • i_layer: The layer to be reset. If NULL is given, the routines in all layers are reset.

save

DnnProf.save(*args)

Saves to a file.

Arguments

  • i_filename: Profiling file name.
  • i_is_ascii: Save as ascii form.

set_affinity_mask

DnnProf.set_affinity_mask(index, value)

Sets an affinity mask.

Arguments

  • index: Thread index for which affinity mask will be set.
  • value: An affinity mask represented in hex ("0x..") or binary ("0b..") form.