import{S as Il,i as $l,s as Pl,e as a,k as c,w as g,t as i,M as Vl,c as n,d as s,m as u,a as r,x as J,h as o,b as h,G as t,g as p,y as T,q as U,o as Z,B as _,v as Cl}from"../../chunks/vendor-hf-doc-builder.js";import{T as zt}from"../../chunks/Tip-hf-doc-builder.js";import{I as ss}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Ie}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as Rl}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function Xl(Q){let d,v,m,y,B,M,E,j,G;return{c(){d=a("p"),v=i("\u{1F4A1} We strongly recommend reading PyTorch\u2019s "),m=a("a"),y=i("statement about reproducibility"),B=i(":"),M=c(),E=a("blockquote"),j=a("p"),G=i("Completely reproducible results are not guaranteed across PyTorch releases, individual commits, or different platforms. Furthermore, results may not be reproducible between CPU and GPU executions, even when using identical seeds."),this.h()},l(b){d=n(b,"P",{});var w=r(d);v=o(w,"\u{1F4A1} We strongly recommend reading PyTorch\u2019s "),m=n(w,"A",{href:!0,rel:!0});var k=r(m);y=o(k,"statement about reproducibility"),k.forEach(s),B=o(w,":"),w.forEach(s),M=u(b),E=n(b,"BLOCKQUOTE",{});var f=r(E);j=n(f,"P",{});var C=r(j);G=o(C,"Completely reproducible results are not guaranteed across PyTorch releases, individual commits, or different platforms. Furthermore, results may not be reproducible between CPU and GPU executions, even when using identical seeds."),C.forEach(s),f.forEach(s),this.h()},h(){h(m,"href","https://pytorch.org/docs/stable/notes/randomness.html"),h(m,"rel","nofollow")},m(b,w){p(b,d,w),t(d,v),t(d,m),t(m,y),t(d,B),p(b,M,w),p(b,E,w),t(E,j),t(j,G)},d(b){b&&s(d),b&&s(M),b&&s(E)}}}function Sl(Q){let d,v,m,y,B,M,E,j,G,b,w;return{c(){d=a("p"),v=i("\u{1F4A1} It might be a bit unintuitive at first to pass "),m=a("code"),y=i("Generator"),B=i(` objects to the pipeline instead of
just integer values representing the seed, but this is the recommended design when dealing with
probabilistic models in PyTorch as `),M=a("code"),E=i("Generator"),j=i("\u2019s are "),G=a("em"),b=i("random states"),w=i(` that can be
passed to multiple pipelines in a sequence.`)},l(k){d=n(k,"P",{});var f=r(d);v=o(f,"\u{1F4A1} It might be a bit unintuitive at first to pass "),m=n(f,"CODE",{});var C=r(m);y=o(C,"Generator"),C.forEach(s),B=o(f,` objects to the pipeline instead of
just integer values representing the seed, but this is the recommended design when dealing with
probabilistic models in PyTorch as `),M=n(f,"CODE",{});var R=r(M);E=o(R,"Generator"),R.forEach(s),j=o(f,"\u2019s are "),G=n(f,"EM",{});var ye=r(G);b=o(ye,"random states"),ye.forEach(s),w=o(f,` that can be
passed to multiple pipelines in a sequence.`),f.forEach(s)},m(k,f){p(k,d,f),t(d,v),t(d,m),t(m,y),t(d,B),t(d,M),t(M,E),t(d,j),t(d,G),t(G,b),t(d,w)},d(k){k&&s(d)}}}function Fl(Q){let d,v;return{c(){d=a("p"),v=i(`\u{1F4A1} If reproducibility is important, we recommend always passing a CPU generator.
The performance loss is often neglectable, and you\u2019ll generate much more similar
values than if the pipeline had been run on a GPU.`)},l(m){d=n(m,"P",{});var y=r(d);v=o(y,`\u{1F4A1} If reproducibility is important, we recommend always passing a CPU generator.
The performance loss is often neglectable, and you\u2019ll generate much more similar
values than if the pipeline had been run on a GPU.`),y.forEach(s)},m(m,y){p(m,d,y),t(d,v)},d(m){m&&s(d)}}}function Nl(Q){let d,v,m,y,B,M,E,j,G,b,w,k,f,C,R,ye,Qs,ts,be,zs,ls,z,as,X,H,$e,se,Hs,Pe,Ds,ns,we,As,rs,D,xs,Me,qs,Ys,is,te,os,ve,Ls,ps,A,Ks,le,Ve,Os,et,cs,je,st,us,S,x,Ce,ae,tt,Re,lt,ds,q,at,ne,Xe,nt,rt,hs,re,ms,I,it,Se,ot,pt,Fe,ct,ut,fs,ge,dt,ys,Y,bs,F,L,Ne,ie,ht,Qe,mt,ws,Je,ft,Ms,oe,vs,Te,yt,js,W,bt,Ue,wt,Mt,ze,vt,jt,He,gt,Jt,De,Tt,Ut,gs,Ze,Zt,Js,pe,Ts,K,Us,O,_t,_e,Et,Wt,Zs,N,ee,Ae,ce,Bt,xe,Gt,_s,Ee,kt,Es,$,It,ue,qe,$t,Pt,Ye,Vt,Ct,Ws,P,Rt,Le,Xt,St,de,Ke,Ft,Nt,Bs,he,Gs,We,Qt,ks,me,Is;return M=new ss({}),w=new Rl({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/reproducibility.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/reproducibility.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/reproducibility.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/reproducibility.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/reproducibility.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/reproducibility.ipynb"}]}}),z=new zt({props:{$$slots:{default:[Xl]},$$scope:{ctx:Q}}}),se=new ss({}),te=new Ie({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERESU1QaXBlbGluZSUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyJTBBJTBBJTIzJTIwbG9hZCUyMG1vZGVsJTIwYW5kJTIwc2NoZWR1bGVyJTBBZGRpbSUyMCUzRCUyMERESU1QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKSUwQSUwQSUyMyUyMHJ1biUyMHBpcGVsaW5lJTIwZm9yJTIwanVzdCUyMHR3byUyMHN0ZXBzJTIwYW5kJTIwcmV0dXJuJTIwbnVtcHklMjB0ZW5zb3IlMEFpbWFnZSUyMCUzRCUyMGRkaW0obnVtX2luZmVyZW5jZV9zdGVwcyUzRDIlMkMlMjBvdXRwdXRfdHlwZSUzRCUyMm5wJTIyKS5pbWFnZXMlMEFwcmludChucC5hYnMoaW1hZ2UpLnN1bSgpKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id, use_safetensors=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),ae=new ss({}),re=new Ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRERJTVBpcGVsaW5lJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMjBhbmQlMjBzY2hlZHVsZXIlMEFkZGltJTIwJTNEJTIwRERJTVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpJTBBJTBBJTIzJTIwY3JlYXRlJTIwYSUyMGdlbmVyYXRvciUyMGZvciUyMHJlcHJvZHVjaWJpbGl0eSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDApJTBBJTBBJTIzJTIwcnVuJTIwcGlwZWxpbmUlMjBmb3IlMjBqdXN0JTIwdHdvJTIwc3RlcHMlMjBhbmQlMjByZXR1cm4lMjBudW1weSUyMHRlbnNvciUwQWltYWdlJTIwJTNEJTIwZGRpbShudW1faW5mZXJlbmNlX3N0ZXBzJTNEMiUyQyUyMG91dHB1dF90eXBlJTNEJTIybnAlMjIlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IpLmltYWdlcyUwQXByaW50KG5wLmFicyhpbWFnZSkuc3VtKCkp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id, use_safetensors=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># create a generator for reproducibility</span>
generator = torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>, generator=generator).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),Y=new zt({props:{$$slots:{default:[Sl]},$$scope:{ctx:Q}}}),ie=new ss({}),oe=new Ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRERJTVBpcGVsaW5lJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMjBhbmQlMjBzY2hlZHVsZXIlMEFkZGltJTIwJTNEJTIwRERJTVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpJTBBZGRpbS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMGNyZWF0ZSUyMGElMjBnZW5lcmF0b3IlMjBmb3IlMjByZXByb2R1Y2liaWxpdHklMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3VkYSUyMikubWFudWFsX3NlZWQoMCklMEElMEElMjMlMjBydW4lMjBwaXBlbGluZSUyMGZvciUyMGp1c3QlMjB0d28lMjBzdGVwcyUyMGFuZCUyMHJldHVybiUyMG51bXB5JTIwdGVuc29yJTBBaW1hZ2UlMjAlM0QlMjBkZGltKG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyJTJDJTIwb3V0cHV0X3R5cGUlM0QlMjJucCUyMiUyQyUyMGdlbmVyYXRvciUzRGdlbmVyYXRvcikuaW1hZ2VzJTBBcHJpbnQobnAuYWJzKGltYWdlKS5zdW0oKSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id, use_safetensors=<span class="hljs-literal">True</span>)
ddim.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># create a generator for reproducibility</span>
generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>, generator=generator).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),pe=new Ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRERJTVBpcGVsaW5lJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMEElMEElMjMlMjBsb2FkJTIwbW9kZWwlMjBhbmQlMjBzY2hlZHVsZXIlMEFkZGltJTIwJTNEJTIwRERJTVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpJTBBZGRpbS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMGNyZWF0ZSUyMGElMjBnZW5lcmF0b3IlMjBmb3IlMjByZXByb2R1Y2liaWxpdHklM0IlMjBub3RpY2UlMjB5b3UlMjBkb24ndCUyMHBsYWNlJTIwaXQlMjBvbiUyMHRoZSUyMEdQVSElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5tYW51YWxfc2VlZCgwKSUwQSUwQSUyMyUyMHJ1biUyMHBpcGVsaW5lJTIwZm9yJTIwanVzdCUyMHR3byUyMHN0ZXBzJTIwYW5kJTIwcmV0dXJuJTIwbnVtcHklMjB0ZW5zb3IlMEFpbWFnZSUyMCUzRCUyMGRkaW0obnVtX2luZmVyZW5jZV9zdGVwcyUzRDIlMkMlMjBvdXRwdXRfdHlwZSUzRCUyMm5wJTIyJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yKS5pbWFnZXMlMEFwcmludChucC5hYnMoaW1hZ2UpLnN1bSgpKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>

