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

Save p1 and p2 models properly

parent 91c97a52
No related branches found
No related tags found
No related merge requests found
...@@ -101,15 +101,17 @@ class PipedBinaryApp(ModeledApp): ...@@ -101,15 +101,17 @@ class PipedBinaryApp(ModeledApp):
return qos, time_end - time_begin return qos, time_end - time_begin
def get_models(self) -> List[Union["IPerfModel", "IQoSModel"]]: def get_models(self) -> List[Union["IPerfModel", "IQoSModel"]]:
p2_path = self.model_storage / "p2.json" if self.model_storage else None 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 [ return [
LinearPerfModel(self, self.op_costs, self.knob_speedups), LinearPerfModel(self, self.op_costs, self.knob_speedups),
QoSModelP1( QoSModelP1(
self, self,
lambda conf: self._run_on_knobs(conf, False)[0], lambda conf: self._run_on_knobs(conf, False)[0],
self._compute_accuracy, self._compute_accuracy,
p1_storage
), ),
QoSModelP2(self, p2_path), QoSModelP2(self, p2_storage),
] ]
def _compute_accuracy(self, output_tensor: torch.Tensor) -> float: def _compute_accuracy(self, output_tensor: torch.Tensor) -> float:
......
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