import{s as Q,o as V,n as W}from"../chunks/scheduler.18a86fab.js";import{S as X,i as Z,g as l,s,r as R,A as ee,h as c,f as n,c as o,j as K,u as q,x as v,k as D,y as te,a,v as z,d as O,t as B,w as N}from"../chunks/index.98837b22.js";import{T as ne}from"../chunks/Tip.77304350.js";import{H as J}from"../chunks/Heading.7e7e0c5b.js";import{E as ae}from"../chunks/index.499f366c.js";function re(P){let r,m='Some PyTorch operations are not implemented in MPS yet. To avoid an error, set the environment variable <code>PYTORCH_ENABLE_MPS_FALLBACK=1</code> to fallback on the CPU kernels. Please open an issue in the <a href="https://github.com/pytorch/pytorch/issues" rel="nofollow">PyTorch</a> repository if you encounter any other issues.';return{c(){r=l("p"),r.innerHTML=m},l(i){r=c(i,"P",{"data-svelte-h":!0}),v(r)!=="svelte-iripzc"&&(r.innerHTML=m)},m(i,b){a(i,r,b)},p:W,d(i){i&&n(r)}}}function ie(P){let r,m,i,b,f,M,u,U='Apple Silicon (M series) features a unified memory architecture, making it possible to efficiently train large models locally and improves performance by reducing latency associated with data retrieval. You can take advantage of Apple Silicon for training with PyTorch due to its integration with <a href="https://pytorch.org/docs/stable/notes/mps.html" rel="nofollow">Metal Performance Shaders (MPS)</a>.',w,d,Y="The <code>mps</code> backend requires macOS 12.3 or later.",L,p,H,h,j='<a href="/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> and <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer">Trainer</a> detects and sets the backend device to <code>mps</code> if an Apple Silicon device is available. No additional changes are required to enable training on your device.',S,$,F='The <code>mps</code> backend doesn’t support <a href="https://pytorch.org/docs/stable/distributed.html#backends" rel="nofollow">distributed training</a>.',A,g,k,_,G='Learn more about the MPS backend in the <a href="https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/" rel="nofollow">Introducing Accelerated PyTorch Training on Mac</a> blog post.',x,T,C,y,E;return f=new J({props:{title:"Apple Silicon",local:"apple-silicon",headingTag:"h1"}}),p=new ne({props:{warning:!0,$$slots:{default:[re]},$$scope:{ctx:P}}}),g=new J({props:{title:"Resources",local:"resources",headingTag:"h2"}}),T=new ae({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/perf_train_special.md"}}),{c(){r=l("meta"),m=s(),i=l("p"),b=s(),R(f.$$.fragment),M=s(),u=l("p"),u.innerHTML=U,w=s(),d=l("p"),d.innerHTML=Y,L=s(),R(p.$$.fragment),H=s(),h=l("p"),h.innerHTML=j,S=s(),$=l("p"),$.innerHTML=F,A=s(),R(g.$$.fragment),k=s(),_=l("p"),_.innerHTML=G,x=s(),R(T.$$.fragment),C=s(),y=l("p"),this.h()},l(e){const t=ee("svelte-u9bgzb",document.head);r=c(t,"META",{name:!0,content:!0}),t.forEach(n),m=o(e),i=c(e,"P",{}),K(i).forEach(n),b=o(e),q(f.$$.fragment,e),M=o(e),u=c(e,"P",{"data-svelte-h":!0}),v(u)!=="svelte-58tmea"&&(u.innerHTML=U),w=o(e),d=c(e,"P",{"data-svelte-h":!0}),v(d)!=="svelte-1hxeblo"&&(d.innerHTML=Y),L=o(e),q(p.$$.fragment,e),H=o(e),h=c(e,"P",{"data-svelte-h":!0}),v(h)!=="svelte-1knw9pw"&&(h.innerHTML=j),S=o(e),$=c(e,"P",{"data-svelte-h":!0}),v($)!=="svelte-1wz5tu"&&($.innerHTML=F),A=o(e),q(g.$$.fragment,e),k=o(e),_=c(e,"P",{"data-svelte-h":!0}),v(_)!=="svelte-8ysi6u"&&(_.innerHTML=G),x=o(e),q(T.$$.fragment,e),C=o(e),y=c(e,"P",{}),K(y).forEach(n),this.h()},h(){D(r,"name","hf:doc:metadata"),D(r,"content",se)},m(e,t){te(document.head,r),a(e,m,t),a(e,i,t),a(e,b,t),z(f,e,t),a(e,M,t),a(e,u,t),a(e,w,t),a(e,d,t),a(e,L,t),z(p,e,t),a(e,H,t),a(e,h,t),a(e,S,t),a(e,$,t),a(e,A,t),z(g,e,t),a(e,k,t),a(e,_,t),a(e,x,t),z(T,e,t),a(e,C,t),a(e,y,t),E=!0},p(e,[t]){const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),p.$set(I)},i(e){E||(O(f.$$.fragment,e),O(p.$$.fragment,e),O(g.$$.fragment,e),O(T.$$.fragment,e),E=!0)},o(e){B(f.$$.fragment,e),B(p.$$.fragment,e),B(g.$$.fragment,e),B(T.$$.fragment,e),E=!1},d(e){e&&(n(m),n(i),n(b),n(M),n(u),n(w),n(d),n(L),n(H),n(h),n(S),n($),n(A),n(k),n(_),n(x),n(C),n(y)),n(r),N(f,e),N(p,e),N(g,e),N(T,e)}}}const se='{"title":"Apple Silicon","local":"apple-silicon","sections":[{"title":"Resources","local":"resources","sections":[],"depth":2}],"depth":1}';function oe(P){return V(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ue extends X{constructor(r){super(),Z(this,r,oe,ie,Q,{})}}export{ue as component};