<span class="hljs-comment"># load model and scheduler</span>
ddim = DDIMPipeline.from_pretrained(model_id, use_safetensors=<span class="hljs-literal">True</span>)
ddim.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># create a generator for reproducibility; notice you don&#x27;t place it on the GPU!</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-comment"># run pipeline for just two steps and return numpy tensor</span>
image = ddim(num_inference_steps=<span class="hljs-number">2</span>, output_type=<span class="hljs-string">&quot;np&quot;</span>, generator=generator).images
<span class="hljs-built_in">print</span>(np.<span class="hljs-built_in">abs</span>(image).<span class="hljs-built_in">sum</span>())`}}),K=new zt({props:{$$slots:{default:[Fl]},$$scope:{ctx:Q}}}),ce=new ss({}),he=new Ie({props:{code:"aW1wb3J0JTIwb3MlMEElMEFvcy5lbnZpcm9uJTVCJTIyQ1VCTEFTX1dPUktTUEFDRV9DT05GSUclMjIlNUQlMjAlM0QlMjAlMjIlM0ExNiUzQTglMjIlMEElMEF0b3JjaC5iYWNrZW5kcy5jdWRubi5iZW5jaG1hcmslMjAlM0QlMjBGYWxzZSUwQXRvcmNoLnVzZV9kZXRlcm1pbmlzdGljX2FsZ29yaXRobXMoVHJ1ZSk=",highlighted:`<span class="hljs-keyword">import</span> os

