[Bugfix] Fix layer skip logic with bitsandbytes (#9887)
Signed-off-by: mgoin <michael@neuralmagic.com>
This commit is contained in:
parent
96e0c9cbbd
commit
37a4947dcd
@ -119,7 +119,12 @@ class BitsAndBytesConfig(QuantizationConfig):
|
|||||||
|
|
||||||
|
|
||||||
def is_layer_skipped_bnb(prefix: str, llm_int8_skip_modules: List[str]):
|
def is_layer_skipped_bnb(prefix: str, llm_int8_skip_modules: List[str]):
|
||||||
return any(module_name in prefix for module_name in llm_int8_skip_modules)
|
# Split the prefix into its dot-separated components
|
||||||
|
components = prefix.split('.')
|
||||||
|
|
||||||
|
# Check if any of the skip modules exactly matches any component
|
||||||
|
return any(module_name in components
|
||||||
|
for module_name in llm_int8_skip_modules)
|
||||||
|
|
||||||
|
|
||||||
class BitsAndBytesLinearMethod(LinearMethodBase):
|
class BitsAndBytesLinearMethod(LinearMethodBase):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user