ggml
ggml copied to clipboard
add t5 layer norm support
The t5 layer norm does not subtract the mean during calculation, so I made a simple modification to ggml_norm to adapt it. This is a straightforward change and has already been validated in the sd.cpp project (since sd3 uses t5). However, due to limitations in my development environment, I have not been able to validate all the modifications. So far, I have only tested the changes for CUDA and CPU. Additionally, I am not very familiar with some environments, such as Kompute, so I have not developed corresponding support. I hope developers familiar with these environments can help improve it.
Ref: https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py#L230