From 3f1a85471d22f58052fa2cd2ad23567afc4ff030 Mon Sep 17 00:00:00 2001 From: rohithkrn Date: Wed, 27 Mar 2024 15:24:24 -0700 Subject: [PATCH] [lmi-dist]validate usage lora and speculative together (#1684) --- .../properties_manager/lmi_dist_rb_properties.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engines/python/setup/djl_python/properties_manager/lmi_dist_rb_properties.py b/engines/python/setup/djl_python/properties_manager/lmi_dist_rb_properties.py index c4ff157ae..a04bc54e0 100644 --- a/engines/python/setup/djl_python/properties_manager/lmi_dist_rb_properties.py +++ b/engines/python/setup/djl_python/properties_manager/lmi_dist_rb_properties.py @@ -56,3 +56,11 @@ def validate_engine(cls, engine): raise AssertionError( f"Need MPI engine to start lmi-dist RollingBatcher") return engine + + @root_validator(skip_on_failure=True) + def validate_speculative_and_lora(cls, properties): + if properties["enable_lora"] and properties["speculative_draft_model"]: + raise AssertionError( + f"Cannot enable lora and speculative decoding at the same time" + ) + return properties