diff --git a/hpvm/docs/conf.py b/hpvm/docs/conf.py index 0bea2f5e53065f02ae2bface0c70f030968b87f9..238128340d5c52a12343175f4d132f973862decf 100644 --- a/hpvm/docs/conf.py +++ b/hpvm/docs/conf.py @@ -4,10 +4,9 @@ from datetime import date # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -import os import sys - -sys.path.insert(0, os.path.abspath("..")) +from pathlib import Path +sys.path.insert(0, Path("../projects/hpvm-profiler").absolute().as_posix()) # General configuration # --------------------- @@ -17,16 +16,15 @@ sys.path.insert(0, os.path.abspath("..")) extensions = [ "sphinx.ext.autosummary", "sphinx.ext.autodoc", - "sphinx_autodoc_typehints", "sphinx.ext.coverage", "sphinx.ext.doctest", "sphinx.ext.intersphinx", "sphinx.ext.mathjax", "sphinx.ext.todo", "sphinx.ext.viewcode", - "numpydoc", ] -always_document_param_types = True + +autodoc_typehints = "description" # generate autosummary pages autosummary_generate = True diff --git a/hpvm/docs/requirements.txt b/hpvm/docs/requirements.txt index 44ae898e556b962b21a21eb074e6948ae2916b9c..d4dc1a6039b99571b2800077062ae9236d39c710 100644 --- a/hpvm/docs/requirements.txt +++ b/hpvm/docs/requirements.txt @@ -1,4 +1,3 @@ sphinx>=3.5 -sphinx-autodoc-typehints>=1.11 pydata-sphinx-theme==0.5.2 numpydoc>=1.1 \ No newline at end of file diff --git a/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py b/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py index baaf645cb9f5a1c0f7f71a9d9b01269206a9cf18..b421071aaf2ab95ea5a2680e5bb9dfd8cb5759c7 100644 --- a/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py +++ b/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py @@ -16,19 +16,20 @@ def profile_config_file( profile_filename: str = "profile_info.txt", qos_filename: str = "final_accuracy", ) -> None: - """ - Profile an HPVM configuration file with an HPVM binary. + r"""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: Path to binary to be executed in profiling. - config_path: Path to config file (HPVM configuration format) + :param binary_path: Path to binary to be executed in profiling. + :param config_path: Path to config file (HPVM configuration format) with configs to enumerate for profiling. - output_config_path: Path where the output configs are written. + :param output_config_path: 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. - profile_filename: Name of profile file generated by the binary (in current directory). + :param progress_bar: If `True`, show a progress bar for number of configs already profiled. + :param profile_filename: 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: Name of QoS file generated by the binary (in current directory). + :param qos_filename: 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. """ @@ -109,11 +110,11 @@ def plot_hpvm_configs( to obtain real speedup numbers. This function creates a `matplotlib.pyplot.Figure`, plots on it, and returns it. - config_path: Path to the config file (HPVM configuration format). - save_to: File to save figure into. Default is None: don't save figure (just return it). - show_qos_loss: Show the loss of QoS on x axis of the figure. Defaults to True. + :param config_path: Path to the config file (HPVM configuration format). + :param save_to: File to save figure into. Default is None: don't save figure (just return it). + :param show_qos_loss: 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`. + :param fig_kwargs: Arguments to pass to `plt.subplots`. """ import numpy as np