Skip to content

Commit 501d641

Browse files
authored
Arm backend: Fix bug causing empty partition reports (pytorch#19842)
logger.level was used to determine whether to add the partition_report.txt FileHandler to the logger. This value is not est by logging.setBasicConfig, and defaults to 0. This caused empty reports to be output when intermediate path was set and logging was > info Instead, use .getEffectiveLevel() cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani Signed-off-by: Erik Lundell <erik.lundell@arm.com>
1 parent c72bc87 commit 501d641

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backends/arm/tosa/partitioner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,10 @@ def partition(self, exported_program: ExportedProgram) -> PartitionResult:
550550
partition_tags = {tag: self.delegation_spec for tag in tags}
551551

552552
tag_constant_data(exported_program)
553-
if self.intermediate_path is not None and logger.level <= logging.INFO:
553+
if (
554+
self.intermediate_path is not None
555+
and logger.getEffectiveLevel() <= logging.INFO
556+
):
554557
intermediate_path = Path(self.intermediate_path)
555558
intermediate_path.mkdir(parents=True, exist_ok=True)
556559
file_handler = logging.FileHandler(

0 commit comments

Comments
 (0)