From 8de651cb92ec29cdb804095d59f10f75df59ffce Mon Sep 17 00:00:00 2001 From: Yu Chin Fabian Lim Date: Thu, 20 Jun 2024 04:18:19 +0000 Subject: [PATCH] add one more check in get_framework Signed-off-by: Yu Chin Fabian Lim --- .../acceleration_framework_config.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tuning/config/acceleration_configs/acceleration_framework_config.py b/tuning/config/acceleration_configs/acceleration_framework_config.py index 64575276b..91547c3f6 100644 --- a/tuning/config/acceleration_configs/acceleration_framework_config.py +++ b/tuning/config/acceleration_configs/acceleration_framework_config.py @@ -176,13 +176,14 @@ def get_framework(self): self.to_yaml(f.name) return AccelerationFramework(f.name) else: - raise ValueError( - "No acceleration framework package found. To use, first " - "ensure that 'pip install -e.[fms-accel]' is done first to " - "obtain the acceleration framework dependency. Additional " - "acceleration plugins make be required depending on the requsted " - "acceleration. See README.md for instructions." - ) + if len(self.to_dict()) > 0: + raise ValueError( + "No acceleration framework package found. To use, first " + "ensure that 'pip install -e.[fms-accel]' is done first to " + "obtain the acceleration framework dependency. Additional " + "acceleration plugins make be required depending on the requsted " + "acceleration. See README.md for instructions." + ) def to_dict(self): """convert a valid AccelerationFrameworkConfig dataclass into a schema-less dictionary