Skip to content

Commit

Permalink
fix qat_start bug in SparseML wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
bfineran authored and KSGulin committed Apr 14, 2022
1 parent 8255139 commit 4c24632
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def qat_active(self, epoch):
if not self.enabled or not self.manager.quantization_modifiers:
return False

qat_start = max([mod.start_epoch for mod in self.manager.quantization_modifiers])
qat_start = min([mod.start_epoch for mod in self.manager.quantization_modifiers])

return qat_start < epoch + 1

Expand All @@ -136,4 +136,4 @@ def reset_best(self, epoch):
qat_start = math.floor(max([mod.start_epoch for mod in self.manager.quantization_modifiers])) \
if self.manager.quantization_modifiers else -1

return (pruning_start <= epoch <= pruning_end) or epoch == qat_start
return (pruning_start <= epoch <= pruning_end) or epoch == qat_start

0 comments on commit 4c24632

Please sign in to comment.