import{s as Ft,o as Yt,n as $e}from"../chunks/scheduler.8c3d61f6.js";import{S as Et,i as St,g as m,s,r as h,A as Qt,h as f,f as l,c as i,j as Lt,u as b,x as u,k as zt,y as qt,a as n,v as y,d as M,t as w,w as $}from"../chunks/index.da70eac4.js";import{T as ut}from"../chunks/Tip.1d9b8c37.js";import{C as _}from"../chunks/CodeBlock.a9c4becf.js";import{H as v,E as At}from"../chunks/getInferenceSnippets.39110341.js";import{H as Pt,a as dt}from"../chunks/HfOption.6ab18950.js";function Dt(j){let a,d="bfloat16 is similar to float16 but it is more robust to numerical errors. Hardware support for bfloat16 varies, but most modern GPUs are capable of supporting bfloat16.",o,c,T;return c=new _({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSkudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBc3Ryb25hdXQlMjBpbiUyMGElMjBqdW5nbGUlMkMlMjBjb2xkJTIwY29sb3IlMjBwYWxldHRlJTJDJTIwbXV0ZWQlMjBjb2xvcnMlMkMlMjBkZXRhaWxlZCUyQyUyMDhrJTIyJTBBcGlwZWxpbmUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDMwKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){a=m("p"),a.textContent=d,o=s(),h(c.$$.fragment)},l(r){a=f(r,"P",{"data-svelte-h":!0}),u(a)!=="svelte-kz0em0"&&(a.textContent=d),o=i(r),b(c.$$.fragment,r)},m(r,p){n(r,a,p),n(r,o,p),y(c,r,p),T=!0},p:$e,i(r){T||(M(c.$$.fragment,r),T=!0)},o(r){w(c.$$.fragment,r),T=!1},d(r){r&&(l(a),l(o)),$(c,r)}}}function Kt(j){let a,d="float16 is similar to bfloat16 but may be more prone to numerical errors.",o,c,T;return c=new _({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkFzdHJvbmF1dCUyMGluJTIwYSUyMGp1bmdsZSUyQyUyMGNvbGQlMjBjb2xvciUyMHBhbGV0dGUlMkMlMjBtdXRlZCUyMGNvbG9ycyUyQyUyMGRldGFpbGVkJTJDJTIwOGslMjIlMEFwaXBlbGluZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzApLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){a=m("p"),a.textContent=d,o=s(),h(c.$$.fragment)},l(r){a=f(r,"P",{"data-svelte-h":!0}),u(a)!=="svelte-nzm7ns"&&(a.textContent=d),o=i(r),b(c.$$.fragment,r)},m(r,p){n(r,a,p),n(r,o,p),y(c,r,p),T=!0},p:$e,i(r){T||(M(c.$$.fragment,r),T=!0)},o(r){w(c.$$.fragment,r),T=!1},d(r){r&&(l(a),l(o)),$(c,r)}}}function Ot(j){let a,d='<a href="https://blogs.nvidia.com/blog/2020/05/14/tensorfloat-32-precision-format/" rel="nofollow">TensorFloat-32 (tf32)</a> mode is supported on NVIDIA Ampere GPUs and it computes the convolution and matrix multiplication operations in tf32. Storage and other operations are kept in float32. This enables significantly faster computations when combined with bfloat16 or float16.',o,c,T="PyTorch only enables tf32 mode for convolutions by default and you’ll need to explicitly enable it for matrix multiplications.",r,p,g,U,G='Refer to the <a href="https://huggingface.co/docs/transformers/en/perf_train_gpu_one#mixed-precision" rel="nofollow">mixed precision training</a> docs for more details.',W;return p=new _({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXRvcmNoLmJhY2tlbmRzLmN1ZGEubWF0bXVsLmFsbG93X3RmMzIlMjAlM0QlMjBUcnVlJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkFzdHJvbmF1dCUyMGluJTIwYSUyMGp1bmdsZSUyQyUyMGNvbGQlMjBjb2xvciUyMHBhbGV0dGUlMkMlMjBtdXRlZCUyMGNvbG9ycyUyQyUyMGRldGFpbGVkJTJDJTIwOGslMjIlMEFwaXBlbGluZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzApLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

torch.backends.cuda.matmul.allow_tf32 = <span class="hljs-literal">True</span>

pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){a=m("p"),a.innerHTML=d,o=s(),c=m("p"),c.textContent=T,r=s(),h(p.$$.fragment),g=s(),U=m("p"),U.innerHTML=G},l(J){a=f(J,"P",{"data-svelte-h":!0}),u(a)!=="svelte-1sdg1x4"&&(a.innerHTML=d),o=i(J),c=f(J,"P",{"data-svelte-h":!0}),u(c)!=="svelte-13cgegp"&&(c.textContent=T),r=i(J),b(p.$$.fragment,J),g=i(J),U=f(J,"P",{"data-svelte-h":!0}),u(U)!=="svelte-uy7wpj"&&(U.innerHTML=G)},m(J,Z){n(J,a,Z),n(J,o,Z),n(J,c,Z),n(J,r,Z),y(p,J,Z),n(J,g,Z),n(J,U,Z),W=!0},p:$e,i(J){W||(M(p.$$.fragment,J),W=!0)},o(J){w(p.$$.fragment,J),W=!1},d(J){J&&(l(a),l(o),l(c),l(r),l(g),l(U)),$(p,J)}}}function el(j){let a,d,o,c,T,r;return a=new dt({props:{id:"dtypes",option:"bfloat16",$$slots:{default:[Dt]},$$scope:{ctx:j}}}),o=new dt({props:{id:"dtypes",option:"float16",$$slots:{default:[Kt]},$$scope:{ctx:j}}}),T=new dt({props:{id:"dtypes",option:"TensorFloat-32",$$slots:{default:[Ot]},$$scope:{ctx:j}}}),{c(){h(a.$$.fragment),d=s(),h(o.$$.fragment),c=s(),h(T.$$.fragment)},l(p){b(a.$$.fragment,p),d=i(p),b(o.$$.fragment,p),c=i(p),b(T.$$.fragment,p)},m(p,g){y(a,p,g),n(p,d,g),y(o,p,g),n(p,c,g),y(T,p,g),r=!0},p(p,g){const U={};g&2&&(U.$$scope={dirty:g,ctx:p}),a.$set(U);const G={};g&2&&(G.$$scope={dirty:g,ctx:p}),o.$set(G);const W={};g&2&&(W.$$scope={dirty:g,ctx:p}),T.$set(W)},i(p){r||(M(a.$$.fragment,p),M(o.$$.fragment,p),M(T.$$.fragment,p),r=!0)},o(p){w(a.$$.fragment,p),w(o.$$.fragment,p),w(T.$$.fragment,p),r=!1},d(p){p&&(l(d),l(c)),$(a,p),$(o,p),$(T,p)}}}function tl(j){let a,d='Memory-efficient attention optimizes for inference speed <em>and</em> <a href="./memory#memory-efficient-attention">memory usage</a>!';return{c(){a=m("p"),a.innerHTML=d},l(o){a=f(o,"P",{"data-svelte-h":!0}),u(a)!=="svelte-nfsjqr"&&(a.innerHTML=d)},m(o,c){n(o,a,c)},p:$e,d(o){o&&l(a)}}}function ll(j){let a,d='With PyTorch 2.3.1, you can control the caching behavior of torch.compile. This is particularly beneficial for compilation modes like <code>&quot;max-autotune&quot;</code> which performs a grid-search over several compilation flags to find the optimal configuration. Learn more in the <a href="https://pytorch.org/tutorials/recipes/torch_compile_caching_tutorial.html" rel="nofollow">Compile Time Caching in torch.compile</a> tutorial.';return{c(){a=m("p"),a.innerHTML=d},l(o){a=f(o,"P",{"data-svelte-h":!0}),u(a)!=="svelte-1a730av"&&(a.innerHTML=d)},m(o,c){n(o,a,c)},p:$e,d(o){o&&l(a)}}}function nl(j){let a,d='Refer to our <a href="../quantization/torchao">torchao</a> docs to learn more about how to use the Diffusers torchao integration.';return{c(){a=m("p"),a.innerHTML=d},l(o){a=f(o,"P",{"data-svelte-h":!0}),u(a)!=="svelte-1h2qhs5"&&(a.innerHTML=d)},m(o,c){n(o,a,c)},p:$e,d(o){o&&l(a)}}}function al(j){let a,d='The <a href="https://github.com/huggingface/diffusers/blob/58431f102cf39c3c8a569f32d71b2ea8caa461e1/src/diffusers/pipelines/pipeline_utils.py#L2034" rel="nofollow">fuse_qkv_projections</a> method is experimental and support is limited to mostly Stable Diffusion pipelines. Take a look at this <a href="https://github.com/huggingface/diffusers/pull/6179" rel="nofollow">PR</a> to learn more about how to enable it for other pipelines';return{c(){a=m("p"),a.innerHTML=d},l(o){a=f(o,"P",{"data-svelte-h":!0}),u(a)!=="svelte-o2jj7j"&&(a.innerHTML=d)},m(o,c){n(o,a,c)},p:$e,d(o){o&&l(a)}}}function sl(j){let a,d,o,c,T,r,p,g='Diffusion models are slow at inference because generation is an iterative process where noise is gradually refined into an image or video over a certain number of “steps”. To speedup this process, you can try experimenting with different <a href="../api/schedulers/overview">schedulers</a>, reduce the precision of the model weights for faster computations, use more memory-efficient attention mechanisms, and more.',U,G,W="Combine and use these techniques together to make inference faster than using any single technique on its own.",J,Z,ht="This guide will go over how to accelerate inference.",Je,R,ge,I,bt="The precision and data type of the model weights affect inference speed because a higher precision requires more memory to load and more time to perform the computations. PyTorch loads model weights in float32 or full precision by default, so changing the data type is a simple way to quickly get faster inference.",je,k,Ue,V,Ze,x,Ge,N,yt='<a href="https://pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow">Scaled dot product attention (SDPA)</a> implements several attention backends, <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow">FlashAttention</a>, <a href="https://github.com/facebookresearch/xformers" rel="nofollow">xFormers</a>, and a native C++ implementation. It automatically selects the most optimal backend for your hardware.',_e,H,Mt='SDPA is enabled by default if you’re using PyTorch &gt;= 2.0 and no additional changes are required to your code. You could try experimenting with other attention backends though if you’d like to choose your own. The example below uses the <a href="https://pytorch.org/docs/stable/generated/torch.nn.attention.sdpa_kernel.html" rel="nofollow">torch.nn.attention.sdpa_kernel</a> context manager to enable efficient attention.',We,L,ve,z,ke,F,wt='<a href="https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html" rel="nofollow">torch.compile</a> accelerates inference by compiling PyTorch code and operations into optimized kernels. Diffusers typically compiles the more compute-intensive models like the UNet, transformer, or VAE.',xe,Y,$t='Enable the following compiler settings for maximum speed (refer to the <a href="https://github.com/pytorch/pytorch/blob/main/torch/_inductor/config.py" rel="nofollow">full list</a> for more options).',Be,E,Ce,S,Tt="Load and compile the UNet and VAE. There are several different modes you can choose from, but <code>&quot;max-autotune&quot;</code> optimizes for the fastest speed by compiling to a CUDA graph. CUDA graphs effectively reduces the overhead by launching multiple GPU operations through a single CPU operation.",Xe,B,Re,Q,Jt='Changing the memory layout to <a href="./memory#torchchannels_last">channels_last</a> also optimizes memory and inference speed.',Ie,q,Ve,A,gt="Compilation is slow the first time, but once compiled, it is significantly faster. Try to only use the compiled pipeline on the same type of inference operations. Calling the compiled pipeline on a different image size retriggers compilation which is slow and inefficient.",Ne,P,He,D,jt='<a href="https://docs.pytorch.org/tutorials/recipes/regional_compilation.html" rel="nofollow">Regional compilation</a> reduces the cold start compilation time by only compiling a specific repeated region (or block) of the model instead of the entire model. The compiler reuses the cached and compiled code for the other blocks.',Le,K,Ut='<a href="https://huggingface.co/docs/accelerate/index" rel="nofollow">Accelerate</a> provides the <a href="https://github.com/huggingface/accelerate/blob/273799c85d849a1954a4f2e65767216eb37fa089/src/accelerate/utils/other.py#L78" rel="nofollow">compile_regions</a> method for automatically compiling the repeated blocks of a <code>nn.Module</code> sequentially. The rest of the model is compiled separately.',ze,O,Fe,ee,Ye,te,Zt="It is important to specify <code>fullgraph=True</code> in torch.compile to ensure there are no graph breaks in the underlying model. This allows you to take advantage of torch.compile without any performance degradation. For the UNet and VAE, this changes how you access the return variables.",Ee,le,Se,ne,Qe,ae,Gt='The <code>step()</code> function is <a href="https://github.com/huggingface/diffusers/blob/1d686bac8146037e97f3fd8c56e4063230f71751/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L1228" rel="nofollow">called</a> on the scheduler each time after the denoiser makes a prediction, and the <code>sigmas</code> variable is <a href="https://github.com/huggingface/diffusers/blob/1d686bac8146037e97f3fd8c56e4063230f71751/src/diffusers/schedulers/scheduling_euler_discrete.py#L476" rel="nofollow">indexed</a>. When placed on the GPU, it introduces latency because of the communication sync between the CPU and GPU. It becomes more evident when the denoiser has already been compiled.',qe,se,_t='In general, the <code>sigmas</code> should <a href="https://github.com/huggingface/diffusers/blob/35a969d297cba69110d175ee79c59312b9f49e1e/src/diffusers/schedulers/scheduling_euler_discrete.py#L240" rel="nofollow">stay on the CPU</a> to avoid the communication sync and latency.',Ae,ie,Pe,oe,Wt='Refer to the <a href="https://huggingface.co/datasets/diffusers/benchmarks" rel="nofollow">diffusers/benchmarks</a> dataset to see inference latency and memory usage data for compiled pipelines.',De,pe,vt='The <a href="https://github.com/sayakpaul/diffusers-torchao#benchmarking-results" rel="nofollow">diffusers-torchao</a> repository also contains benchmarking results for compiled versions of Flux and CogVideoX.',Ke,re,Oe,ce,kt='<a href="https://pytorch.org/tutorials/recipes/recipes/dynamic_quantization.html" rel="nofollow">Dynamic quantization</a> improves inference speed by reducing precision to enable faster math operations. This particular type of quantization determines how to scale the activations based on the data at runtime rather than using a fixed scaling factor. As a result, the scaling factor is more accurately aligned with the data.',et,me,xt='The example below applies <a href="https://pytorch.org/tutorials/recipes/recipes/dynamic_quantization.html" rel="nofollow">dynamic int8 quantization</a> to the UNet and VAE with the <a href="../quantization/torchao">torchao</a> library.',tt,C,lt,fe,Bt="Configure the compiler tags for maximum speed.",nt,ue,at,de,Ct='Filter out some linear layers in the UNet and VAE which don’t benefit from dynamic quantization with the <a href="https://github.com/huggingface/diffusion-fast/blob/0f169640b1db106fe6a479f78c1ed3bfaeba3386/utils/pipeline_utils.py#L16" rel="nofollow">dynamic_quant_filter_fn</a>.',st,he,it,be,ot,X,pt,ye,Xt="An input is projected into three subspaces, represented by the projection matrices Q, K, and V, in an attention block. These projections are typically calculated separately, but you can horizontally combine these into a single matrix and perform the projection in a single step. It increases the size of the matrix multiplications of the input projections and also improves the impact of quantization.",rt,Me,ct,we,mt,Te,ft;return T=new v({props:{title:"Accelerate inference",local:"accelerate-inference",headingTag:"h1"}}),R=new v({props:{title:"Model data type",local:"model-data-type",headingTag:"h2"}}),k=new Pt({props:{id:"dtypes",options:["bfloat16","float16","TensorFloat-32"],$$slots:{default:[el]},$$scope:{ctx:j}}}),V=new v({props:{title:"Scaled dot product attention",local:"scaled-dot-product-attention",headingTag:"h2"}}),x=new ut({props:{warning:!1,$$slots:{default:[tl]},$$scope:{ctx:j}}}),L=new _({props:{code:"ZnJvbSUyMHRvcmNoLm5uLmF0dGVudGlvbiUyMGltcG9ydCUyMFNEUEJhY2tlbmQlMkMlMjBzZHBhX2tlcm5lbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQXN0cm9uYXV0JTIwaW4lMjBhJTIwanVuZ2xlJTJDJTIwY29sZCUyMGNvbG9yJTIwcGFsZXR0ZSUyQyUyMG11dGVkJTIwY29sb3JzJTJDJTIwZGV0YWlsZWQlMkMlMjA4ayUyMiUwQSUwQXdpdGglMjBzZHBhX2tlcm5lbChTRFBCYWNrZW5kLkVGRklDSUVOVF9BVFRFTlRJT04pJTNBJTBBJTIwJTIwaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzApLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> torch.nn.attention <span class="hljs-keyword">import</span> SDPBackend, sdpa_kernel
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>

<span class="hljs-keyword">with</span> sdpa_kernel(SDPBackend.EFFICIENT_ATTENTION):
  image = pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),z=new v({props:{title:"torch.compile",local:"torchcompile",headingTag:"h2"}}),E=new _({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXRvcmNoLl9pbmR1Y3Rvci5jb25maWcuY29udl8xeDFfYXNfbW0lMjAlM0QlMjBUcnVlJTBBdG9yY2guX2luZHVjdG9yLmNvbmZpZy5jb29yZGluYXRlX2Rlc2NlbnRfdHVuaW5nJTIwJTNEJTIwVHJ1ZSUwQXRvcmNoLl9pbmR1Y3Rvci5jb25maWcuZXBpbG9ndWVfZnVzaW9uJTIwJTNEJTIwRmFsc2UlMEF0b3JjaC5faW5kdWN0b3IuY29uZmlnLmNvb3JkaW5hdGVfZGVzY2VudF9jaGVja19hbGxfZGlyZWN0aW9ucyUyMCUzRCUyMFRydWU=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

torch._inductor.config.conv_1x1_as_mm = <span class="hljs-literal">True</span>
torch._inductor.config.coordinate_descent_tuning = <span class="hljs-literal">True</span>
torch._inductor.config.epilogue_fusion = <span class="hljs-literal">False</span>
torch._inductor.config.coordinate_descent_check_all_directions = <span class="hljs-literal">True</span>`,wrap:!1}}),B=new ut({props:{warning:!1,$$slots:{default:[ll]},$$scope:{ctx:j}}}),q=new _({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZWxpbmUudW5ldC50byhtZW1vcnlfZm9ybWF0JTNEdG9yY2guY2hhbm5lbHNfbGFzdCklMEFwaXBlbGluZS52YWUudG8obWVtb3J5X2Zvcm1hdCUzRHRvcmNoLmNoYW5uZWxzX2xhc3QpJTBBcGlwZWxpbmUudW5ldCUyMCUzRCUyMHRvcmNoLmNvbXBpbGUoJTBBJTIwJTIwJTIwJTIwcGlwZWxpbmUudW5ldCUyQyUyMG1vZGUlM0QlMjJtYXgtYXV0b3R1bmUlMjIlMkMlMjBmdWxsZ3JhcGglM0RUcnVlJTBBKSUwQXBpcGVsaW5lLnZhZS5kZWNvZGUlMjAlM0QlMjB0b3JjaC5jb21waWxlKCUwQSUyMCUyMCUyMCUyMHBpcGVsaW5lLnZhZS5kZWNvZGUlMkMlMEElMjAlMjAlMjAlMjBtb2RlJTNEJTIybWF4LWF1dG90dW5lJTIyJTJDJTBBJTIwJTIwJTIwJTIwZnVsbGdyYXBoJTNEVHJ1ZSUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBc3Ryb25hdXQlMjBpbiUyMGElMjBqdW5nbGUlMkMlMjBjb2xkJTIwY29sb3IlMjBwYWxldHRlJTJDJTIwbXV0ZWQlMjBjb2xvcnMlMkMlMjBkZXRhaWxlZCUyQyUyMDhrJTIyJTBBcGlwZWxpbmUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDMwKS5pbWFnZXMlNUIwJTVE",highlighted:`pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline.unet.to(memory_format=torch.channels_last)
pipeline.vae.to(memory_format=torch.channels_last)
pipeline.unet = torch.<span class="hljs-built_in">compile</span>(
    pipeline.unet, mode=<span class="hljs-string">&quot;max-autotune&quot;</span>, fullgraph=<span class="hljs-literal">True</span>
)
pipeline.vae.decode = torch.<span class="hljs-built_in">compile</span>(
    pipeline.vae.decode,
    mode=<span class="hljs-string">&quot;max-autotune&quot;</span>,
    fullgraph=<span class="hljs-literal">True</span>
)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),P=new v({props:{title:"Regional compilation",local:"regional-compilation",headingTag:"h3"}}),O=new _({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMC1VJTIwYWNjZWxlcmF0ZSUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEFmcm9tJTIwYWNjZWxlcmF0ZS51dGlscyUyMGltcG9ydCUyMGNvbXBpbGUlMjByZWdpb25zJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZWxpbmUudW5ldCUyMCUzRCUyMGNvbXBpbGVfcmVnaW9ucyhwaXBlbGluZS51bmV0JTJDJTIwbW9kZSUzRCUyMnJlZHVjZS1vdmVyaGVhZCUyMiUyQyUyMGZ1bGxncmFwaCUzRFRydWUp",highlighted:`<span class="hljs-comment"># pip install -U accelerate</span>
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> <span class="hljs-built_in">compile</span> regions

pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline.unet = compile_regions(pipeline.unet, mode=<span class="hljs-string">&quot;reduce-overhead&quot;</span>, fullgraph=<span class="hljs-literal">True</span>)`,wrap:!1}}),ee=new v({props:{title:"Graph breaks",local:"graph-breaks",headingTag:"h3"}}),le=new _({props:{code:"LSUyMGxhdGVudHMlMjAlM0QlMjB1bmV0KCUwQS0lMjAlMjAlMjBsYXRlbnRzJTJDJTIwdGltZXN0ZXAlM0R0aW1lc3RlcCUyQyUyMGVuY29kZXJfaGlkZGVuX3N0YXRlcyUzRHByb21wdF9lbWJlZHMlMEEtKS5zYW1wbGUlMEElMEElMkIlMjBsYXRlbnRzJTIwJTNEJTIwdW5ldCglMEElMkIlMjAlMjAlMjBsYXRlbnRzJTJDJTIwdGltZXN0ZXAlM0R0aW1lc3RlcCUyQyUyMGVuY29kZXJfaGlkZGVuX3N0YXRlcyUzRHByb21wdF9lbWJlZHMlMkMlMjByZXR1cm5fZGljdCUzREZhbHNlJTBBJTJCKSU1QjAlNUQ=",highlighted:`<span class="hljs-deletion">- latents = unet(</span>
<span class="hljs-deletion">-   latents, timestep=timestep, encoder_hidden_states=prompt_embeds</span>
<span class="hljs-deletion">-).sample</span>

<span class="hljs-addition">+ latents = unet(</span>
<span class="hljs-addition">+   latents, timestep=timestep, encoder_hidden_states=prompt_embeds, return_dict=False</span>
<span class="hljs-addition">+)[0]</span>`,wrap:!1}}),ne=new v({props:{title:"GPU sync",local:"gpu-sync",headingTag:"h3"}}),ie=new v({props:{title:"Benchmarks",local:"benchmarks",headingTag:"h3"}}),re=new v({props:{title:"Dynamic quantization",local:"dynamic-quantization",headingTag:"h2"}}),C=new ut({props:{warning:!1,$$slots:{default:[nl]},$$scope:{ctx:j}}}),ue=new _({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2hhbyUyMGltcG9ydCUyMGFwcGx5X2R5bmFtaWNfcXVhbnQlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXRvcmNoLl9pbmR1Y3Rvci5jb25maWcuY29udl8xeDFfYXNfbW0lMjAlM0QlMjBUcnVlJTBBdG9yY2guX2luZHVjdG9yLmNvbmZpZy5jb29yZGluYXRlX2Rlc2NlbnRfdHVuaW5nJTIwJTNEJTIwVHJ1ZSUwQXRvcmNoLl9pbmR1Y3Rvci5jb25maWcuZXBpbG9ndWVfZnVzaW9uJTIwJTNEJTIwRmFsc2UlMEF0b3JjaC5faW5kdWN0b3IuY29uZmlnLmNvb3JkaW5hdGVfZGVzY2VudF9jaGVja19hbGxfZGlyZWN0aW9ucyUyMCUzRCUyMFRydWUlMEF0b3JjaC5faW5kdWN0b3IuY29uZmlnLmZvcmNlX2Z1c2VfaW50X21tX3dpdGhfbXVsJTIwJTNEJTIwVHJ1ZSUwQXRvcmNoLl9pbmR1Y3Rvci5jb25maWcudXNlX21peGVkX21tJTIwJTNEJTIwVHJ1ZQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> torchao <span class="hljs-keyword">import</span> apply_dynamic_quant
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

torch._inductor.config.conv_1x1_as_mm = <span class="hljs-literal">True</span>
torch._inductor.config.coordinate_descent_tuning = <span class="hljs-literal">True</span>
torch._inductor.config.epilogue_fusion = <span class="hljs-literal">False</span>
torch._inductor.config.coordinate_descent_check_all_directions = <span class="hljs-literal">True</span>
torch._inductor.config.force_fuse_int_mm_with_mul = <span class="hljs-literal">True</span>
torch._inductor.config.use_mixed_mm = <span class="hljs-literal">True</span>`,wrap:!1}}),he=new _({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKSUwQSUwQWFwcGx5X2R5bmFtaWNfcXVhbnQocGlwZWxpbmUudW5ldCUyQyUyMGR5bmFtaWNfcXVhbnRfZmlsdGVyX2ZuKSUwQWFwcGx5X2R5bmFtaWNfcXVhbnQocGlwZWxpbmUudmFlJTJDJTIwZHluYW1pY19xdWFudF9maWx0ZXJfZm4pJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQXN0cm9uYXV0JTIwaW4lMjBhJTIwanVuZ2xlJTJDJTIwY29sZCUyMGNvbG9yJTIwcGFsZXR0ZSUyQyUyMG11dGVkJTIwY29sb3JzJTJDJTIwZGV0YWlsZWQlMkMlMjA4ayUyMiUwQXBpcGVsaW5lKHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCkuaW1hZ2VzJTVCMCU1RA==",highlighted:`pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

apply_dynamic_quant(pipeline.unet, dynamic_quant_filter_fn)
apply_dynamic_quant(pipeline.vae, dynamic_quant_filter_fn)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),be=new v({props:{title:"Fused projection matrices",local:"fused-projection-matrices",headingTag:"h2"}}),X=new ut({props:{warning:!0,$$slots:{default:[al]},$$scope:{ctx:j}}}),Me=new _({props:{code:"cGlwZWxpbmUuZnVzZV9xa3ZfcHJvamVjdGlvbnMoKQ==",highlighted:"pipeline.fuse_qkv_projections()",wrap:!1}}),we=new At({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/optimization/fp16.md"}}),{c(){a=m("meta"),d=s(),o=m("p"),c=s(),h(T.$$.fragment),r=s(),p=m("p"),p.innerHTML=g,U=s(),G=m("p"),G.textContent=W,J=s(),Z=m("p"),Z.textContent=ht,Je=s(),h(R.$$.fragment),ge=s(),I=m("p"),I.textContent=bt,je=s(),h(k.$$.fragment),Ue=s(),h(V.$$.fragment),Ze=s(),h(x.$$.fragment),Ge=s(),N=m("p"),N.innerHTML=yt,_e=s(),H=m("p"),H.innerHTML=Mt,We=s(),h(L.$$.fragment),ve=s(),h(z.$$.fragment),ke=s(),F=m("p"),F.innerHTML=wt,xe=s(),Y=m("p"),Y.innerHTML=$t,Be=s(),h(E.$$.fragment),Ce=s(),S=m("p"),S.innerHTML=Tt,Xe=s(),h(B.$$.fragment),Re=s(),Q=m("p"),Q.innerHTML=Jt,Ie=s(),h(q.$$.fragment),Ve=s(),A=m("p"),A.textContent=gt,Ne=s(),h(P.$$.fragment),He=s(),D=m("p"),D.innerHTML=jt,Le=s(),K=m("p"),K.innerHTML=Ut,ze=s(),h(O.$$.fragment),Fe=s(),h(ee.$$.fragment),Ye=s(),te=m("p"),te.innerHTML=Zt,Ee=s(),h(le.$$.fragment),Se=s(),h(ne.$$.fragment),Qe=s(),ae=m("p"),ae.innerHTML=Gt,qe=s(),se=m("p"),se.innerHTML=_t,Ae=s(),h(ie.$$.fragment),Pe=s(),oe=m("p"),oe.innerHTML=Wt,De=s(),pe=m("p"),pe.innerHTML=vt,Ke=s(),h(re.$$.fragment),Oe=s(),ce=m("p"),ce.innerHTML=kt,et=s(),me=m("p"),me.innerHTML=xt,tt=s(),h(C.$$.fragment),lt=s(),fe=m("p"),fe.textContent=Bt,nt=s(),h(ue.$$.fragment),at=s(),de=m("p"),de.innerHTML=Ct,st=s(),h(he.$$.fragment),it=s(),h(be.$$.fragment),ot=s(),h(X.$$.fragment),pt=s(),ye=m("p"),ye.textContent=Xt,rt=s(),h(Me.$$.fragment),ct=s(),h(we.$$.fragment),mt=s(),Te=m("p"),this.h()},l(e){const t=Qt("svelte-u9bgzb",document.head);a=f(t,"META",{name:!0,content:!0}),t.forEach(l),d=i(e),o=f(e,"P",{}),Lt(o).forEach(l),c=i(e),b(T.$$.fragment,e),r=i(e),p=f(e,"P",{"data-svelte-h":!0}),u(p)!=="svelte-1m782be"&&(p.innerHTML=g),U=i(e),G=f(e,"P",{"data-svelte-h":!0}),u(G)!=="svelte-wa2eaw"&&(G.textContent=W),J=i(e),Z=f(e,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-1cgitz1"&&(Z.textContent=ht),Je=i(e),b(R.$$.fragment,e),ge=i(e),I=f(e,"P",{"data-svelte-h":!0}),u(I)!=="svelte-18445ux"&&(I.textContent=bt),je=i(e),b(k.$$.fragment,e),Ue=i(e),b(V.$$.fragment,e),Ze=i(e),b(x.$$.fragment,e),Ge=i(e),N=f(e,"P",{"data-svelte-h":!0}),u(N)!=="svelte-zmbjuq"&&(N.innerHTML=yt),_e=i(e),H=f(e,"P",{"data-svelte-h":!0}),u(H)!=="svelte-5i9w75"&&(H.innerHTML=Mt),We=i(e),b(L.$$.fragment,e),ve=i(e),b(z.$$.fragment,e),ke=i(e),F=f(e,"P",{"data-svelte-h":!0}),u(F)!=="svelte-nqxvwk"&&(F.innerHTML=wt),xe=i(e),Y=f(e,"P",{"data-svelte-h":!0}),u(Y)!=="svelte-17o6ivw"&&(Y.innerHTML=$t),Be=i(e),b(E.$$.fragment,e),Ce=i(e),S=f(e,"P",{"data-svelte-h":!0}),u(S)!=="svelte-dwk3fl"&&(S.innerHTML=Tt),Xe=i(e),b(B.$$.fragment,e),Re=i(e),Q=f(e,"P",{"data-svelte-h":!0}),u(Q)!=="svelte-lm2asr"&&(Q.innerHTML=Jt),Ie=i(e),b(q.$$.fragment,e),Ve=i(e),A=f(e,"P",{"data-svelte-h":!0}),u(A)!=="svelte-1jdqgot"&&(A.textContent=gt),Ne=i(e),b(P.$$.fragment,e),He=i(e),D=f(e,"P",{"data-svelte-h":!0}),u(D)!=="svelte-x0t5m"&&(D.innerHTML=jt),Le=i(e),K=f(e,"P",{"data-svelte-h":!0}),u(K)!=="svelte-1bmymdu"&&(K.innerHTML=Ut),ze=i(e),b(O.$$.fragment,e),Fe=i(e),b(ee.$$.fragment,e),Ye=i(e),te=f(e,"P",{"data-svelte-h":!0}),u(te)!=="svelte-12tqltr"&&(te.innerHTML=Zt),Ee=i(e),b(le.$$.fragment,e),Se=i(e),b(ne.$$.fragment,e),Qe=i(e),ae=f(e,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-1gyzgx0"&&(ae.innerHTML=Gt),qe=i(e),se=f(e,"P",{"data-svelte-h":!0}),u(se)!=="svelte-13ty8ou"&&(se.innerHTML=_t),Ae=i(e),b(ie.$$.fragment,e),Pe=i(e),oe=f(e,"P",{"data-svelte-h":!0}),u(oe)!=="svelte-10dnlua"&&(oe.innerHTML=Wt),De=i(e),pe=f(e,"P",{"data-svelte-h":!0}),u(pe)!=="svelte-1kb6ks2"&&(pe.innerHTML=vt),Ke=i(e),b(re.$$.fragment,e),Oe=i(e),ce=f(e,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-13773d2"&&(ce.innerHTML=kt),et=i(e),me=f(e,"P",{"data-svelte-h":!0}),u(me)!=="svelte-1wm8cfw"&&(me.innerHTML=xt),tt=i(e),b(C.$$.fragment,e),lt=i(e),fe=f(e,"P",{"data-svelte-h":!0}),u(fe)!=="svelte-1rguzol"&&(fe.textContent=Bt),nt=i(e),b(ue.$$.fragment,e),at=i(e),de=f(e,"P",{"data-svelte-h":!0}),u(de)!=="svelte-applj5"&&(de.innerHTML=Ct),st=i(e),b(he.$$.fragment,e),it=i(e),b(be.$$.fragment,e),ot=i(e),b(X.$$.fragment,e),pt=i(e),ye=f(e,"P",{"data-svelte-h":!0}),u(ye)!=="svelte-1h88cib"&&(ye.textContent=Xt),rt=i(e),b(Me.$$.fragment,e),ct=i(e),b(we.$$.fragment,e),mt=i(e),Te=f(e,"P",{}),Lt(Te).forEach(l),this.h()},h(){zt(a,"name","hf:doc:metadata"),zt(a,"content",il)},m(e,t){qt(document.head,a),n(e,d,t),n(e,o,t),n(e,c,t),y(T,e,t),n(e,r,t),n(e,p,t),n(e,U,t),n(e,G,t),n(e,J,t),n(e,Z,t),n(e,Je,t),y(R,e,t),n(e,ge,t),n(e,I,t),n(e,je,t),y(k,e,t),n(e,Ue,t),y(V,e,t),n(e,Ze,t),y(x,e,t),n(e,Ge,t),n(e,N,t),n(e,_e,t),n(e,H,t),n(e,We,t),y(L,e,t),n(e,ve,t),y(z,e,t),n(e,ke,t),n(e,F,t),n(e,xe,t),n(e,Y,t),n(e,Be,t),y(E,e,t),n(e,Ce,t),n(e,S,t),n(e,Xe,t),y(B,e,t),n(e,Re,t),n(e,Q,t),n(e,Ie,t),y(q,e,t),n(e,Ve,t),n(e,A,t),n(e,Ne,t),y(P,e,t),n(e,He,t),n(e,D,t),n(e,Le,t),n(e,K,t),n(e,ze,t),y(O,e,t),n(e,Fe,t),y(ee,e,t),n(e,Ye,t),n(e,te,t),n(e,Ee,t),y(le,e,t),n(e,Se,t),y(ne,e,t),n(e,Qe,t),n(e,ae,t),n(e,qe,t),n(e,se,t),n(e,Ae,t),y(ie,e,t),n(e,Pe,t),n(e,oe,t),n(e,De,t),n(e,pe,t),n(e,Ke,t),y(re,e,t),n(e,Oe,t),n(e,ce,t),n(e,et,t),n(e,me,t),n(e,tt,t),y(C,e,t),n(e,lt,t),n(e,fe,t),n(e,nt,t),y(ue,e,t),n(e,at,t),n(e,de,t),n(e,st,t),y(he,e,t),n(e,it,t),y(be,e,t),n(e,ot,t),y(X,e,t),n(e,pt,t),n(e,ye,t),n(e,rt,t),y(Me,e,t),n(e,ct,t),y(we,e,t),n(e,mt,t),n(e,Te,t),ft=!0},p(e,[t]){const Rt={};t&2&&(Rt.$$scope={dirty:t,ctx:e}),k.$set(Rt);const It={};t&2&&(It.$$scope={dirty:t,ctx:e}),x.$set(It);const Vt={};t&2&&(Vt.$$scope={dirty:t,ctx:e}),B.$set(Vt);const Nt={};t&2&&(Nt.$$scope={dirty:t,ctx:e}),C.$set(Nt);const Ht={};t&2&&(Ht.$$scope={dirty:t,ctx:e}),X.$set(Ht)},i(e){ft||(M(T.$$.fragment,e),M(R.$$.fragment,e),M(k.$$.fragment,e),M(V.$$.fragment,e),M(x.$$.fragment,e),M(L.$$.fragment,e),M(z.$$.fragment,e),M(E.$$.fragment,e),M(B.$$.fragment,e),M(q.$$.fragment,e),M(P.$$.fragment,e),M(O.$$.fragment,e),M(ee.$$.fragment,e),M(le.$$.fragment,e),M(ne.$$.fragment,e),M(ie.$$.fragment,e),M(re.$$.fragment,e),M(C.$$.fragment,e),M(ue.$$.fragment,e),M(he.$$.fragment,e),M(be.$$.fragment,e),M(X.$$.fragment,e),M(Me.$$.fragment,e),M(we.$$.fragment,e),ft=!0)},o(e){w(T.$$.fragment,e),w(R.$$.fragment,e),w(k.$$.fragment,e),w(V.$$.fragment,e),w(x.$$.fragment,e),w(L.$$.fragment,e),w(z.$$.fragment,e),w(E.$$.fragment,e),w(B.$$.fragment,e),w(q.$$.fragment,e),w(P.$$.fragment,e),w(O.$$.fragment,e),w(ee.$$.fragment,e),w(le.$$.fragment,e),w(ne.$$.fragment,e),w(ie.$$.fragment,e),w(re.$$.fragment,e),w(C.$$.fragment,e),w(ue.$$.fragment,e),w(he.$$.fragment,e),w(be.$$.fragment,e),w(X.$$.fragment,e),w(Me.$$.fragment,e),w(we.$$.fragment,e),ft=!1},d(e){e&&(l(d),l(o),l(c),l(r),l(p),l(U),l(G),l(J),l(Z),l(Je),l(ge),l(I),l(je),l(Ue),l(Ze),l(Ge),l(N),l(_e),l(H),l(We),l(ve),l(ke),l(F),l(xe),l(Y),l(Be),l(Ce),l(S),l(Xe),l(Re),l(Q),l(Ie),l(Ve),l(A),l(Ne),l(He),l(D),l(Le),l(K),l(ze),l(Fe),l(Ye),l(te),l(Ee),l(Se),l(Qe),l(ae),l(qe),l(se),l(Ae),l(Pe),l(oe),l(De),l(pe),l(Ke),l(Oe),l(ce),l(et),l(me),l(tt),l(lt),l(fe),l(nt),l(at),l(de),l(st),l(it),l(ot),l(pt),l(ye),l(rt),l(ct),l(mt),l(Te)),l(a),$(T,e),$(R,e),$(k,e),$(V,e),$(x,e),$(L,e),$(z,e),$(E,e),$(B,e),$(q,e),$(P,e),$(O,e),$(ee,e),$(le,e),$(ne,e),$(ie,e),$(re,e),$(C,e),$(ue,e),$(he,e),$(be,e),$(X,e),$(Me,e),$(we,e)}}}const il='{"title":"Accelerate inference","local":"accelerate-inference","sections":[{"title":"Model data type","local":"model-data-type","sections":[],"depth":2},{"title":"Scaled dot product attention","local":"scaled-dot-product-attention","sections":[],"depth":2},{"title":"torch.compile","local":"torchcompile","sections":[{"title":"Regional compilation","local":"regional-compilation","sections":[],"depth":3},{"title":"Graph breaks","local":"graph-breaks","sections":[],"depth":3},{"title":"GPU sync","local":"gpu-sync","sections":[],"depth":3},{"title":"Benchmarks","local":"benchmarks","sections":[],"depth":3}],"depth":2},{"title":"Dynamic quantization","local":"dynamic-quantization","sections":[],"depth":2},{"title":"Fused projection matrices","local":"fused-projection-matrices","sections":[],"depth":2}],"depth":1}';function ol(j){return Yt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dl extends Et{constructor(a){super(),St(this,a,ol,sl,Ft,{})}}export{dl as component};
