Buckets:

rtrm's picture
download
raw
9.63 kB
import{s as dt,o as Pt,n as vt}from"../chunks/scheduler.9bc65507.js";import{S as gt,i as xt,g as o,s as r,r as _,A as Ct,h as s,f as n,c as l,j as _t,u as T,x as m,k as Tt,y as yt,a as i,v as d,d as P,t as v,w as g}from"../chunks/index.707bf1b6.js";import{T as jt}from"../chunks/Tip.c2ecdbf4.js";import{H as k,E as bt}from"../chunks/EditOnGithub.922df6ba.js";function wt(A){let a,x="PyTorch >= 1.14.0の場合、jitモードはjit.traceでdict入力がサポートされているため、予測と評価に任意のモデルに利益をもたらす可能性があります。",c,p,$="PyTorch < 1.14.0の場合、jitモードはforwardパラメーターの順序がjit.traceのタプル入力の順序と一致するモデルに利益をもたらす可能性があります(質問応答モデルなど)。jit.traceがタプル入力の順序と一致しない場合、テキスト分類モデルなど、jit.traceは失敗し、これをフォールバックさせるために例外でキャッチしています。ログはユーザーに通知するために使用されます。";return{c(){a=o("p"),a.textContent=x,c=r(),p=o("p"),p.textContent=$},l(f){a=s(f,"P",{"data-svelte-h":!0}),m(a)!=="svelte-uj65sm"&&(a.textContent=x),c=l(f),p=s(f,"P",{"data-svelte-h":!0}),m(p)!=="svelte-1mjd070"&&(p.textContent=$)},m(f,u){i(f,a,u),i(f,c,u),i(f,p,u)},p:vt,d(f){f&&(n(a),n(c),n(p))}}}function It(A){let a,x,c,p,$,f,u,lt="このガイドは、CPU上で大規模なモデルの効率的な推論に焦点を当てています。",B,C,F,y,at='最近、テキスト、画像、および音声モデルのCPU上での高速な推論のために<code>BetterTransformer</code>を統合しました。詳細については、この統合に関するドキュメンテーションを<a href="https://huggingface.co/docs/optimum/bettertransformer/overview" rel="nofollow">こちら</a>で確認してください。',G,j,N,b,ot=`TorchScriptは、PyTorchコードからシリアライズ可能で最適化可能なモデルを作成する方法です。任意のTorchScriptプログラムは、Python依存性のないプロセスで保存およびロードできます。
デフォルトのイーガーモードと比較して、PyTorchのjitモードは通常、オペレーターフュージョンなどの最適化手法によりモデル推論のパフォーマンスが向上します。`,O,w,st='TorchScriptの簡単な紹介については、<a href="https://pytorch.org/tutorials/beginner/Intro_to_TorchScript_tutorial.html#tracing-modules" rel="nofollow">PyTorch TorchScriptチュートリアル</a>を参照してください。',R,I,D,L,ft="Intel® Extension for PyTorchは、Transformersシリーズモデルのjitモードにさらなる最適化を提供します。Intel® Extension for PyTorchをjitモードで使用することを強くお勧めします。Transformersモデルからよく使用されるオペレーターパターンのいくつかは、既にIntel® Extension for PyTorchでjitモードのフュージョンに対応しています。これらのフュージョンパターン(Multi-head-attentionフュージョン、Concat Linear、Linear+Add、Linear+Gelu、Add+LayerNormフュージョンなど)は有効でパフォーマンスが良いです。フュージョンの利点は、ユーザーに透過的に提供されます。分析によれば、最も人気のある質問応答、テキスト分類、トークン分類のNLPタスクの約70%が、これらのフュージョンパターンを使用してFloat32精度とBFloat16混合精度の両方でパフォーマンスの利点を得ることができます。",K,E,pt='<a href="https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/features/graph_optimization.html" rel="nofollow">IPEXグラフ最適化の詳細情報</a>を確認してください。',Q,M,V,H,mt='IPEXのリリースはPyTorchに従っています。<a href="https://intel.github.io/intel-extension-for-pytorch/" rel="nofollow">IPEXのインストール方法</a>を確認してください。',W,q,Y,S,ut="Trainerで評価または予測のためにJITモードを有効にするには、ユーザーはTrainerコマンド引数に<code>jit_mode_eval</code>を追加する必要があります。",Z,h,tt,U,ct='<a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering" rel="nofollow">Transformers質問応答の使用例</a>を参考にしてください。',et,X,$t=`<li><p>Inference using jit mode on CPU:</p> <pre>python run_qa.py \\
--model_name_or_path csarron/bert-base-uncased-squad-v1 \\
--dataset_name squad \\
--do_eval \\
--max_seq_length 384 \\
--doc_stride 128 \\
--output_dir /tmp/ \\
--no_cuda \\
<b>--jit_mode_eval </b></pre></li> <li><p>Inference with IPEX using jit mode on CPU:</p> <pre>python run_qa.py \\
--model_name_or_path csarron/bert-base-uncased-squad-v1 \\
--dataset_name squad \\
--do_eval \\
--max_seq_length 384 \\
--doc_stride 128 \\
--output_dir /tmp/ \\
--no_cuda \\
<b>--use_ipex \\</b>
<b>--jit_mode_eval</b></pre></li>`,nt,J,it,z,rt;return $=new k({props:{title:"Efficient Inference on CPU",local:"efficient-inference-on-cpu",headingTag:"h1"}}),C=new k({props:{title:"BetterTransformer for faster inference",local:"bettertransformer-for-faster-inference",headingTag:"h2"}}),j=new k({props:{title:"PyTorch JITモード(TorchScript)",local:"pytorch-jitモードtorchscript",headingTag:"h2"}}),I=new k({props:{title:"JITモードでのIPEXグラフ最適化",local:"jitモードでのipexグラフ最適化",headingTag:"h3"}}),M=new k({props:{title:"IPEX installation:",local:"ipex-installation",headingTag:"h4"}}),q=new k({props:{title:"Usage of JIT-mode",local:"usage-of-jit-mode",headingTag:"h3"}}),h=new jt({props:{warning:!0,$$slots:{default:[wt]},$$scope:{ctx:A}}}),J=new bt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/perf_infer_cpu.md"}}),{c(){a=o("meta"),x=r(),c=o("p"),p=r(),_($.$$.fragment),f=r(),u=o("p"),u.textContent=lt,B=r(),_(C.$$.fragment),F=r(),y=o("p"),y.innerHTML=at,G=r(),_(j.$$.fragment),N=r(),b=o("p"),b.textContent=ot,O=r(),w=o("p"),w.innerHTML=st,R=r(),_(I.$$.fragment),D=r(),L=o("p"),L.textContent=ft,K=r(),E=o("p"),E.innerHTML=pt,Q=r(),_(M.$$.fragment),V=r(),H=o("p"),H.innerHTML=mt,W=r(),_(q.$$.fragment),Y=r(),S=o("p"),S.innerHTML=ut,Z=r(),_(h.$$.fragment),tt=r(),U=o("p"),U.innerHTML=ct,et=r(),X=o("ul"),X.innerHTML=$t,nt=r(),_(J.$$.fragment),it=r(),z=o("p"),this.h()},l(t){const e=Ct("svelte-u9bgzb",document.head);a=s(e,"META",{name:!0,content:!0}),e.forEach(n),x=l(t),c=s(t,"P",{}),_t(c).forEach(n),p=l(t),T($.$$.fragment,t),f=l(t),u=s(t,"P",{"data-svelte-h":!0}),m(u)!=="svelte-173ykpk"&&(u.textContent=lt),B=l(t),T(C.$$.fragment,t),F=l(t),y=s(t,"P",{"data-svelte-h":!0}),m(y)!=="svelte-1gv96n8"&&(y.innerHTML=at),G=l(t),T(j.$$.fragment,t),N=l(t),b=s(t,"P",{"data-svelte-h":!0}),m(b)!=="svelte-s6mz7v"&&(b.textContent=ot),O=l(t),w=s(t,"P",{"data-svelte-h":!0}),m(w)!=="svelte-1vr7y5u"&&(w.innerHTML=st),R=l(t),T(I.$$.fragment,t),D=l(t),L=s(t,"P",{"data-svelte-h":!0}),m(L)!=="svelte-gbkgfl"&&(L.textContent=ft),K=l(t),E=s(t,"P",{"data-svelte-h":!0}),m(E)!=="svelte-qo6507"&&(E.innerHTML=pt),Q=l(t),T(M.$$.fragment,t),V=l(t),H=s(t,"P",{"data-svelte-h":!0}),m(H)!=="svelte-1u3jvxp"&&(H.innerHTML=mt),W=l(t),T(q.$$.fragment,t),Y=l(t),S=s(t,"P",{"data-svelte-h":!0}),m(S)!=="svelte-15m7esz"&&(S.innerHTML=ut),Z=l(t),T(h.$$.fragment,t),tt=l(t),U=s(t,"P",{"data-svelte-h":!0}),m(U)!=="svelte-r9hc9d"&&(U.innerHTML=ct),et=l(t),X=s(t,"UL",{"data-svelte-h":!0}),m(X)!=="svelte-143w2h7"&&(X.innerHTML=$t),nt=l(t),T(J.$$.fragment,t),it=l(t),z=s(t,"P",{}),_t(z).forEach(n),this.h()},h(){Tt(a,"name","hf:doc:metadata"),Tt(a,"content",Lt)},m(t,e){yt(document.head,a),i(t,x,e),i(t,c,e),i(t,p,e),d($,t,e),i(t,f,e),i(t,u,e),i(t,B,e),d(C,t,e),i(t,F,e),i(t,y,e),i(t,G,e),d(j,t,e),i(t,N,e),i(t,b,e),i(t,O,e),i(t,w,e),i(t,R,e),d(I,t,e),i(t,D,e),i(t,L,e),i(t,K,e),i(t,E,e),i(t,Q,e),d(M,t,e),i(t,V,e),i(t,H,e),i(t,W,e),d(q,t,e),i(t,Y,e),i(t,S,e),i(t,Z,e),d(h,t,e),i(t,tt,e),i(t,U,e),i(t,et,e),i(t,X,e),i(t,nt,e),d(J,t,e),i(t,it,e),i(t,z,e),rt=!0},p(t,[e]){const ht={};e&2&&(ht.$$scope={dirty:e,ctx:t}),h.$set(ht)},i(t){rt||(P($.$$.fragment,t),P(C.$$.fragment,t),P(j.$$.fragment,t),P(I.$$.fragment,t),P(M.$$.fragment,t),P(q.$$.fragment,t),P(h.$$.fragment,t),P(J.$$.fragment,t),rt=!0)},o(t){v($.$$.fragment,t),v(C.$$.fragment,t),v(j.$$.fragment,t),v(I.$$.fragment,t),v(M.$$.fragment,t),v(q.$$.fragment,t),v(h.$$.fragment,t),v(J.$$.fragment,t),rt=!1},d(t){t&&(n(x),n(c),n(p),n(f),n(u),n(B),n(F),n(y),n(G),n(N),n(b),n(O),n(w),n(R),n(D),n(L),n(K),n(E),n(Q),n(V),n(H),n(W),n(Y),n(S),n(Z),n(tt),n(U),n(et),n(X),n(nt),n(it),n(z)),n(a),g($,t),g(C,t),g(j,t),g(I,t),g(M,t),g(q,t),g(h,t),g(J,t)}}}const Lt='{"title":"Efficient Inference on CPU","local":"efficient-inference-on-cpu","sections":[{"title":"BetterTransformer for faster inference","local":"bettertransformer-for-faster-inference","sections":[],"depth":2},{"title":"PyTorch JITモード(TorchScript)","local":"pytorch-jitモードtorchscript","sections":[{"title":"JITモードでのIPEXグラフ最適化","local":"jitモードでのipexグラフ最適化","sections":[{"title":"IPEX installation:","local":"ipex-installation","sections":[],"depth":4}],"depth":3},{"title":"Usage of JIT-mode","local":"usage-of-jit-mode","sections":[],"depth":3}],"depth":2}],"depth":1}';function Et(A){return Pt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends gt{constructor(a){super(),xt(this,a,Et,It,dt,{})}}export{Ut as component};

Xet Storage Details

Size:
9.63 kB
·
Xet hash:
4b09ce69ce4a5a9d0d8f9dd6cac76db85ff8338d20e9db5f43cc961104a182cb

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.