Buckets:

HuggingFaceDocBuilder's picture
download
raw
10.1 kB
import{s as Ae,n as qe,o as Be}from"../chunks/scheduler.f3b1e791.js";import{S as Oe,i as We,e as a,s as l,c as f,h as ze,a as o,d as i,b as s,f as He,g as p,j as r,k as Se,l as je,m as n,n as m,t as u,o as d,p as c}from"../chunks/index.023a9934.js";import{C as Ue}from"../chunks/CopyLLMTxtMenu.20dc0610.js";import{H as x,E as Ke}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.08433af6.js";function Qe(ye){let g,U,z,K,$,Q,h,F,v,Ce="The Kernel Builder project uses Nix to build custom kernels designed specifically for PyTorch.",G,y,be="Here’s why we chose Nix and why it’s particularly suited to our workflow:",J,C,V,b,we="Nix guarantees deterministic evaluation, ensuring that every kernel is built identically, regardless of the host environment. This consistency prevents “it works on my machine” problems, making debugging and deployment straightforward.",X,w,Y,k,ke="Compiling PyTorch kernels often involves complex dependencies such as CUDA versions, PyTorch APIs, and various C++ toolchains. Nix explicitly defines and manages these dependencies, eliminating version conflicts and making maintenance easier.",Z,_,ee,P,_e="Nix’s declarative approach clearly specifies exactly what each kernel build needs. This transparency aids collaboration, speeds up troubleshooting, and makes it easy to document the build process.",te,T,ie,N,Pe="Each kernel build with Nix runs in a fully isolated sandbox, removing any uncertainty about external state. This isolation ensures clean builds, free of unexpected side effects.",ne,E,le,M,Te="Kernel compilation can be resource-intensive. Nix leverages efficient caching of build artifacts, significantly reducing build times and optimizing continuous integration workflows.",se,L,ae,I,Ne="Nix allows you to experiment with different kernel configurations, PyTorch versions, or CUDA toolkits easily. If a change introduces an issue, reverting to a previous state is quick and effortless.",oe,R,Ee="Overall, Nix streamlines the Kernel Builder workflow, allowing us to efficiently and reliably manage complex machine learning kernel builds.",re,D,fe,H,Me="<strong>Q. Why not use Docker or other containerization tools instead of Nix?</strong>",pe,S,Le="While Docker provides isolation and consistent runtime environments, it doesn’t guarantee fully reproducible builds. Factors like base image changes or implicit dependencies can still introduce variability.",me,A,Ie="Nix focuses on reproducibility through deterministic builds, ensuring the same inputs always produce identical outputs. Its declarative configuration, precise dependency management, and efficient caching also make it well-suited for complex environments and CI/CD workflows.",ue,de,ce,q,Re="If you want to learn more about Nix, check out the following resources:",ge,B,xe,O,De=`<li><strong>The Official Nix Manual:</strong> <ul><li>The definitive source for all things Nix, providing comprehensive coverage of its features, commands, and ecosystem.</li> <li>Link: <a href="https://nixos.org/manual/nix/stable/" rel="nofollow">Nix Manual (nixos.org)</a></li></ul></li> <li><strong>Nix Pills:</strong> <ul><li>A series of blog posts breaking down complex Nix concepts into digestible pieces, ideal for a structured, tutorial-style approach.</li> <li>Link: <a href="https://nixos.org/guides/nix-pills/" rel="nofollow">Nix Pills (nixos.org)</a></li></ul></li> <li><strong>nix.dev</strong>:
<ul><li>Home of official documentation for the Nix ecosystem.</li> <li>Link <a href="https://nix.dev/" rel="nofollow">nix.dev</a></li></ul></li> <li><strong>NixOS Wiki:</strong> <ul><li>A community-driven wiki with a wealth of information, including tips, tricks, and tutorials, covering a wide range of topics, including NixOS-specific information.</li> <li>Link: <a href="https://nixos.wiki/wiki/Main_Page" rel="nofollow">NixOS Wiki</a></li></ul></li>`,$e,W,he,j,ve;return $=new Ue({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new x({props:{title:"Why Nix?",local:"why-nix",headingTag:"h1"}}),C=new x({props:{title:"1. Consistent and Reproducible Builds",local:"1-consistent-and-reproducible-builds",headingTag:"h2"}}),w=new x({props:{title:"2. Simplified Dependency Management",local:"2-simplified-dependency-management",headingTag:"h2"}}),_=new x({props:{title:"3. Declarative Configuration",local:"3-declarative-configuration",headingTag:"h2"}}),T=new x({props:{title:"4. Isolated, Reliable Builds",local:"4-isolated-reliable-builds",headingTag:"h2"}}),E=new x({props:{title:"5. Efficient Caching and CI Integration",local:"5-efficient-caching-and-ci-integration",headingTag:"h2"}}),L=new x({props:{title:"6. Easy Experimentation and Rollbacks",local:"6-easy-experimentation-and-rollbacks",headingTag:"h2"}}),D=new x({props:{title:"Commonly Asked Questions",local:"commonly-asked-questions",headingTag:"h2"}}),B=new x({props:{title:"References",local:"references",headingTag:"h2"}}),W=new Ke({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/builder/why-nix.md"}}),{c(){g=a("meta"),U=l(),z=a("p"),K=l(),f($.$$.fragment),Q=l(),f(h.$$.fragment),F=l(),v=a("p"),v.textContent=Ce,G=l(),y=a("p"),y.textContent=be,J=l(),f(C.$$.fragment),V=l(),b=a("p"),b.textContent=we,X=l(),f(w.$$.fragment),Y=l(),k=a("p"),k.textContent=ke,Z=l(),f(_.$$.fragment),ee=l(),P=a("p"),P.textContent=_e,te=l(),f(T.$$.fragment),ie=l(),N=a("p"),N.textContent=Pe,ne=l(),f(E.$$.fragment),le=l(),M=a("p"),M.textContent=Te,se=l(),f(L.$$.fragment),ae=l(),I=a("p"),I.textContent=Ne,oe=l(),R=a("p"),R.textContent=Ee,re=l(),f(D.$$.fragment),fe=l(),H=a("p"),H.innerHTML=Me,pe=l(),S=a("p"),S.textContent=Le,me=l(),A=a("p"),A.textContent=Ie,ue=l(),de=a("hr"),ce=l(),q=a("p"),q.textContent=Re,ge=l(),f(B.$$.fragment),xe=l(),O=a("ul"),O.innerHTML=De,$e=l(),f(W.$$.fragment),he=l(),j=a("p"),this.h()},l(e){const t=ze("svelte-u9bgzb",document.head);g=o(t,"META",{name:!0,content:!0}),t.forEach(i),U=s(e),z=o(e,"P",{}),He(z).forEach(i),K=s(e),p($.$$.fragment,e),Q=s(e),p(h.$$.fragment,e),F=s(e),v=o(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-19rr82q"&&(v.textContent=Ce),G=s(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-1dnbspd"&&(y.textContent=be),J=s(e),p(C.$$.fragment,e),V=s(e),b=o(e,"P",{"data-svelte-h":!0}),r(b)!=="svelte-14umkdk"&&(b.textContent=we),X=s(e),p(w.$$.fragment,e),Y=s(e),k=o(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-13khqjp"&&(k.textContent=ke),Z=s(e),p(_.$$.fragment,e),ee=s(e),P=o(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-1jynnnz"&&(P.textContent=_e),te=s(e),p(T.$$.fragment,e),ie=s(e),N=o(e,"P",{"data-svelte-h":!0}),r(N)!=="svelte-4iis8t"&&(N.textContent=Pe),ne=s(e),p(E.$$.fragment,e),le=s(e),M=o(e,"P",{"data-svelte-h":!0}),r(M)!=="svelte-qxx44n"&&(M.textContent=Te),se=s(e),p(L.$$.fragment,e),ae=s(e),I=o(e,"P",{"data-svelte-h":!0}),r(I)!=="svelte-1g3r9ps"&&(I.textContent=Ne),oe=s(e),R=o(e,"P",{"data-svelte-h":!0}),r(R)!=="svelte-19u25e2"&&(R.textContent=Ee),re=s(e),p(D.$$.fragment,e),fe=s(e),H=o(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-gy8g5i"&&(H.innerHTML=Me),pe=s(e),S=o(e,"P",{"data-svelte-h":!0}),r(S)!=="svelte-16vhgao"&&(S.textContent=Le),me=s(e),A=o(e,"P",{"data-svelte-h":!0}),r(A)!=="svelte-1w64iyw"&&(A.textContent=Ie),ue=s(e),de=o(e,"HR",{}),ce=s(e),q=o(e,"P",{"data-svelte-h":!0}),r(q)!=="svelte-1v5nvop"&&(q.textContent=Re),ge=s(e),p(B.$$.fragment,e),xe=s(e),O=o(e,"UL",{"data-svelte-h":!0}),r(O)!=="svelte-8bs9w6"&&(O.innerHTML=De),$e=s(e),p(W.$$.fragment,e),he=s(e),j=o(e,"P",{}),He(j).forEach(i),this.h()},h(){Se(g,"name","hf:doc:metadata"),Se(g,"content",Fe)},m(e,t){je(document.head,g),n(e,U,t),n(e,z,t),n(e,K,t),m($,e,t),n(e,Q,t),m(h,e,t),n(e,F,t),n(e,v,t),n(e,G,t),n(e,y,t),n(e,J,t),m(C,e,t),n(e,V,t),n(e,b,t),n(e,X,t),m(w,e,t),n(e,Y,t),n(e,k,t),n(e,Z,t),m(_,e,t),n(e,ee,t),n(e,P,t),n(e,te,t),m(T,e,t),n(e,ie,t),n(e,N,t),n(e,ne,t),m(E,e,t),n(e,le,t),n(e,M,t),n(e,se,t),m(L,e,t),n(e,ae,t),n(e,I,t),n(e,oe,t),n(e,R,t),n(e,re,t),m(D,e,t),n(e,fe,t),n(e,H,t),n(e,pe,t),n(e,S,t),n(e,me,t),n(e,A,t),n(e,ue,t),n(e,de,t),n(e,ce,t),n(e,q,t),n(e,ge,t),m(B,e,t),n(e,xe,t),n(e,O,t),n(e,$e,t),m(W,e,t),n(e,he,t),n(e,j,t),ve=!0},p:qe,i(e){ve||(u($.$$.fragment,e),u(h.$$.fragment,e),u(C.$$.fragment,e),u(w.$$.fragment,e),u(_.$$.fragment,e),u(T.$$.fragment,e),u(E.$$.fragment,e),u(L.$$.fragment,e),u(D.$$.fragment,e),u(B.$$.fragment,e),u(W.$$.fragment,e),ve=!0)},o(e){d($.$$.fragment,e),d(h.$$.fragment,e),d(C.$$.fragment,e),d(w.$$.fragment,e),d(_.$$.fragment,e),d(T.$$.fragment,e),d(E.$$.fragment,e),d(L.$$.fragment,e),d(D.$$.fragment,e),d(B.$$.fragment,e),d(W.$$.fragment,e),ve=!1},d(e){e&&(i(U),i(z),i(K),i(Q),i(F),i(v),i(G),i(y),i(J),i(V),i(b),i(X),i(Y),i(k),i(Z),i(ee),i(P),i(te),i(ie),i(N),i(ne),i(le),i(M),i(se),i(ae),i(I),i(oe),i(R),i(re),i(fe),i(H),i(pe),i(S),i(me),i(A),i(ue),i(de),i(ce),i(q),i(ge),i(xe),i(O),i($e),i(he),i(j)),i(g),c($,e),c(h,e),c(C,e),c(w,e),c(_,e),c(T,e),c(E,e),c(L,e),c(D,e),c(B,e),c(W,e)}}}const Fe='{"title":"Why Nix?","local":"why-nix","sections":[{"title":"1. Consistent and Reproducible Builds","local":"1-consistent-and-reproducible-builds","sections":[],"depth":2},{"title":"2. Simplified Dependency Management","local":"2-simplified-dependency-management","sections":[],"depth":2},{"title":"3. Declarative Configuration","local":"3-declarative-configuration","sections":[],"depth":2},{"title":"4. Isolated, Reliable Builds","local":"4-isolated-reliable-builds","sections":[],"depth":2},{"title":"5. Efficient Caching and CI Integration","local":"5-efficient-caching-and-ci-integration","sections":[],"depth":2},{"title":"6. Easy Experimentation and Rollbacks","local":"6-easy-experimentation-and-rollbacks","sections":[],"depth":2},{"title":"Commonly Asked Questions","local":"commonly-asked-questions","sections":[],"depth":2},{"title":"References","local":"references","sections":[],"depth":2}],"depth":1}';function Ge(ye){return Be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ze extends Oe{constructor(g){super(),We(this,g,Ge,Qe,Ae,{})}}export{Ze as component};

Xet Storage Details

Size:
10.1 kB
·
Xet hash:
3c479065e2d26f94e1491bad9c252ff9dc866bd95db02443e1c5d2f69fbf1142

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