Port of bitnet1.58 with custom metal kernel#331
Conversation
|
Amazing job with the swift port @johnmai-dev! 🔥🚀 The quantization here is done normally like any other model. So you can consider it done ✅ |
Thank you! ❤️ |
# Conflicts: # Libraries/MLXLLM/LLMModelFactory.swift
|
Hello,@Blaizzy What is the difference between I see that "quantization": {
"group_size": 64,
"bits": 4,
"quant_method": "bitnet",
"linear_class": "autobitlinear",
"quantization_mode": "offline"
},
"quantization_config": {
"group_size": 64,
"bits": 4,
"quant_method": "bitnet",
"linear_class": "autobitlinear",
"quantization_mode": "offline"
},Looking forward to your reply, thanks ❤️ |
Currently, mlx-swift-examples/Libraries/MLXLMCommon/BaseConfiguration.swift Lines 13 to 28 in e9dfa74 I am considering whether to adjust Failed: configurationDecodingError("config.json", "mlx-community/bitnet-b1.58-2B-4T-4bit", Swift.DecodingError.typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "quantization", intValue: nil), _DictionaryCodingKey(stringValue: "quant_method", intValue: nil)], debugDescription: "Expected to decode Dictionary<String, Any> but found a string instead.", underlyingError: nil))) |
|
Cut a tag on mlx-swift for the relu squared: 0.25.5 |
I can say a little about that. MLX originally added the For non MLX models they will probably just use the |
Thank you for your answer! |
|
Thank you very much!!! @angeloskath
|
|
I think it's ready to merge. |
davidkoski
left a comment
There was a problem hiding this comment.
This looks great! I like the use of the custom kernel -- this will make a good example.


This PR ports bitnet1.58 contributed by @Blaizzy . Thanks to my idol @Blaizzy !
Source: ml-explore/mlx-lm#219