Skip to content
Snippets Groups Projects
Commit 647667d7 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Fixed docstring and autotyping

parent ecfb4a93
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
sphinx>=3.5
sphinx-autodoc-typehints>=1.11
pydata-sphinx-theme==0.5.2
numpydoc>=1.1
\ No newline at end of file
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment