import{s as ve,n as _e,o as Ee}from"../chunks/scheduler.b9285784.js";import{S as We,i as Fe,e as w,s as a,c as M,h as Ye,a as T,d as l,b as i,f as Se,g as s,j as c,k as Ne,l as Ve,m as n,n as m,t as p,o,p as r}from"../chunks/index.26bc89a1.js";import{C as Xe,H as P,E as ke}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.7242ff19.js";import{C as y}from"../chunks/CodeBlock.c8ee1711.js";function Le($e){let f,R,k,z,u,Q,J,H,U,de="Before you start, you will need to setup your environment, install the appropriate packages, and configure Accelerate. Accelerate is tested on <strong>Python 3.8+</strong>.",q,j,be="Accelerate is available on pypi and conda, as well as on GitHub. Details to install from each are below:",D,$,O,d,Ie="To install Accelerate from pypi, perform:",K,b,ee,I,te,h,he="Accelerate can also be installed with conda with:",le,g,ne,A,ae,C,ge=`New features are added every day that haven’t been released yet. To try them out yourself, install
from the GitHub repository:`,ie,x,Me,B,Ae=`If you’re working on contributing to the library or wish to play with the source code and see live
results as you run the code, an editable version can be installed from a locally-cloned version of the
repository:`,se,G,me,Z,pe,S,Ce=`After installing, you need to configure Accelerate for how the current system is setup for training.
To do so run the following and answer the questions prompted to you:`,oe,N,re,v,xe="To write a barebones configuration that doesn’t include options such as DeepSpeed configuration or running on TPUs, you can quickly run:",we,_,Te,E,Be="Accelerate will automatically utilize the maximum number of GPUs available and set the mixed precision mode.",ce,W,Ge="To check that your configuration looks fine, run:",fe,F,ye,Y,Ze="An example output is shown below, which describes two GPUs on a single machine with no mixed precision being used:",ue,V,Je,X,Ue,L,je;return u=new Xe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),J=new P({props:{title:"Installation",local:"installation",headingTag:"h1"}}),$=new P({props:{title:"pip",local:"pip",headingTag:"h2"}}),b=new y({props:{code:"cGlwJTIwaW5zdGFsbCUyMGFjY2VsZXJhdGU=",highlighted:"pip install accelerate",wrap:!1}}),I=new P({props:{title:"conda",local:"conda",headingTag:"h2"}}),g=new y({props:{code:"Y29uZGElMjBpbnN0YWxsJTIwLWMlMjBjb25kYS1mb3JnZSUyMGFjY2VsZXJhdGU=",highlighted:"conda install -c conda-forge accelerate",wrap:!1}}),A=new P({props:{title:"Source",local:"source",headingTag:"h2"}}),x=new y({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZQ==",highlighted:"pip install git+https://github.com/huggingface/accelerate",wrap:!1}}),G=new y({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmFjY2VsZXJhdGUlMEFjZCUyMGFjY2VsZXJhdGUlMEFwaXAlMjBpbnN0YWxsJTIwLWUlMjAu",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/accelerate
<span class="hljs-built_in">cd</span> accelerate
pip install -e .`,wrap:!1}}),Z=new P({props:{title:"Configuration",local:"configuration",headingTag:"h2"}}),N=new y({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),_=new y({props:{code:"cHl0aG9uJTIwLWMlMjAlMjJmcm9tJTIwYWNjZWxlcmF0ZS51dGlscyUyMGltcG9ydCUyMHdyaXRlX2Jhc2ljX2NvbmZpZyUzQiUyMHdyaXRlX2Jhc2ljX2NvbmZpZyhtaXhlZF9wcmVjaXNpb24lM0QnZnAxNicpJTIy",highlighted:'python -c <span class="hljs-string">&quot;from accelerate.utils import write_basic_config; write_basic_config(mixed_precision=&#x27;fp16&#x27;)&quot;</span>',wrap:!1}}),F=new y({props:{code:"YWNjZWxlcmF0ZSUyMGVudg==",highlighted:'accelerate <span class="hljs-built_in">env</span>',wrap:!1}}),V=new y({props:{code:"LSUyMCU2MEFjY2VsZXJhdGUlNjAlMjB2ZXJzaW9uJTNBJTIwMS4yLjAuZGV2MCUwQS0lMjBQbG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6.8.0-47-generic-x86_64-with-glibc2.35
- \`accelerate\` bash location: /home/zach/miniconda3/envs/accelerate/bin/accelerate
- Python version: 3.10.13
- Numpy version: 1.26.4
- PyTorch version (GPU?): 2.5.1+cu124 (True)
- PyTorch XPU available: False
- PyTorch NPU available: False
- PyTorch MLU available: False
- PyTorch MUSA available: False
- System RAM: 187.91 GB
- GPU <span class="hljs-built_in">type</span>: NVIDIA GeForce RTX 4090
- \`Accelerate\` default config:
        - compute_environment: LOCAL_MACHINE
        - distributed_type: MULTI_GPU
        - mixed_precision: no
        - use_cpu: False
        - debug: False
        - num_processes: 2
        - machine_rank: 0
        - num_machines: 1
        - gpu_ids: all
        - rdzv_backend: static
        - same_network: True
        - main_training_function: main
        - enable_cpu_affinity: False
        - downcast_bf16: no
        - tpu_use_cluster: False
        - tpu_use_sudo: False
        - tpu_env: []`,wrap:!1}}),X=new ke({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/basic_tutorials/install.md"}}),{c(){f=w("meta"),R=a(),k=w("p"),z=a(),M(u.$$.fragment),Q=a(),M(J.$$.fragment),H=a(),U=w("p"),U.innerHTML=de,q=a(),j=w("p"),j.textContent=be,D=a(),M($.$$.fragment),O=a(),d=w("p"),d.textContent=Ie,K=a(),M(b.$$.fragment),ee=a(),M(I.$$.fragment),te=a(),h=w("p"),h.textContent=he,le=a(),M(g.$$.fragment),ne=a(),M(A.$$.fragment),ae=a(),C=w("p"),C.textContent=ge,ie=a(),M(x.$$.fragment),Me=a(),B=w("p"),B.textContent=Ae,se=a(),M(G.$$.fragment),me=a(),M(Z.$$.fragment),pe=a(),S=w("p"),S.textContent=Ce,oe=a(),M(N.$$.fragment),re=a(),v=w("p"),v.textContent=xe,we=a(),M(_.$$.fragment),Te=a(),E=w("p"),E.textContent=Be,ce=a(),W=w("p"),W.textContent=Ge,fe=a(),M(F.$$.fragment),ye=a(),Y=w("p"),Y.textContent=Ze,ue=a(),M(V.$$.fragment),Je=a(),M(X.$$.fragment),Ue=a(),L=w("p"),this.h()},l(e){const t=Ye("svelte-u9bgzb",document.head);f=T(t,"META",{name:!0,content:!0}),t.forEach(l),R=i(e),k=T(e,"P",{}),Se(k).forEach(l),z=i(e),s(u.$$.fragment,e),Q=i(e),s(J.$$.fragment,e),H=i(e),U=T(e,"P",{"data-svelte-h":!0}),c(U)!=="svelte-ba2x89"&&(U.innerHTML=de),q=i(e),j=T(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-dwmq6v"&&(j.textContent=be),D=i(e),s($.$$.fragment,e),O=i(e),d=T(e,"P",{"data-svelte-h":!0}),c(d)!=="svelte-1yuglu6"&&(d.textContent=Ie),K=i(e),s(b.$$.fragment,e),ee=i(e),s(I.$$.fragment,e),te=i(e),h=T(e,"P",{"data-svelte-h":!0}),c(h)!=="svelte-1k8pkaq"&&(h.textContent=he),le=i(e),s(g.$$.fragment,e),ne=i(e),s(A.$$.fragment,e),ae=i(e),C=T(e,"P",{"data-svelte-h":!0}),c(C)!=="svelte-12xzaml"&&(C.textContent=ge),ie=i(e),s(x.$$.fragment,e),Me=i(e),B=T(e,"P",{"data-svelte-h":!0}),c(B)!=="svelte-1vkgb3u"&&(B.textContent=Ae),se=i(e),s(G.$$.fragment,e),me=i(e),s(Z.$$.fragment,e),pe=i(e),S=T(e,"P",{"data-svelte-h":!0}),c(S)!=="svelte-dbkgg3"&&(S.textContent=Ce),oe=i(e),s(N.$$.fragment,e),re=i(e),v=T(e,"P",{"data-svelte-h":!0}),c(v)!=="svelte-cxy4hk"&&(v.textContent=xe),we=i(e),s(_.$$.fragment,e),Te=i(e),E=T(e,"P",{"data-svelte-h":!0}),c(E)!=="svelte-103gb4t"&&(E.textContent=Be),ce=i(e),W=T(e,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1j0llwk"&&(W.textContent=Ge),fe=i(e),s(F.$$.fragment,e),ye=i(e),Y=T(e,"P",{"data-svelte-h":!0}),c(Y)!=="svelte-20cfjt"&&(Y.textContent=Ze),ue=i(e),s(V.$$.fragment,e),Je=i(e),s(X.$$.fragment,e),Ue=i(e),L=T(e,"P",{}),Se(L).forEach(l),this.h()},h(){Ne(f,"name","hf:doc:metadata"),Ne(f,"content",Pe)},m(e,t){Ve(document.head,f),n(e,R,t),n(e,k,t),n(e,z,t),m(u,e,t),n(e,Q,t),m(J,e,t),n(e,H,t),n(e,U,t),n(e,q,t),n(e,j,t),n(e,D,t),m($,e,t),n(e,O,t),n(e,d,t),n(e,K,t),m(b,e,t),n(e,ee,t),m(I,e,t),n(e,te,t),n(e,h,t),n(e,le,t),m(g,e,t),n(e,ne,t),m(A,e,t),n(e,ae,t),n(e,C,t),n(e,ie,t),m(x,e,t),n(e,Me,t),n(e,B,t),n(e,se,t),m(G,e,t),n(e,me,t),m(Z,e,t),n(e,pe,t),n(e,S,t),n(e,oe,t),m(N,e,t),n(e,re,t),n(e,v,t),n(e,we,t),m(_,e,t),n(e,Te,t),n(e,E,t),n(e,ce,t),n(e,W,t),n(e,fe,t),m(F,e,t),n(e,ye,t),n(e,Y,t),n(e,ue,t),m(V,e,t),n(e,Je,t),m(X,e,t),n(e,Ue,t),n(e,L,t),je=!0},p:_e,i(e){je||(p(u.$$.fragment,e),p(J.$$.fragment,e),p($.$$.fragment,e),p(b.$$.fragment,e),p(I.$$.fragment,e),p(g.$$.fragment,e),p(A.$$.fragment,e),p(x.$$.fragment,e),p(G.$$.fragment,e),p(Z.$$.fragment,e),p(N.$$.fragment,e),p(_.$$.fragment,e),p(F.$$.fragment,e),p(V.$$.fragment,e),p(X.$$.fragment,e),je=!0)},o(e){o(u.$$.fragment,e),o(J.$$.fragment,e),o($.$$.fragment,e),o(b.$$.fragment,e),o(I.$$.fragment,e),o(g.$$.fragment,e),o(A.$$.fragment,e),o(x.$$.fragment,e),o(G.$$.fragment,e),o(Z.$$.fragment,e),o(N.$$.fragment,e),o(_.$$.fragment,e),o(F.$$.fragment,e),o(V.$$.fragment,e),o(X.$$.fragment,e),je=!1},d(e){e&&(l(R),l(k),l(z),l(Q),l(H),l(U),l(q),l(j),l(D),l(O),l(d),l(K),l(ee),l(te),l(h),l(le),l(ne),l(ae),l(C),l(ie),l(Me),l(B),l(se),l(me),l(pe),l(S),l(oe),l(re),l(v),l(we),l(Te),l(E),l(ce),l(W),l(fe),l(ye),l(Y),l(ue),l(Je),l(Ue),l(L)),l(f),r(u,e),r(J,e),r($,e),r(b,e),r(I,e),r(g,e),r(A,e),r(x,e),r(G,e),r(Z,e),r(N,e),r(_,e),r(F,e),r(V,e),r(X,e)}}}const Pe='{"title":"Installation","local":"installation","sections":[{"title":"pip","local":"pip","sections":[],"depth":2},{"title":"conda","local":"conda","sections":[],"depth":2},{"title":"Source","local":"source","sections":[],"depth":2},{"title":"Configuration","local":"configuration","sections":[],"depth":2}],"depth":1}';function Re($e){return Ee(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class De extends We{constructor(f){super(),Fe(this,f,Re,Le,ve,{})}}export{De as component};
