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

Documentation, cleanup, renaming

parent 8b2c96c4
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,9 @@ import torch
from .approxapp import ApproxKnob, KnobsT
from .modeledapp import (
IPerfModel,
ICostModel,
IQoSModel,
LinearPerfModel,
LinearCostModel,
ModeledApp,
QoSModelP1,
QoSModelP2,
......@@ -29,7 +29,7 @@ class PipedBinaryApp(ModeledApp):
metadata_path: PathLike,
base_dir: PathLike = None,
qos_relpath: PathLike = "final_accuracy",
tuning_device: str = None,
target_device: str = None,
model_storage_folder: Optional[PathLike] = None,
):
self.app_name = app_name
......@@ -54,7 +54,7 @@ class PipedBinaryApp(ModeledApp):
if not self.binary_path.is_file():
raise RuntimeError(f"Binary file {self.binary_path} not found")
super().__init__(op_knobs, tuning_device) # Init here
super().__init__(op_knobs, target_device) # Init here
self.knob_exporter = HPVMConfigBuilder(list(op_knobs.keys()))
self.process = None
self._invoke_binary()
......@@ -99,11 +99,11 @@ class PipedBinaryApp(ModeledApp):
time_end = time()
return qos, time_end - time_begin
def get_models(self) -> List[Union["IPerfModel", "IQoSModel"]]:
def get_models(self) -> List[Union["ICostModel", "IQoSModel"]]:
p1_storage = self.model_storage / "p1.pkl" if self.model_storage else None
p2_storage = self.model_storage / "p2.json" if self.model_storage else None
return [
LinearPerfModel(self, self.op_costs, self.knob_speedup),
LinearCostModel(self, self.op_costs, self.knob_speedup),
QoSModelP1(
self,
lambda conf: self._run_on_knobs(conf, False)[0],
......
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