Buckets:
| import{s as jt,o as Ct,n as Oe}from"../chunks/scheduler.8c3d61f6.js";import{S as Zt,i as Gt,g as p,s as i,r as f,A as It,h as r,f as l,c as n,j as vt,u as d,x as o,k as gt,y as kt,a as s,v as u,d as m,t as h,w as M}from"../chunks/index.589a98e8.js";import{T as Ke}from"../chunks/Tip.42aa8582.js";import{C as w}from"../chunks/CodeBlock.36627b28.js";import{H as De,E as Wt}from"../chunks/EditOnGithub.e5a8d9cb.js";function xt(T){let a,y='To learn more, take a look at the <a href="https://huggingface.co/docs/accelerate/en/usage_guides/distributed_inference#distributed-inference-with-accelerate" rel="nofollow">Distributed Inference with 🤗 Accelerate</a> guide.';return{c(){a=p("p"),a.innerHTML=y},l(c){a=r(c,"P",{"data-svelte-h":!0}),o(a)!=="svelte-c8rg1s"&&(a.innerHTML=y)},m(c,b){s(c,a,b)},p:Oe,d(c){c&&l(a)}}}function Pt(T){let a,y="This feature is experimental and its APIs might change in the future.";return{c(){a=p("p"),a.textContent=y},l(c){a=r(c,"P",{"data-svelte-h":!0}),o(a)!=="svelte-1o311ve"&&(a.textContent=y)},m(c,b){s(c,a,b)},p:Oe,d(c){c&&l(a)}}}function Et(T){let a,y="Only the “balanced” strategy is supported at the moment, and we plan to support additional mapping strategies in the future.";return{c(){a=p("p"),a.textContent=y},l(c){a=r(c,"P",{"data-svelte-h":!0}),o(a)!=="svelte-qgg1n4"&&(a.textContent=y)},m(c,b){s(c,a,b)},p:Oe,d(c){c&&l(a)}}}function Ht(T){let a,y,c,b,$,oe,v,et='On distributed setups, you can run inference across multiple GPUs with 🤗 <a href="https://huggingface.co/docs/accelerate/index" rel="nofollow">Accelerate</a> or <a href="https://pytorch.org/tutorials/beginner/dist_overview.html" rel="nofollow">PyTorch Distributed</a>, which is useful for generating with multiple prompts in parallel.',ce,g,tt="This guide will show you how to use 🤗 Accelerate and PyTorch Distributed for distributed inference.",fe,j,de,C,lt='🤗 <a href="https://huggingface.co/docs/accelerate/index" rel="nofollow">Accelerate</a> is a library designed to make it easy to train or run inference across distributed setups. It simplifies the process of setting up the distributed environment, allowing you to focus on your PyTorch code.',ue,Z,st='To begin, create a Python file and initialize an <a href="https://huggingface.co/docs/accelerate/main/en/package_reference/state#accelerate.PartialState" rel="nofollow">accelerate.PartialState</a> to create a distributed environment; your setup is automatically detected so you don’t need to explicitly define the <code>rank</code> or <code>world_size</code>. Move the <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> to <code>distributed_state.device</code> to assign a GPU to each process.',me,G,it='Now use the <a href="https://huggingface.co/docs/accelerate/main/en/package_reference/state#accelerate.PartialState.split_between_processes" rel="nofollow">split_between_processes</a> utility as a context manager to automatically distribute the prompts between the number of processes.',he,I,Me,k,nt="Use the <code>--num_processes</code> argument to specify the number of GPUs to use, and call <code>accelerate launch</code> to run the script:",ye,W,we,J,be,x,Te,_,Je,P,at="With Accelerate, you can use the <code>device_map</code> to determine how to distribute the models of a pipeline across multiple devices. This is useful in situations where you have more than one GPU.",_e,E,pt='For example, if you have two 8GB GPUs, then using <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_model_cpu_offload">enable_model_cpu_offload()</a> may not work so well because:',Ue,H,rt='<li>it only works on a single GPU</li> <li>a single model might not fit on a single GPU (<a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_sequential_cpu_offload">enable_sequential_cpu_offload()</a> might work but it will be extremely slow and it is also limited to a single GPU)</li>',$e,R,ot="To make use of both GPUs, you can use the “balanced” device placement strategy which splits the models across all available GPUs.",ve,U,ge,z,je,B,ct="You can also pass a dictionary to enforce the maximum GPU memory that can be used on each device:",Ce,N,Ze,V,ft="If a device is not present in <code>max_memory</code>, then it will be completely ignored and will not participate in the device placement.",Ge,X,dt='By default, Diffusers uses the maximum memory of all devices. If the models don’t fit on the GPUs, they are offloaded to the CPU. If the CPU doesn’t have enough memory, then you might see an error. In that case, you could defer to using <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_sequential_cpu_offload">enable_sequential_cpu_offload()</a> and <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_model_cpu_offload">enable_model_cpu_offload()</a>.',Ie,S,ut='Call <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.reset_device_map">reset_device_map()</a> to reset the <code>device_map</code> of a pipeline. This is also necessary if you want to use methods like <code>to()</code>, <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_sequential_cpu_offload">enable_sequential_cpu_offload()</a>, and <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_model_cpu_offload">enable_model_cpu_offload()</a> on a pipeline that was device-mapped.',ke,Y,We,L,mt="Once a pipeline has been device-mapped, you can also access its device map via <code>hf_device_map</code>:",xe,F,Pe,A,ht="An example device map would look like so:",Ee,q,He,Q,Re,D,Mt='PyTorch supports <a href="https://pytorch.org/docs/stable/generated/torch.nn.parallel.DistributedDataParallel.html" rel="nofollow"><code>DistributedDataParallel</code></a> which enables data parallelism.',ze,K,yt='To start, create a Python file and import <code>torch.distributed</code> and <code>torch.multiprocessing</code> to set up the distributed process group and to spawn the processes for inference on each GPU. You should also initialize a <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>:',Be,O,Ne,ee,wt='You’ll want to create a function to run inference; <a href="https://pytorch.org/docs/stable/distributed.html?highlight=init_process_group#torch.distributed.init_process_group" rel="nofollow"><code>init_process_group</code></a> handles creating a distributed environment with the type of backend to use, the <code>rank</code> of the current process, and the <code>world_size</code> or the number of processes participating. If you’re running inference in parallel over 2 GPUs, then the <code>world_size</code> is 2.',Ve,te,bt='Move the <a href="/docs/diffusers/pr_8376/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> to <code>rank</code> and use <code>get_rank</code> to assign a GPU to each process, where each process handles a different prompt:',Xe,le,Se,se,Tt='To run the distributed inference, call <a href="https://pytorch.org/docs/stable/multiprocessing.html#torch.multiprocessing.spawn" rel="nofollow"><code>mp.spawn</code></a> to run the <code>run_inference</code> function on the number of GPUs defined in <code>world_size</code>:',Ye,ie,Le,ne,Jt="Once you’ve completed the inference script, use the <code>--nproc_per_node</code> argument to specify the number of GPUs to use and call <code>torchrun</code> to run the script:",Fe,ae,Ae,pe,qe,re,Qe;return $=new De({props:{title:"Distributed inference with multiple GPUs",local:"distributed-inference-with-multiple-gpus",headingTag:"h1"}}),j=new De({props:{title:"🤗 Accelerate",local:"-accelerate",headingTag:"h2"}}),I=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwYWNjZWxlcmF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBEaWZmdXNpb25QaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSklMEFkaXN0cmlidXRlZF9zdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBcGlwZWxpbmUudG8oZGlzdHJpYnV0ZWRfc3RhdGUuZGV2aWNlKSUwQSUwQXdpdGglMjBkaXN0cmlidXRlZF9zdGF0ZS5zcGxpdF9iZXR3ZWVuX3Byb2Nlc3NlcyglNUIlMjJhJTIwZG9nJTIyJTJDJTIwJTIyYSUyMGNhdCUyMiU1RCklMjBhcyUyMHByb21wdCUzQSUwQSUyMCUyMCUyMCUyMHJlc3VsdCUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCkuaW1hZ2VzJTVCMCU1RCUwQSUyMCUyMCUyMCUyMHJlc3VsdC5zYXZlKGYlMjJyZXN1bHRfJTdCZGlzdHJpYnV0ZWRfc3RhdGUucHJvY2Vzc19pbmRleCU3RC5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> PartialState | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| <span class="hljs-string">"runwayml/stable-diffusion-v1-5"</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span> | |
| ) | |
| distributed_state = PartialState() | |
| pipeline.to(distributed_state.device) | |
| <span class="hljs-keyword">with</span> distributed_state.split_between_processes([<span class="hljs-string">"a dog"</span>, <span class="hljs-string">"a cat"</span>]) <span class="hljs-keyword">as</span> prompt: | |
| result = pipeline(prompt).images[<span class="hljs-number">0</span>] | |
| result.save(<span class="hljs-string">f"result_<span class="hljs-subst">{distributed_state.process_index}</span>.png"</span>)`,wrap:!1}}),W=new w({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHJ1bl9kaXN0cmlidXRlZC5weSUyMC0tbnVtX3Byb2Nlc3NlcyUzRDI=",highlighted:"accelerate launch run_distributed.py --num_processes=2",wrap:!1}}),J=new Ke({props:{$$slots:{default:[xt]},$$scope:{ctx:T}}}),x=new De({props:{title:"Device placement",local:"device-placement",headingTag:"h3"}}),_=new Ke({props:{warning:!0,$$slots:{default:[Pt]},$$scope:{ctx:T}}}),U=new Ke({props:{warning:!0,$$slots:{default:[Et]},$$scope:{ctx:T}}}),z=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEEtJTIwJTIwJTIwJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBJTJCJTIwJTIwJTIwJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTIwZGV2aWNlX21hcCUzRCUyMmJhbGFuY2VkJTIyJTBBKSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUoJTIyYSUyMGRvZyUyMikuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`from diffusers import DiffusionPipeline | |
| import torch | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| <span class="hljs-deletion">- "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, use_safetensors=True,</span> | |
| <span class="hljs-addition">+ "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, use_safetensors=True, device_map="balanced"</span> | |
| ) | |
| image = pipeline("a dog").images[0] | |
| image`,wrap:!1}}),N=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtYXhfbWVtb3J5JTIwJTNEJTIwJTdCMCUzQSUyMjFHQiUyMiUyQyUyMDElM0ElMjIxR0IlMjIlN0QlMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMCUwQSUyMCUyMCUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMkMlMjAlMEElMjAlMjAlMjAlMjBkZXZpY2VfbWFwJTNEJTIyYmFsYW5jZWQlMjIlMkMlMEElMkIlMjAlMjAlMjBtYXhfbWVtb3J5JTNEbWF4X21lbW9yeSUwQSklMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKCUyMmElMjBkb2clMjIpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`from diffusers import DiffusionPipeline | |
| import torch | |
| max_memory = {0:"1GB", 1:"1GB"} | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "runwayml/stable-diffusion-v1-5", | |
| torch_dtype=torch.float16, | |
| use_safetensors=True, | |
| device_map="balanced", | |
| <span class="hljs-addition">+ max_memory=max_memory</span> | |
| ) | |
| image = pipeline("a dog").images[0] | |
| image`,wrap:!1}}),Y=new w({props:{code:"cGlwZWxpbmUucmVzZXRfZGV2aWNlX21hcCgp",highlighted:"pipeline.reset_device_map()",wrap:!1}}),F=new w({props:{code:"cHJpbnQocGlwZWxpbmUuaGZfZGV2aWNlX21hcCk=",highlighted:'<span class="hljs-built_in">print</span>(pipeline.hf_device_map)',wrap:!1}}),q=new w({props:{code:"JTdCJ3VuZXQnJTNBJTIwMSUyQyUyMCd2YWUnJTNBJTIwMSUyQyUyMCdzYWZldHlfY2hlY2tlciclM0ElMjAwJTJDJTIwJ3RleHRfZW5jb2RlciclM0ElMjAwJTdE",highlighted:'{<span class="hljs-string">'unet'</span>: 1, <span class="hljs-string">'vae'</span>: 1, <span class="hljs-string">'safety_checker'</span>: 0, <span class="hljs-string">'text_encoder'</span>: 0}',wrap:!1}}),Q=new De({props:{title:"PyTorch Distributed",local:"pytorch-distributed",headingTag:"h2"}}),O=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5kaXN0cmlidXRlZCUyMGFzJTIwZGlzdCUwQWltcG9ydCUyMHRvcmNoLm11bHRpcHJvY2Vzc2luZyUyMGFzJTIwbXAlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFzZCUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEp",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">import</span> torch.distributed <span class="hljs-keyword">as</span> dist | |
| <span class="hljs-keyword">import</span> torch.multiprocessing <span class="hljs-keyword">as</span> mp | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| sd = DiffusionPipeline.from_pretrained( | |
| <span class="hljs-string">"runwayml/stable-diffusion-v1-5"</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span> | |
| )`,wrap:!1}}),le=new w({props:{code:"ZGVmJTIwcnVuX2luZmVyZW5jZShyYW5rJTJDJTIwd29ybGRfc2l6ZSklM0ElMEElMjAlMjAlMjAlMjBkaXN0LmluaXRfcHJvY2Vzc19ncm91cCglMjJuY2NsJTIyJTJDJTIwcmFuayUzRHJhbmslMkMlMjB3b3JsZF9zaXplJTNEd29ybGRfc2l6ZSklMEElMEElMjAlMjAlMjAlMjBzZC50byhyYW5rKSUwQSUwQSUyMCUyMCUyMCUyMGlmJTIwdG9yY2guZGlzdHJpYnV0ZWQuZ2V0X3JhbmsoKSUyMCUzRCUzRCUyMDAlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcm9tcHQlMjAlM0QlMjAlMjJhJTIwZG9nJTIyJTBBJTIwJTIwJTIwJTIwZWxpZiUyMHRvcmNoLmRpc3RyaWJ1dGVkLmdldF9yYW5rKCklMjAlM0QlM0QlMjAxJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJvbXB0JTIwJTNEJTIwJTIyYSUyMGNhdCUyMiUwQSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwc2QocHJvbXB0KS5pbWFnZXMlNUIwJTVEJTBBJTIwJTIwJTIwJTIwaW1hZ2Uuc2F2ZShmJTIyLiUyRiU3QidfJy5qb2luKHByb21wdCklN0QucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">run_inference</span>(<span class="hljs-params">rank, world_size</span>): | |
| dist.init_process_group(<span class="hljs-string">"nccl"</span>, rank=rank, world_size=world_size) | |
| sd.to(rank) | |
| <span class="hljs-keyword">if</span> torch.distributed.get_rank() == <span class="hljs-number">0</span>: | |
| prompt = <span class="hljs-string">"a dog"</span> | |
| <span class="hljs-keyword">elif</span> torch.distributed.get_rank() == <span class="hljs-number">1</span>: | |
| prompt = <span class="hljs-string">"a cat"</span> | |
| image = sd(prompt).images[<span class="hljs-number">0</span>] | |
| image.save(<span class="hljs-string">f"./<span class="hljs-subst">{<span class="hljs-string">'_'</span>.join(prompt)}</span>.png"</span>)`,wrap:!1}}),ie=new w({props:{code:"ZGVmJTIwbWFpbigpJTNBJTBBJTIwJTIwJTIwJTIwd29ybGRfc2l6ZSUyMCUzRCUyMDIlMEElMjAlMjAlMjAlMjBtcC5zcGF3bihydW5faW5mZXJlbmNlJTJDJTIwYXJncyUzRCh3b3JsZF9zaXplJTJDKSUyQyUyMG5wcm9jcyUzRHdvcmxkX3NpemUlMkMlMjBqb2luJTNEVHJ1ZSklMEElMEElMEFpZiUyMF9fbmFtZV9fJTIwJTNEJTNEJTIwJTIyX19tYWluX18lMjIlM0ElMEElMjAlMjAlMjAlMjBtYWluKCk=",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">main</span>(): | |
| world_size = <span class="hljs-number">2</span> | |
| mp.spawn(run_inference, args=(world_size,), nprocs=world_size, join=<span class="hljs-literal">True</span>) | |
| <span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>: | |
| main()`,wrap:!1}}),ae=new w({props:{code:"dG9yY2hydW4lMjBydW5fZGlzdHJpYnV0ZWQucHklMjAtLW5wcm9jX3Blcl9ub2RlJTNEMg==",highlighted:"torchrun run_distributed.py --nproc_per_node=2",wrap:!1}}),pe=new Wt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/training/distributed_inference.md"}}),{c(){a=p("meta"),y=i(),c=p("p"),b=i(),f($.$$.fragment),oe=i(),v=p("p"),v.innerHTML=et,ce=i(),g=p("p"),g.textContent=tt,fe=i(),f(j.$$.fragment),de=i(),C=p("p"),C.innerHTML=lt,ue=i(),Z=p("p"),Z.innerHTML=st,me=i(),G=p("p"),G.innerHTML=it,he=i(),f(I.$$.fragment),Me=i(),k=p("p"),k.innerHTML=nt,ye=i(),f(W.$$.fragment),we=i(),f(J.$$.fragment),be=i(),f(x.$$.fragment),Te=i(),f(_.$$.fragment),Je=i(),P=p("p"),P.innerHTML=at,_e=i(),E=p("p"),E.innerHTML=pt,Ue=i(),H=p("ul"),H.innerHTML=rt,$e=i(),R=p("p"),R.textContent=ot,ve=i(),f(U.$$.fragment),ge=i(),f(z.$$.fragment),je=i(),B=p("p"),B.textContent=ct,Ce=i(),f(N.$$.fragment),Ze=i(),V=p("p"),V.innerHTML=ft,Ge=i(),X=p("p"),X.innerHTML=dt,Ie=i(),S=p("p"),S.innerHTML=ut,ke=i(),f(Y.$$.fragment),We=i(),L=p("p"),L.innerHTML=mt,xe=i(),f(F.$$.fragment),Pe=i(),A=p("p"),A.textContent=ht,Ee=i(),f(q.$$.fragment),He=i(),f(Q.$$.fragment),Re=i(),D=p("p"),D.innerHTML=Mt,ze=i(),K=p("p"),K.innerHTML=yt,Be=i(),f(O.$$.fragment),Ne=i(),ee=p("p"),ee.innerHTML=wt,Ve=i(),te=p("p"),te.innerHTML=bt,Xe=i(),f(le.$$.fragment),Se=i(),se=p("p"),se.innerHTML=Tt,Ye=i(),f(ie.$$.fragment),Le=i(),ne=p("p"),ne.innerHTML=Jt,Fe=i(),f(ae.$$.fragment),Ae=i(),f(pe.$$.fragment),qe=i(),re=p("p"),this.h()},l(e){const t=It("svelte-u9bgzb",document.head);a=r(t,"META",{name:!0,content:!0}),t.forEach(l),y=n(e),c=r(e,"P",{}),vt(c).forEach(l),b=n(e),d($.$$.fragment,e),oe=n(e),v=r(e,"P",{"data-svelte-h":!0}),o(v)!=="svelte-a7bv7i"&&(v.innerHTML=et),ce=n(e),g=r(e,"P",{"data-svelte-h":!0}),o(g)!=="svelte-1qu3csy"&&(g.textContent=tt),fe=n(e),d(j.$$.fragment,e),de=n(e),C=r(e,"P",{"data-svelte-h":!0}),o(C)!=="svelte-13uq1g2"&&(C.innerHTML=lt),ue=n(e),Z=r(e,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-1a0g6n0"&&(Z.innerHTML=st),me=n(e),G=r(e,"P",{"data-svelte-h":!0}),o(G)!=="svelte-1iuwz8b"&&(G.innerHTML=it),he=n(e),d(I.$$.fragment,e),Me=n(e),k=r(e,"P",{"data-svelte-h":!0}),o(k)!=="svelte-1ohh8as"&&(k.innerHTML=nt),ye=n(e),d(W.$$.fragment,e),we=n(e),d(J.$$.fragment,e),be=n(e),d(x.$$.fragment,e),Te=n(e),d(_.$$.fragment,e),Je=n(e),P=r(e,"P",{"data-svelte-h":!0}),o(P)!=="svelte-1y4i1fz"&&(P.innerHTML=at),_e=n(e),E=r(e,"P",{"data-svelte-h":!0}),o(E)!=="svelte-1a3oand"&&(E.innerHTML=pt),Ue=n(e),H=r(e,"UL",{"data-svelte-h":!0}),o(H)!=="svelte-u5uv7h"&&(H.innerHTML=rt),$e=n(e),R=r(e,"P",{"data-svelte-h":!0}),o(R)!=="svelte-awezto"&&(R.textContent=ot),ve=n(e),d(U.$$.fragment,e),ge=n(e),d(z.$$.fragment,e),je=n(e),B=r(e,"P",{"data-svelte-h":!0}),o(B)!=="svelte-1y8b6l8"&&(B.textContent=ct),Ce=n(e),d(N.$$.fragment,e),Ze=n(e),V=r(e,"P",{"data-svelte-h":!0}),o(V)!=="svelte-pzd1ok"&&(V.innerHTML=ft),Ge=n(e),X=r(e,"P",{"data-svelte-h":!0}),o(X)!=="svelte-1wixsty"&&(X.innerHTML=dt),Ie=n(e),S=r(e,"P",{"data-svelte-h":!0}),o(S)!=="svelte-9ub4ai"&&(S.innerHTML=ut),ke=n(e),d(Y.$$.fragment,e),We=n(e),L=r(e,"P",{"data-svelte-h":!0}),o(L)!=="svelte-17pbny5"&&(L.innerHTML=mt),xe=n(e),d(F.$$.fragment,e),Pe=n(e),A=r(e,"P",{"data-svelte-h":!0}),o(A)!=="svelte-18o6tiw"&&(A.textContent=ht),Ee=n(e),d(q.$$.fragment,e),He=n(e),d(Q.$$.fragment,e),Re=n(e),D=r(e,"P",{"data-svelte-h":!0}),o(D)!=="svelte-jtiddl"&&(D.innerHTML=Mt),ze=n(e),K=r(e,"P",{"data-svelte-h":!0}),o(K)!=="svelte-1axsvi5"&&(K.innerHTML=yt),Be=n(e),d(O.$$.fragment,e),Ne=n(e),ee=r(e,"P",{"data-svelte-h":!0}),o(ee)!=="svelte-qkdvuf"&&(ee.innerHTML=wt),Ve=n(e),te=r(e,"P",{"data-svelte-h":!0}),o(te)!=="svelte-ylgse4"&&(te.innerHTML=bt),Xe=n(e),d(le.$$.fragment,e),Se=n(e),se=r(e,"P",{"data-svelte-h":!0}),o(se)!=="svelte-1ecd3vq"&&(se.innerHTML=Tt),Ye=n(e),d(ie.$$.fragment,e),Le=n(e),ne=r(e,"P",{"data-svelte-h":!0}),o(ne)!=="svelte-ykaora"&&(ne.innerHTML=Jt),Fe=n(e),d(ae.$$.fragment,e),Ae=n(e),d(pe.$$.fragment,e),qe=n(e),re=r(e,"P",{}),vt(re).forEach(l),this.h()},h(){gt(a,"name","hf:doc:metadata"),gt(a,"content",Rt)},m(e,t){kt(document.head,a),s(e,y,t),s(e,c,t),s(e,b,t),u($,e,t),s(e,oe,t),s(e,v,t),s(e,ce,t),s(e,g,t),s(e,fe,t),u(j,e,t),s(e,de,t),s(e,C,t),s(e,ue,t),s(e,Z,t),s(e,me,t),s(e,G,t),s(e,he,t),u(I,e,t),s(e,Me,t),s(e,k,t),s(e,ye,t),u(W,e,t),s(e,we,t),u(J,e,t),s(e,be,t),u(x,e,t),s(e,Te,t),u(_,e,t),s(e,Je,t),s(e,P,t),s(e,_e,t),s(e,E,t),s(e,Ue,t),s(e,H,t),s(e,$e,t),s(e,R,t),s(e,ve,t),u(U,e,t),s(e,ge,t),u(z,e,t),s(e,je,t),s(e,B,t),s(e,Ce,t),u(N,e,t),s(e,Ze,t),s(e,V,t),s(e,Ge,t),s(e,X,t),s(e,Ie,t),s(e,S,t),s(e,ke,t),u(Y,e,t),s(e,We,t),s(e,L,t),s(e,xe,t),u(F,e,t),s(e,Pe,t),s(e,A,t),s(e,Ee,t),u(q,e,t),s(e,He,t),u(Q,e,t),s(e,Re,t),s(e,D,t),s(e,ze,t),s(e,K,t),s(e,Be,t),u(O,e,t),s(e,Ne,t),s(e,ee,t),s(e,Ve,t),s(e,te,t),s(e,Xe,t),u(le,e,t),s(e,Se,t),s(e,se,t),s(e,Ye,t),u(ie,e,t),s(e,Le,t),s(e,ne,t),s(e,Fe,t),u(ae,e,t),s(e,Ae,t),u(pe,e,t),s(e,qe,t),s(e,re,t),Qe=!0},p(e,[t]){const _t={};t&2&&(_t.$$scope={dirty:t,ctx:e}),J.$set(_t);const Ut={};t&2&&(Ut.$$scope={dirty:t,ctx:e}),_.$set(Ut);const $t={};t&2&&($t.$$scope={dirty:t,ctx:e}),U.$set($t)},i(e){Qe||(m($.$$.fragment,e),m(j.$$.fragment,e),m(I.$$.fragment,e),m(W.$$.fragment,e),m(J.$$.fragment,e),m(x.$$.fragment,e),m(_.$$.fragment,e),m(U.$$.fragment,e),m(z.$$.fragment,e),m(N.$$.fragment,e),m(Y.$$.fragment,e),m(F.$$.fragment,e),m(q.$$.fragment,e),m(Q.$$.fragment,e),m(O.$$.fragment,e),m(le.$$.fragment,e),m(ie.$$.fragment,e),m(ae.$$.fragment,e),m(pe.$$.fragment,e),Qe=!0)},o(e){h($.$$.fragment,e),h(j.$$.fragment,e),h(I.$$.fragment,e),h(W.$$.fragment,e),h(J.$$.fragment,e),h(x.$$.fragment,e),h(_.$$.fragment,e),h(U.$$.fragment,e),h(z.$$.fragment,e),h(N.$$.fragment,e),h(Y.$$.fragment,e),h(F.$$.fragment,e),h(q.$$.fragment,e),h(Q.$$.fragment,e),h(O.$$.fragment,e),h(le.$$.fragment,e),h(ie.$$.fragment,e),h(ae.$$.fragment,e),h(pe.$$.fragment,e),Qe=!1},d(e){e&&(l(y),l(c),l(b),l(oe),l(v),l(ce),l(g),l(fe),l(de),l(C),l(ue),l(Z),l(me),l(G),l(he),l(Me),l(k),l(ye),l(we),l(be),l(Te),l(Je),l(P),l(_e),l(E),l(Ue),l(H),l($e),l(R),l(ve),l(ge),l(je),l(B),l(Ce),l(Ze),l(V),l(Ge),l(X),l(Ie),l(S),l(ke),l(We),l(L),l(xe),l(Pe),l(A),l(Ee),l(He),l(Re),l(D),l(ze),l(K),l(Be),l(Ne),l(ee),l(Ve),l(te),l(Xe),l(Se),l(se),l(Ye),l(Le),l(ne),l(Fe),l(Ae),l(qe),l(re)),l(a),M($,e),M(j,e),M(I,e),M(W,e),M(J,e),M(x,e),M(_,e),M(U,e),M(z,e),M(N,e),M(Y,e),M(F,e),M(q,e),M(Q,e),M(O,e),M(le,e),M(ie,e),M(ae,e),M(pe,e)}}}const Rt='{"title":"Distributed inference with multiple GPUs","local":"distributed-inference-with-multiple-gpus","sections":[{"title":"🤗 Accelerate","local":"-accelerate","sections":[{"title":"Device placement","local":"device-placement","sections":[],"depth":3}],"depth":2},{"title":"PyTorch Distributed","local":"pytorch-distributed","sections":[],"depth":2}],"depth":1}';function zt(T){return Ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yt extends Zt{constructor(a){super(),Gt(this,a,zt,Ht,jt,{})}}export{Yt as component}; | |
Xet Storage Details
- Size:
- 23.5 kB
- Xet hash:
- 838f8859da34f8349b5c2c5a851b5ea1f834d021f1ef1f43a4b954c9b56d15f7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.