aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/backend/corstone/performance.py
diff options
context:
space:
mode:
authorBenjamin Klimczak <benjamin.klimczak@arm.com>2024-03-21 17:33:17 +0000
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2024-03-22 10:06:28 +0000
commitc7ee5b783f044d7ff641773aa385840f5ff944cc (patch)
tree297f308978b00282d8ebd3a1f71e1ae5e678a767 /src/mlia/backend/corstone/performance.py
parent508281df31dc3c18f2e007f4dd505160342a681a (diff)
downloadmlia-c7ee5b783f044d7ff641773aa385840f5ff944cc.tar.gz
refactor: Backend dependencies and more
- Add backend dependencies: One backend can now depend on another backend. - Re-factor 'DownloadArtifact': - Rename 'DownloadArtifact' to 'DownloadConfig' - Remove attributes 'name' and 'version' not relevant for downloads - Add helper properties: - 'filename' parses the URL to extract the file name from the end - 'headers' calls the function to generate a HTML header for the download - Add OutputLogger helper class - Re-factor handling of backend configurations in the target profiles. Change-Id: Ifda6cf12c375d0c1747d7e4130a0370d22c3d33a Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Diffstat (limited to 'src/mlia/backend/corstone/performance.py')
-rw-r--r--src/mlia/backend/corstone/performance.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mlia/backend/corstone/performance.py b/src/mlia/backend/corstone/performance.py
index fc50109..fe4e271 100644
--- a/src/mlia/backend/corstone/performance.py
+++ b/src/mlia/backend/corstone/performance.py
@@ -15,6 +15,7 @@ from mlia.backend.errors import BackendExecutionFailed
from mlia.backend.repo import get_backend_repository
from mlia.utils.filesystem import get_mlia_resources
from mlia.utils.proc import Command
+from mlia.utils.proc import OutputLogger
from mlia.utils.proc import process_command_output
@@ -187,15 +188,12 @@ def get_metrics(
) from err
output_parser = GenericInferenceOutputParser()
-
- def redirect_to_log(line: str) -> None:
- """Redirect FVP output to the logger."""
- logger.debug(line.strip())
+ output_logger = OutputLogger(logger)
try:
process_command_output(
command,
- [output_parser, redirect_to_log],
+ [output_parser, output_logger],
)
except subprocess.CalledProcessError as err:
raise BackendExecutionFailed("Backend execution failed.") from err