HPVM Profiler API

profile_config_file(binary_path, config_path, output_config_path, progress_bar=True, profile_filename='profile_info.txt', qos_filename='final_accuracy')[source]

Profile an HPVM configuration file with an HPVM binary, and write the updated configuration file to a given location. The configuration file must have the baseline as the first configuration.

  • binary_path (Union[pathlib.Path, str]) – Path to binary to be executed in profiling.

  • config_path (Union[pathlib.Path, str]) – Path to config file (HPVM configuration format) with configs to enumerate for profiling.

  • output_config_path (Union[pathlib.Path, str]) – Path where the output configs are written. The output config file has the same configs as the input config_path file, but the performance and energy readings are updated.

  • progress_bar (bool) – If True, show a progress bar for number of configs already profiled.

  • profile_filename (str) – Name of profile file generated by the binary (in current directory). This defaults to “profile_info.txt” and should not be changed for HPVM binaries.

  • qos_filename (str) – Name of QoS file generated by the binary (in current directory). It contains a single float number as the QoS of this run. This defaults to “final_accuracy” and should not be changed for HPVM binaries.

Return type


plot_hpvm_configs(config_path, save_to=None, show_qos_loss=True, **fig_kwargs)[source]

Plot the QoS-speedup information in an HPVM configuration file. It is recommended to profile the config file first (using profile_configs) to obtain real speedup numbers. This function creates a matplotlib.pyplot.Figure, plots on it, and returns it.

  • config_path (Union[pathlib.Path, str]) – Path to the config file (HPVM configuration format).

  • save_to (Optional[Union[pathlib.Path, str]]) – File to save figure into. Default is None: don’t save figure (just return it).

  • show_qos_loss (bool) – Show the loss of QoS on x axis of the figure. Defaults to True. If False, will use (absolute) QoS instead of QoS loss.

  • fig_kwargs – Arguments to pass to plt.subplots.

Return type