We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b6bd39 commit 9e00eecCopy full SHA for 9e00eec
1 file changed
modelopt/onnx/quantization/autotune/common.py
@@ -531,12 +531,19 @@ def add_pattern_schemes(self, pattern_schemes: PatternSchemes) -> None:
531
else:
532
# Existing scheme is better, skip new one
533
too_similar = True
534
+ if scheme.latency_ms < existing_scheme.latency_ms:
535
+ # New scheme is better, mark existing for replacement
536
+ schemes_to_replace.append(existing_scheme)
537
break
538
539
if existing_to_remove is not None:
540
filtered_schemes.remove(existing_to_remove)
541
if not too_similar:
542
filtered_schemes.append(scheme)
543
+ elif schemes_to_replace:
544
+ for scheme_to_replace in schemes_to_replace:
545
+ filtered_schemes.remove(scheme_to_replace)
546
+ filtered_schemes.append(scheme)
547
548
sorted_schemes = filtered_schemes
549
0 commit comments