Buckets:
| import{s as ae,n as se,o as me}from"../chunks/scheduler.7b731bd4.js";import{S as pe,i as ce,e as o,s as r,c as k,h as fe,a,d as n,b as l,f as q,g as x,j as _,k as W,l as w,m as i,n as S,t as H,o as E,p as U}from"../chunks/index.cc268345.js";import{C as de,H as ue,E as he}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.05c55b8e.js";import{C as oe}from"../chunks/CodeBlock.058914b6.js";function ge(X){let s,P,C,F,c,K,f,A,m,Y="<p>Section under construction. Feel free to contribute!</p>",G,d,ee='<a href="https://github.com/linkedin/Liger-Kernel" rel="nofollow">Liger Kernel</a> 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%. That way, we can <strong>4x</strong> our context length, as described in the benchmark below. They have implemented Hugging Face compatible <code>RMSNorm</code>, <code>RoPE</code>, <code>SwiGLU</code>, <code>CrossEntropy</code>, <code>FusedLinearCrossEntropy</code>, with more to come. The kernel works out of the box with <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow">FlashAttention</a>, <a href="https://pytorch.org/tutorials/intermediate/FSDP_tutorial.html" rel="nofollow">PyTorch FSDP</a>, and <a href="https://github.com/microsoft/DeepSpeed" rel="nofollow">Microsoft DeepSpeed</a>.',j,u,te="With this memory reduction, you can potentially turn off <code>cpu_offloading</code> or gradient checkpointing to further boost the performance.",I,h,ne='<thead><tr><th>Speed Up</th> <th>Memory Reduction</th></tr></thead> <tbody><tr><td><img src="https://raw.githubusercontent.com/linkedin/Liger-Kernel/main/docs/images/e2e-tps.png" alt="Speed up"/></td> <td><img src="https://raw.githubusercontent.com/linkedin/Liger-Kernel/main/docs/images/e2e-memory.png" alt="Memory"/></td></tr></tbody>',z,p,g,T,ie='To use Liger-Kernel in <a href="/docs/trl/pr_4331/en/sft_trainer#trl.SFTTrainer">SFTTrainer</a>, first install it by:',B,$,Q,M,re='<p>Once installed, set <code>use_liger_kernel</code> in <a href="/docs/trl/pr_4331/en/sft_trainer#trl.SFTConfig">SFTConfig</a>. No other changes are needed!</p>',J,b,V,y,le='To learn more about Liger-Kernel, visit their <a href="https://github.com/linkedin/Liger-Kernel/" rel="nofollow">official repository</a>.',D,L,N,v,O;return c=new de({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new ue({props:{title:"Liger Kernel Integration",local:"liger-kernel-integration",headingTag:"h1"}}),$=new oe({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxpZ2VyLWtlcm5lbA==",highlighted:"pip install liger-kernel",wrap:!1}}),b=new oe({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFNGVENvbmZpZyglMEElMjAlMjAlMjAlMjB1c2VfbGlnZXJfa2VybmVsJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMC4uLiUwQSk=",highlighted:`training_args = SFTConfig( | |
| use_liger_kernel=<span class="hljs-literal">True</span>, | |
| ... | |
| )`,wrap:!1}}),L=new he({props:{source:"https://github.com/huggingface/trl/blob/main/docs/source/liger_kernel_integration.md"}}),{c(){s=o("meta"),P=r(),C=o("p"),F=r(),k(c.$$.fragment),K=r(),k(f.$$.fragment),A=r(),m=o("blockquote"),m.innerHTML=Y,G=r(),d=o("p"),d.innerHTML=ee,j=r(),u=o("p"),u.innerHTML=te,I=r(),h=o("table"),h.innerHTML=ne,z=r(),p=o("ol"),g=o("li"),T=o("p"),T.innerHTML=ie,B=r(),k($.$$.fragment),Q=r(),M=o("li"),M.innerHTML=re,J=r(),k(b.$$.fragment),V=r(),y=o("p"),y.innerHTML=le,D=r(),k(L.$$.fragment),N=r(),v=o("p"),this.h()},l(e){const t=fe("svelte-u9bgzb",document.head);s=a(t,"META",{name:!0,content:!0}),t.forEach(n),P=l(e),C=a(e,"P",{}),q(C).forEach(n),F=l(e),x(c.$$.fragment,e),K=l(e),x(f.$$.fragment,e),A=l(e),m=a(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),_(m)!=="svelte-1gc28wp"&&(m.innerHTML=Y),G=l(e),d=a(e,"P",{"data-svelte-h":!0}),_(d)!=="svelte-1xp5liz"&&(d.innerHTML=ee),j=l(e),u=a(e,"P",{"data-svelte-h":!0}),_(u)!=="svelte-m20qmf"&&(u.innerHTML=te),I=l(e),h=a(e,"TABLE",{"data-svelte-h":!0}),_(h)!=="svelte-1jpb79"&&(h.innerHTML=ne),z=l(e),p=a(e,"OL",{});var R=q(p);g=a(R,"LI",{});var Z=q(g);T=a(Z,"P",{"data-svelte-h":!0}),_(T)!=="svelte-os5zox"&&(T.innerHTML=ie),B=l(Z),x($.$$.fragment,Z),Z.forEach(n),Q=l(R),M=a(R,"LI",{"data-svelte-h":!0}),_(M)!=="svelte-1dt93tr"&&(M.innerHTML=re),R.forEach(n),J=l(e),x(b.$$.fragment,e),V=l(e),y=a(e,"P",{"data-svelte-h":!0}),_(y)!=="svelte-1h5mxii"&&(y.innerHTML=le),D=l(e),x(L.$$.fragment,e),N=l(e),v=a(e,"P",{}),q(v).forEach(n),this.h()},h(){W(s,"name","hf:doc:metadata"),W(s,"content",$e),W(m,"class","warning")},m(e,t){w(document.head,s),i(e,P,t),i(e,C,t),i(e,F,t),S(c,e,t),i(e,K,t),S(f,e,t),i(e,A,t),i(e,m,t),i(e,G,t),i(e,d,t),i(e,j,t),i(e,u,t),i(e,I,t),i(e,h,t),i(e,z,t),i(e,p,t),w(p,g),w(g,T),w(g,B),S($,g,null),w(p,Q),w(p,M),i(e,J,t),S(b,e,t),i(e,V,t),i(e,y,t),i(e,D,t),S(L,e,t),i(e,N,t),i(e,v,t),O=!0},p:se,i(e){O||(H(c.$$.fragment,e),H(f.$$.fragment,e),H($.$$.fragment,e),H(b.$$.fragment,e),H(L.$$.fragment,e),O=!0)},o(e){E(c.$$.fragment,e),E(f.$$.fragment,e),E($.$$.fragment,e),E(b.$$.fragment,e),E(L.$$.fragment,e),O=!1},d(e){e&&(n(P),n(C),n(F),n(K),n(A),n(m),n(G),n(d),n(j),n(u),n(I),n(h),n(z),n(p),n(J),n(V),n(y),n(D),n(N),n(v)),n(s),U(c,e),U(f,e),U($),U(b,e),U(L,e)}}}const $e='{"title":"Liger Kernel Integration","local":"liger-kernel-integration","sections":[],"depth":1}';function be(X){return me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Me extends pe{constructor(s){super(),ce(this,s,be,ge,ae,{})}}export{Me as component}; | |
Xet Storage Details
- Size:
- 5.5 kB
- Xet hash:
- ab986d1d40e11255b08353f7764dc12a0f4994c35ab3503c7e8b094585605a76
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.