os.environ[<span class="hljs-string">&quot;CUBLAS_WORKSPACE_CONFIG&quot;</span>] = <span class="hljs-string">&quot;:16:8&quot;</span>

torch.backends.cudnn.benchmark = <span class="hljs-literal">False</span>
torch.use_deterministic_algorithms(<span class="hljs-literal">True</span>)`}}),me=new Ie({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRERJTVNjaGVkdWxlciUyQyUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKS50byglMjJjdWRhJTIyKSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBZyUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBiZWFyJTIwaXMlMjBwbGF5aW5nJTIwYSUyMGd1aXRhciUyMG9uJTIwVGltZXMlMjBTcXVhcmUlMjIlMEElMEFnLm1hbnVhbF9zZWVkKDApJTBBcmVzdWx0MSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTIwZ2VuZXJhdG9yJTNEZyUyQyUyMG91dHB1dF90eXBlJTNEJTIybGF0ZW50JTIyKS5pbWFnZXMlMEElMEFnLm1hbnVhbF9zZWVkKDApJTBBcmVzdWx0MiUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTIwZ2VuZXJhdG9yJTNEZyUyQyUyMG91dHB1dF90eXBlJTNEJTIybGF0ZW50JTIyKS5pbWFnZXMlMEElMEFwcmludCglMjJMX2luZiUyMGRpc3QlMjAlM0QlMjAlMjIlMkMlMjBhYnMocmVzdWx0MSUyMC0lMjByZXN1bHQyKS5tYXgoKSklMEElMjJMX2luZiUyMGRpc3QlMjAlM0QlMjAlMjB0ZW5zb3IoMC4lMkMlMjBkZXZpY2UlM0QnY3VkYSUzQTAnKSUyMg==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMScheduler, StableDiffusionPipeline
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
g = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A bear is playing a guitar on Times Square&quot;</span>

g.manual_seed(<span class="hljs-number">0</span>)
result1 = pipe(prompt=prompt, num_inference_steps=<span class="hljs-number">50</span>, generator=g, output_type=<span class="hljs-string">&quot;latent&quot;</span>).images

g.manual_seed(<span class="hljs-number">0</span>)
result2 = pipe(prompt=prompt, num_inference_steps=<span class="hljs-number">50</span>, generator=g, output_type=<span class="hljs-string">&quot;latent&quot;</span>).images

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;L_inf dist = &quot;</span>, <span class="hljs-built_in">abs</span>(result1 - result2).<span class="hljs-built_in">max</span>())
<span class="hljs-string">&quot;L_inf dist =  tensor(0., device=&#x27;cuda:0&#x27;)&quot;</span>`}}),{c(){d=a("meta"),v=c(),m=a("h1"),y=a("a"),B=a("span"),g(M.$$.fragment),E=c(),j=a("span"),G=i("Create reproducible pipelines"),b=c(),g(w.$$.fragment),k=c(),f=a("p"),C=i("Reproducibility is important for testing, replicating results, and can even be used to "),R=a("a"),ye=i("improve image quality"),Qs=i(". However, the randomness in diffusion models is a desired property because it allows the pipeline to generate different images every time it is run. While you can\u2019t expect to get the exact same results across platforms, you can expect results to be reproducible across releases and platforms within a certain tolerance range. Even then, tolerance varies depending on the diffusion pipeline and checkpoint."),ts=c(),be=a("p"),zs=i("This is why it\u2019s important to understand how to control sources of randomness in diffusion models or use deterministic algorithms."),ls=c(),g(z.$$.fragment),as=c(),X=a("h2"),H=a("a"),$e=a("span"),g(se.$$.fragment),Hs=c(),Pe=a("span"),Ds=i("Control randomness"),ns=c(),we=a("p"),As=i(`During inference, pipelines rely heavily on random sampling operations which include creating the
Gaussian noise tensors to denoise and adding noise to the scheduling step.`),rs=c(),D=a("p"),xs=i("Take a look at the tensor values in the "),Me=a("a"),qs=i("DDIMPipeline"),Ys=i(" after two inference steps:"),is=c(),g(te.$$.fragment),os=c(),ve=a("p"),Ls=i("Running the code above prints one value, but if you run it again you get a different value. What is going on here?"),ps=c(),A=a("p"),Ks=i("Every time the pipeline is run, "),le=a("a"),Ve=a("code"),Os=i("torch.randn"),et=i(" uses a different random seed to create Gaussian noise which is denoised stepwise. This leads to a different result each time it is run, which is great for diffusion pipelines since it generates a different random image each time."),cs=c(),je=a("p"),st=i("But if you need to reliably generate the same image, that\u2019ll depend on whether you\u2019re running the pipeline on a CPU or GPU."),us=c(),S=a("h3"),x=a("a"),Ce=a("span"),g(ae.$$.fragment),tt=c(),Re=a("span"),lt=i("CPU"),ds=c(),q=a("p"),at=i("To generate reproducible results on a CPU, you\u2019ll need to use a PyTorch "),ne=a("a"),Xe=a("code"),nt=i("Generator"),rt=i(" and set a seed:"),hs=c(),g(re.$$.fragment),ms=c(),I=a("p"),it=i("Now when you run the code above, it always prints a value of "),Se=a("code"),ot=i("1491.1711"),pt=i(" no matter what because the "),Fe=a("code"),ct=i("Generator"),ut=i(" object with the seed is passed to all the random functions of the pipeline."),fs=c(),ge=a("p"),dt=i("If you run this code example on your specific hardware and PyTorch version, you should get a similar, if not the same, result."),ys=c(),g(Y.$$.fragment),bs=c(),F=a("h3"),L=a("a"),Ne=a("span"),g(ie.$$.fragment),ht=c(),Qe=a("span"),mt=i("GPU"),ws=c(),Je=a("p"),ft=i("Writing a reproducible pipeline on a GPU is a bit trickier, and full reproducibility across different hardware is not guaranteed because matrix multiplication - which diffusion pipelines require a lot of - is less deterministic on a GPU than a CPU. For example, if you run the same code example above on a GPU:"),Ms=c(),g(oe.$$.fragment),vs=c(),Te=a("p"),yt=i("The result is not the same even though you\u2019re using an identical seed because the GPU uses a different random number generator than the CPU."),js=c(),W=a("p"),bt=i("To circumvent this problem, \u{1F9E8} Diffusers has a "),Ue=a("a"),wt=i("randn_tensor()"),Mt=i(" function for creating random noise on the CPU, and then moving the tensor to a GPU if necessary. The "),ze=a("code"),vt=i("randn_tensor"),jt=i(" function is used everywhere inside the pipeline, allowing the user to "),He=a("strong"),gt=i("always"),Jt=i(" pass a CPU "),De=a("code"),Tt=i("Generator"),Ut=i(" even if the pipeline is run on a GPU."),gs=c(),Ze=a("p"),Zt=i("You\u2019ll see the results are much closer now!"),Js=c(),g(pe.$$.fragment),Ts=c(),g(K.$$.fragment),Us=c(),O=a("p"),_t=i("Finally, for more complex pipelines such as "),_e=a("a"),Et=i("UnCLIPPipeline"),Wt=i(`, these are often extremely
susceptible to precision error propagation. Don\u2019t expect similar results across
different GPU hardware or PyTorch versions. In this case, you\u2019ll need to run
exactly the same hardware and PyTorch version for full reproducibility.`),Zs=c(),N=a("h2"),ee=a("a"),Ae=a("span"),g(ce.$$.fragment),Bt=c(),xe=a("span"),Gt=i("Deterministic algorithms"),_s=c(),Ee=a("p"),kt=i("You can also configure PyTorch to use deterministic algorithms to create a reproducible pipeline. However, you should be aware that deterministic algorithms may be slower than nondeterministic ones and you may observe a decrease in performance. But if reproducibility is important to you, then this is the way to go!"),Es=c(),$=a("p"),It=i("Nondeterministic behavior occurs when operations are launched in more than one CUDA stream. To avoid this, set the environment varibale "),ue=a("a"),qe=a("code"),$t=i("CUBLAS_WORKSPACE_CONFIG"),Pt=i(" to "),Ye=a("code"),Vt=i(":16:8"),Ct=i(" to only use one buffer size during runtime."),Ws=c(),P=a("p"),Rt=i("PyTorch typically benchmarks multiple algorithms to select the fastest one, but if you want reproducibility, you should disable this feature because the benchmark may select different algorithms each time. Lastly, pass "),Le=a("code"),Xt=i("True"),St=i(" to "),de=a("a"),Ke=a("code"),Ft=i("torch.use_deterministic_algorithms"),Nt=i(" to enable deterministic algorithms."),Bs=c(),g(he.$$.fragment),Gs=c(),We=a("p"),Qt=i("Now when you run the same pipeline twice, you\u2019ll get identical results."),ks=c(),g(me.$$.fragment),this.h()},l(e){const l=Vl('[data-svelte="svelte-1phssyn"]',document.head);d=n(l,"META",{name:!0,content:!0}),l.forEach(s),v=u(e),m=n(e,"H1",{class:!0});var fe=r(m);y=n(fe,"A",{id:!0,class:!0,href:!0});var Oe=r(y);B=n(Oe,"SPAN",{});var es=r(B);J(M.$$.fragment,es),es.forEach(s),Oe.forEach(s),E=u(fe),j=n(fe,"SPAN",{});var Ht=r(j);G=o(Ht,"Create reproducible pipelines"),Ht.forEach(s),fe.forEach(s),b=u(e),J(w.$$.fragment,e),k=u(e),f=n(e,"P",{});var $s=r(f);C=o($s,"Reproducibility is important for testing, replicating results, and can even be used to "),R=n($s,"A",{href:!0});var Dt=r(R);ye=o(Dt,"improve image quality"),Dt.forEach(s),Qs=o($s,". However, the randomness in diffusion models is a desired property because it allows the pipeline to generate different images every time it is run. While you can\u2019t expect to get the exact same results across platforms, you can expect results to be reproducible across releases and platforms within a certain tolerance range. Even then, tolerance varies depending on the diffusion pipeline and checkpoint."),$s.forEach(s),ts=u(e),be=n(e,"P",{});var At=r(be);zs=o(At,"This is why it\u2019s important to understand how to control sources of randomness in diffusion models or use deterministic algorithms."),At.forEach(s),ls=u(e),J(z.$$.fragment,e),as=u(e),X=n(e,"H2",{class:!0});var Ps=r(X);H=n(Ps,"A",{id:!0,class:!0,href:!0});var xt=r(H);$e=n(xt,"SPAN",{});var qt=r($e);J(se.$$.fragment,qt),qt.forEach(s),xt.forEach(s),Hs=u(Ps),Pe=n(Ps,"SPAN",{});var Yt=r(Pe);Ds=o(Yt,"Control randomness"),Yt.forEach(s),Ps.forEach(s),ns=u(e),we=n(e,"P",{});var Lt=r(we);As=o(Lt,`During inference, pipelines rely heavily on random sampling operations which include creating the
Gaussian noise tensors to denoise and adding noise to the scheduling step.`),Lt.forEach(s),rs=u(e),D=n(e,"P",{});var Vs=r(D);xs=o(Vs,"Take a look at the tensor values in the "),Me=n(Vs,"A",{href:!0});var Kt=r(Me);qs=o(Kt,"DDIMPipeline"),Kt.forEach(s),Ys=o(Vs," after two inference steps:"),Vs.forEach(s),is=u(e),J(te.$$.fragment,e),os=u(e),ve=n(e,"P",{});var Ot=r(ve);Ls=o(Ot,"Running the code above prints one value, but if you run it again you get a different value. What is going on here?"),Ot.forEach(s),ps=u(e),A=n(e,"P",{});var Cs=r(A);Ks=o(Cs,"Every time the pipeline is run, "),le=n(Cs,"A",{href:!0,rel:!0});var el=r(le);Ve=n(el,"CODE",{});var sl=r(Ve);Os=o(sl,"torch.randn"),sl.forEach(s),el.forEach(s),et=o(Cs," uses a different random seed to create Gaussian noise which is denoised stepwise. This leads to a different result each time it is run, which is great for diffusion pipelines since it generates a different random image each time."),Cs.forEach(s),cs=u(e),je=n(e,"P",{});var tl=r(je);st=o(tl,"But if you need to reliably generate the same image, that\u2019ll depend on whether you\u2019re running the pipeline on a CPU or GPU."),tl.forEach(s),us=u(e),S=n(e,"H3",{class:!0});var Rs=r(S);x=n(Rs,"A",{id:!0,class:!0,href:!0});var ll=r(x);Ce=n(ll,"SPAN",{});var al=r(Ce);J(ae.$$.fragment,al),al.forEach(s),ll.forEach(s),tt=u(Rs),Re=n(Rs,"SPAN",{});var nl=r(Re);lt=o(nl,"CPU"),nl.forEach(s),Rs.forEach(s),ds=u(e),q=n(e,"P",{});var Xs=r(q);at=o(Xs,"To generate reproducible results on a CPU, you\u2019ll need to use a PyTorch "),ne=n(Xs,"A",{href:!0,rel:!0});var rl=r(ne);Xe=n(rl,"CODE",{});var il=r(Xe);nt=o(il,"Generator"),il.forEach(s),rl.forEach(s),rt=o(Xs," and set a seed:"),Xs.forEach(s),hs=u(e),J(re.$$.fragment,e),ms=u(e),I=n(e,"P",{});var Be=r(I);it=o(Be,"Now when you run the code above, it always prints a value of "),Se=n(Be,"CODE",{});var ol=r(Se);ot=o(ol,"1491.1711"),ol.forEach(s),pt=o(Be," no matter what because the "),Fe=n(Be,"CODE",{});var pl=r(Fe);ct=o(pl,"Generator"),pl.forEach(s),ut=o(Be," object with the seed is passed to all the random functions of the pipeline."),Be.forEach(s),fs=u(e),ge=n(e,"P",{});var cl=r(ge);dt=o(cl,"If you run this code example on your specific hardware and PyTorch version, you should get a similar, if not the same, result."),cl.forEach(s),ys=u(e),J(Y.$$.fragment,e),bs=u(e),F=n(e,"H3",{class:!0});var Ss=r(F);L=n(Ss,"A",{id:!0,class:!0,href:!0});var ul=r(L);Ne=n(ul,"SPAN",{});var dl=r(Ne);J(ie.$$.fragment,dl),dl.forEach(s),ul.forEach(s),ht=u(Ss),Qe=n(Ss,"SPAN",{});var hl=r(Qe);mt=o(hl,"GPU"),hl.forEach(s),Ss.forEach(s),ws=u(e),Je=n(e,"P",{});var ml=r(Je);ft=o(ml,"Writing a reproducible pipeline on a GPU is a bit trickier, and full reproducibility across different hardware is not guaranteed because matrix multiplication - which diffusion pipelines require a lot of - is less deterministic on a GPU than a CPU. For example, if you run the same code example above on a GPU:"),ml.forEach(s),Ms=u(e),J(oe.$$.fragment,e),vs=u(e),Te=n(e,"P",{});var fl=r(Te);yt=o(fl,"The result is not the same even though you\u2019re using an identical seed because the GPU uses a different random number generator than the CPU."),fl.forEach(s),js=u(e),W=n(e,"P",{});var V=r(W);bt=o(V,"To circumvent this problem, \u{1F9E8} Diffusers has a "),Ue=n(V,"A",{href:!0});var yl=r(Ue);wt=o(yl,"randn_tensor()"),yl.forEach(s),Mt=o(V," function for creating random noise on the CPU, and then moving the tensor to a GPU if necessary. The "),ze=n(V,"CODE",{});var bl=r(ze);vt=o(bl,"randn_tensor"),bl.forEach(s),jt=o(V," function is used everywhere inside the pipeline, allowing the user to "),He=n(V,"STRONG",{});var wl=r(He);gt=o(wl,"always"),wl.forEach(s),Jt=o(V," pass a CPU "),De=n(V,"CODE",{});var Ml=r(De);Tt=o(Ml,"Generator"),Ml.forEach(s),Ut=o(V," even if the pipeline is run on a GPU."),V.forEach(s),gs=u(e),Ze=n(e,"P",{});var vl=r(Ze);Zt=o(vl,"You\u2019ll see the results are much closer now!"),vl.forEach(s),Js=u(e),J(pe.$$.fragment,e),Ts=u(e),J(K.$$.fragment,e),Us=u(e),O=n(e,"P",{});var Fs=r(O);_t=o(Fs,"Finally, for more complex pipelines such as "),_e=n(Fs,"A",{href:!0});var jl=r(_e);Et=o(jl,"UnCLIPPipeline"),jl.forEach(s),Wt=o(Fs,`, these are often extremely
susceptible to precision error propagation. Don\u2019t expect similar results across
different GPU hardware or PyTorch versions. In this case, you\u2019ll need to run
exactly the same hardware and PyTorch version for full reproducibility.`),Fs.forEach(s),Zs=u(e),N=n(e,"H2",{class:!0});var Ns=r(N);ee=n(Ns,"A",{id:!0,class:!0,href:!0});var gl=r(ee);Ae=n(gl,"SPAN",{});var Jl=r(Ae);J(ce.$$.fragment,Jl),Jl.forEach(s),gl.forEach(s),Bt=u(Ns),xe=n(Ns,"SPAN",{});var Tl=r(xe);Gt=o(Tl,"Deterministic algorithms"),Tl.forEach(s),Ns.forEach(s),_s=u(e),Ee=n(e,"P",{});var Ul=r(Ee);kt=o(Ul,"You can also configure PyTorch to use deterministic algorithms to create a reproducible pipeline. However, you should be aware that deterministic algorithms may be slower than nondeterministic ones and you may observe a decrease in performance. But if reproducibility is important to you, then this is the way to go!"),Ul.forEach(s),Es=u(e),$=n(e,"P",{});var Ge=r($);It=o(Ge,"Nondeterministic behavior occurs when operations are launched in more than one CUDA stream. To avoid this, set the environment varibale "),ue=n(Ge,"A",{href:!0,rel:!0});var Zl=r(ue);qe=n(Zl,"CODE",{});var _l=r(qe);$t=o(_l,"CUBLAS_WORKSPACE_CONFIG"),_l.forEach(s),Zl.forEach(s),Pt=o(Ge," to "),Ye=n(Ge,"CODE",{});var El=r(Ye);Vt=o(El,":16:8"),El.forEach(s),Ct=o(Ge," to only use one buffer size during runtime."),Ge.forEach(s),Ws=u(e),P=n(e,"P",{});var ke=r(P);Rt=o(ke,"PyTorch typically benchmarks multiple algorithms to select the fastest one, but if you want reproducibility, you should disable this feature because the benchmark may select different algorithms each time. Lastly, pass "),Le=n(ke,"CODE",{});var Wl=r(Le);Xt=o(Wl,"True"),Wl.forEach(s),St=o(ke," to "),de=n(ke,"A",{href:!0,rel:!0});var Bl=r(de);Ke=n(Bl,"CODE",{});var Gl=r(Ke);Ft=o(Gl,"torch.use_deterministic_algorithms"),Gl.forEach(s),Bl.forEach(s),Nt=o(ke," to enable deterministic algorithms."),ke.forEach(s),Bs=u(e),J(he.$$.fragment,e),Gs=u(e),We=n(e,"P",{});var kl=r(We);Qt=o(kl,"Now when you run the same pipeline twice, you\u2019ll get identical results."),kl.forEach(s),ks=u(e),J(me.$$.fragment,e),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(Ql)),h(y,"id","create-reproducible-pipelines"),h(y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(y,"href","#create-reproducible-pipelines"),h(m,"class","relative group"),h(R,"href","reusing_seeds"),h(H,"id","control-randomness"),h(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(H,"href","#control-randomness"),h(X,"class","relative group"),h(Me,"href","/docs/diffusers/v0.20.0/en/api/pipelines/ddim#diffusers.DDIMPipeline"),h(le,"href","https://pytorch.org/docs/stable/generated/torch.randn.html"),h(le,"rel","nofollow"),h(x,"id","cpu"),h(x,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(x,"href","#cpu"),h(S,"class","relative group"),h(ne,"href","https://pytorch.org/docs/stable/generated/torch.randn.html"),h(ne,"rel","nofollow"),h(L,"id","gpu"),h(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(L,"href","#gpu"),h(F,"class","relative group"),h(Ue,"href","/docs/diffusers/v0.20.0/en/api/utilities#diffusers.utils.randn_tensor"),h(_e,"href","/docs/diffusers/v0.20.0/en/api/pipelines/unclip#diffusers.UnCLIPPipeline"),h(ee,"id","deterministic-algorithms"),h(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ee,"href","#deterministic-algorithms"),h(N,"class","relative group"),h(ue,"href","https://docs.nvidia.com/cuda/cublas/index.html#results-reproducibility"),h(ue,"rel","nofollow"),h(de,"href","https://pytorch.org/docs/stable/generated/torch.use_deterministic_algorithms.html"),h(de,"rel","nofollow")},m(e,l){t(document.head,d),p(e,v,l),p(e,m,l),t(m,y),t(y,B),T(M,B,null),t(m,E),t(m,j),t(j,G),p(e,b,l),T(w,e,l),p(e,k,l),p(e,f,l),t(f,C),t(f,R),t(R,ye),t(f,Qs),p(e,ts,l),p(e,be,l),t(be,zs),p(e,ls,l),T(z,e,l),p(e,as,l),p(e,X,l),t(X,H),t(H,$e),T(se,$e,null),t(X,Hs),t(X,Pe),t(Pe,Ds),p(e,ns,l),p(e,we,l),t(we,As),p(e,rs,l),p(e,D,l),t(D,xs),t(D,Me),t(Me,qs),t(D,Ys),p(e,is,l),T(te,e,l),p(e,os,l),p(e,ve,l),t(ve,Ls),p(e,ps,l),p(e,A,l),t(A,Ks),t(A,le),t(le,Ve),t(Ve,Os),t(A,et),p(e,cs,l),p(e,je,l),t(je,st),p(e,us,l),p(e,S,l),t(S,x),t(x,Ce),T(ae,Ce,null),t(S,tt),t(S,Re),t(Re,lt),p(e,ds,l),p(e,q,l),t(q,at),t(q,ne),t(ne,Xe),t(Xe,nt),t(q,rt),p(e,hs,l),T(re,e,l),p(e,ms,l),p(e,I,l),t(I,it),t(I,Se),t(Se,ot),t(I,pt),t(I,Fe),t(Fe,ct),t(I,ut),p(e,fs,l),p(e,ge,l),t(ge,dt),p(e,ys,l),T(Y,e,l),p(e,bs,l),p(e,F,l),t(F,L),t(L,Ne),T(ie,Ne,null),t(F,ht),t(F,Qe),t(Qe,mt),p(e,ws,l),p(e,Je,l),t(Je,ft),p(e,Ms,l),T(oe,e,l),p(e,vs,l),p(e,Te,l),t(Te,yt),p(e,js,l),p(e,W,l),t(W,bt),t(W,Ue),t(Ue,wt),t(W,Mt),t(W,ze),t(ze,vt),t(W,jt),t(W,He),t(He,gt),t(W,Jt),t(W,De),t(De,Tt),t(W,Ut),p(e,gs,l),p(e,Ze,l),t(Ze,Zt),p(e,Js,l),T(pe,e,l),p(e,Ts,l),T(K,e,l),p(e,Us,l),p(e,O,l),t(O,_t),t(O,_e),t(_e,Et),t(O,Wt),p(e,Zs,l),p(e,N,l),t(N,ee),t(ee,Ae),T(ce,Ae,null),t(N,Bt),t(N,xe),t(xe,Gt),p(e,_s,l),p(e,Ee,l),t(Ee,kt),p(e,Es,l),p(e,$,l),t($,It),t($,ue),t(ue,qe),t(qe,$t),t($,Pt),t($,Ye),t(Ye,Vt),t($,Ct),p(e,Ws,l),p(e,P,l),t(P,Rt),t(P,Le),t(Le,Xt),t(P,St),t(P,de),t(de,Ke),t(Ke,Ft),t(P,Nt),p(e,Bs,l),T(he,e,l),p(e,Gs,l),p(e,We,l),t(We,Qt),p(e,ks,l),T(me,e,l),Is=!0},p(e,[l]){const fe={};l&2&&(fe.$$scope={dirty:l,ctx:e}),z.$set(fe);const Oe={};l&2&&(Oe.$$scope={dirty:l,ctx:e}),Y.$set(Oe);const es={};l&2&&(es.$$scope={dirty:l,ctx:e}),K.$set(es)},i(e){Is||(U(M.$$.fragment,e),U(w.$$.fragment,e),U(z.$$.fragment,e),U(se.$$.fragment,e),U(te.$$.fragment,e),U(ae.$$.fragment,e),U(re.$$.fragment,e),U(Y.$$.fragment,e),U(ie.$$.fragment,e),U(oe.$$.fragment,e),U(pe.$$.fragment,e),U(K.$$.fragment,e),U(ce.$$.fragment,e),U(he.$$.fragment,e),U(me.$$.fragment,e),Is=!0)},o(e){Z(M.$$.fragment,e),Z(w.$$.fragment,e),Z(z.$$.fragment,e),Z(se.$$.fragment,e),Z(te.$$.fragment,e),Z(ae.$$.fragment,e),Z(re.$$.fragment,e),Z(Y.$$.fragment,e),Z(ie.$$.fragment,e),Z(oe.$$.fragment,e),Z(pe.$$.fragment,e),Z(K.$$.fragment,e),Z(ce.$$.fragment,e),Z(he.$$.fragment,e),Z(me.$$.fragment,e),Is=!1},d(e){s(d),e&&s(v),e&&s(m),_(M),e&&s(b),_(w,e),e&&s(k),e&&s(f),e&&s(ts),e&&s(be),e&&s(ls),_(z,e),e&&s(as),e&&s(X),_(se),e&&s(ns),e&&s(we),e&&s(rs),e&&s(D),e&&s(is),_(te,e),e&&s(os),e&&s(ve),e&&s(ps),e&&s(A),e&&s(cs),e&&s(je),e&&s(us),e&&s(S),_(ae),e&&s(ds),e&&s(q),e&&s(hs),_(re,e),e&&s(ms),e&&s(I),e&&s(fs),e&&s(ge),e&&s(ys),_(Y,e),e&&s(bs),e&&s(F),_(ie),e&&s(ws),e&&s(Je),e&&s(Ms),_(oe,e),e&&s(vs),e&&s(Te),e&&s(js),e&&s(W),e&&s(gs),e&&s(Ze),e&&s(Js),_(pe,e),e&&s(Ts),_(K,e),e&&s(Us),e&&s(O),e&&s(Zs),e&&s(N),_(ce),e&&s(_s),e&&s(Ee),e&&s(Es),e&&s($),e&&s(Ws),e&&s(P),e&&s(Bs),_(he,e),e&&s(Gs),e&&s(We),e&&s(ks),_(me,e)}}}const Ql={local:"create-reproducible-pipelines",sections:[{local:"control-randomness",sections:[{local:"cpu",title:"CPU"},{local:"gpu",title:"GPU"}],title:"Control randomness"},{local:"deterministic-algorithms",title:"Deterministic algorithms"}],title:"Create reproducible pipelines"};function zl(Q){return Cl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yl extends Il{constructor(d){super();$l(this,d,zl,Nl,Pl,{})}}export{Yl as default,Ql as metadata};
