Skip to content

fix: accept **kwargs in Params4bit and Int8Params constructors#1900

Open
ajmeese7 wants to merge 1 commit intobitsandbytes-foundation:mainfrom
TargetPackage:fix/params4bit-hf-initialized-kwarg
Open

fix: accept **kwargs in Params4bit and Int8Params constructors#1900
ajmeese7 wants to merge 1 commit intobitsandbytes-foundation:mainfrom
TargetPackage:fix/params4bit-hf-initialized-kwarg

Conversation

@ajmeese7
Copy link

accelerate's set_module_tensor_to_device passes the old parameter's __dict__ as **kwargs when reconstituting quantized parameters. Transformers >= 5.x adds _is_hf_initialized to every parameter's __dict__, but Params4bit.__new__ and Int8Params.__new__ had fixed signatures, causing TypeError on any model loaded with BitsAndBytesConfig + device_map="auto".

Add **kwargs to both constructors so unexpected attributes are silently ignored instead of crashing.

accelerate's set_module_tensor_to_device passes the old parameter's
__dict__ as **kwargs when reconstituting quantized parameters.
Transformers >= 5.x adds _is_hf_initialized to every parameter's
__dict__, but Params4bit.__new__ and Int8Params.__new__ had fixed
signatures — causing TypeError on any model loaded with
BitsAndBytesConfig + device_map="auto".

Add **kwargs to both constructors so unexpected attributes are silently
ignored instead of crashing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant