BitNet adjustments#338
Conversation
Yes I noticed that, I just didn't want to change until I tested if it worked first.
Interesting. There is a discussion on the huggingface that the model is larger than it has to be. Can we have change this to have smaller model size or is the performance benefit worth it (if it can't be duplicated on runtime for CUDA)? I also noticed when converting the two tensors ended up with different quants. |
These are the built-in defaults. If one wants to have something else one needs to use
The two tensors are stored in the model. If we wanted to avoid the duplication, we need to add logic that checks if |
Two small tweaks to #337:
create_tensorinstead ofml.create_tensor. This is necessary for tensor overrides to work (in case one would ever want to use tensor overrides with a BitNet model)output.weightinstead oftoken_embd.weightfor the final matrix multiplication. This improves CUDA performance quite a bit astoken_embd.weightis on the host, so needs to be copied to the GPU each time it is needed (or the matrix multiplication is done on the CPU when running TG). I see that MicroSoft have decided to haveoutput.weightstored in the model, even though it is identical totoken_embd.weight(in the initial BitNet models one simply reusedtoken_embd.weight). This makes the model quite a bit larger than it needs to be. Go figure.