ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[FEATURE]: Is it Possible to integrate Liger-Kernel?

Open airlsyn opened this issue 1 year ago • 8 comments

Describe the feature

https://github.com/linkedin/Liger-Kernel

Liger Kernel is a collection of Triton kernels designed specifically for LLM training. It can effectively increase multi-GPU training throughput by 20% and reduce memory usage by 60%. We have implemented Hugging Face Compatible RMSNorm, RoPE, SwiGLU, CrossEntropy, FusedLinearCrossEntropy, and more to come.

airlsyn avatar Sep 06 '24 05:09 airlsyn

Seems like a pretty light-weight library. cc @ver217 @isky-cd Any take on this? 😃

Edenzzzz avatar Sep 08 '24 09:09 Edenzzzz

Liger Kernel is a collection of Triton kernels designed specifically for LLM training. It can effectively increase multi-GPU training throughput by 20% and reduce memory usage by 60%. We have implemented Hugging Face Compatible RMSNorm, RoPE, SwiGLU, CrossEntropy, FusedLinearCrossEntropy, and more to come.

I think this is a good attempt.

isky-cd avatar Sep 09 '24 12:09 isky-cd

Does it compare with apex's implementation? We've integrate some apex cuda kernels and some of them are also implemented in Liger-kernel.

ver217 avatar Sep 10 '24 09:09 ver217

I think Apex only provides fused RMSNorm and LayerNorm kernels? They have some more image

Edenzzzz avatar Sep 14 '24 19:09 Edenzzzz

Any good news? Thanks a lot

airlsyn avatar Oct 09 '24 05:10 airlsyn

I think they are short-handed in wrapping up Zero Bubble, hybrid seq parallel and then they will focus on accelerate intergration? Feel free to ask other members to clarify further, but it'd be great if the community can make an initial PR on this, then we can help/comment. This is an open-source initiative after all, and we always welcome contributions🙂

Edenzzzz avatar Oct 09 '24 14:10 Edenzzzz

Is there any documentation available on how to integrate a new kernel? So we can make a PR on this. Thanks a lot.

airlsyn avatar Nov 17 '24 02:11 airlsyn

May I ask if you have a concept similar to Hugging Face's modeling_xxx for organizing modules? I have experience adding the liger-kernel there, and perhaps directly replacing the relevant modules could work.

huyiwen avatar Jan 04 '25 16:01 huyiwen