import{s as Ul,o as fl,n as ke}from"../chunks/scheduler.36a0863c.js";import{S as Cl,i as Zl,g as p,s as n,r as c,A as Al,h as i,f as l,c as t,j as Il,u as m,x as r,k as yl,y as vl,a,v as M,d as j,t as d,w}from"../chunks/index.9c13489a.js";import{T as Re}from"../chunks/Tip.3b06990e.js";import{C as T}from"../chunks/CodeBlock.05d8ec32.js";import{H as ge,E as Gl}from"../chunks/EditOnGithub.e88f2b7b.js";function Vl(h){let u,b="Questa funzionalità al momento è disponibile solo per PyTorch.";return{c(){u=p("p"),u.textContent=b},l(o){u=i(o,"P",{"data-svelte-h":!0}),r(u)!=="svelte-ecm9v3"&&(u.textContent=b)},m(o,J){a(o,u,J)},p:ke,d(o){o&&l(u)}}}function Bl(h){let u,b="Per addestramento multi-GPU richiede DDP (<code>torch.distributed.launch</code>).";return{c(){u=p("p"),u.innerHTML=b},l(o){u=i(o,"P",{"data-svelte-h":!0}),r(u)!=="svelte-o96oxl"&&(u.innerHTML=b)},m(o,J){a(o,u,J)},p:ke,d(o){o&&l(u)}}}function $l(h){let u,b="Questa funzionalità può essere usata con modelli basati su <code>nn.Module</code>.";return{c(){u=p("p"),u.innerHTML=b},l(o){u=i(o,"P",{"data-svelte-h":!0}),r(u)!=="svelte-9uk85f"&&(u.innerHTML=b)},m(o,J){a(o,u,J)},p:ke,d(o){o&&l(u)}}}function gl(h){let u,b,o,J,f,As,C,vs,Z,_e="Quando addestri o fai inferenza con <code>DistributedDataParallel</code> e GPU multiple, se si verificano problemi di intercomunicazione tra processi e/o nodi, puoi utilizzare il seguente script per diagnosticare i problemi della rete.",Gs,A,Vs,v,Le="Per esempio per testare come 2 GPU interagiscono fai:",Bs,G,$s,V,Ne="Se entrambi i processi sono in grado di comunicare tra loro e di allocare la memoria della GPU, ciascuno di essi stamperà lo stato OK.",gs,B,We="Per più GPU o nodi adatta gli argumenti nello script.",Rs,$,xe="All’interno dello script di diagnostica troverai molti altri dettagli e anche una guida per eseguirlo in ambiente SLURM.",ks,g,Ee="Un livello di debug superiore è aggiungere la variabile d’ambiente <code>NCCL_DEBUG=INFO</code> come di seguito:",_s,R,Ls,k,Qe="In questo modo si scaricano molte informazioni di debug relative a NCCL, che puoi cercare online in caso di problemi. Oppure, se non hai la sicurezza di come interpretare l’output, puoi condividere il file di log in una Issue.",Ns,_,Ws,I,xs,y,Es,U,Qs,L,Xe=`Se inizi a ottenere <code>loss=NaN</code> o il modello presenta qualche altro comportamento anomalo a causa di valori <code>inf</code> o <code>nan</code> in
attivazioni o nei pesi, è necessario scoprire dove si verifica il primo underflow o overflow e cosa lo ha determinato. Fortunatamente
è possibile farlo facilmente attivando un modulo speciale che effettuerà il rilevamento automaticamente.`,Xs,N,ze="Se stai usando <code>Trainer</code>, hai bisogno di aggiungere solo:",zs,W,Ds,x,De=`ai normali argomenti della riga di comando, o passa <code>debug=&quot;underflow_overflow&quot;</code> quando viene creato l’oggetto
<code>TrainingArguments</code>.`,Ss,E,Se="Se stai usando il tuo ciclo di allenamento o un altro trainer, puoi ottenere lo stesso risultato con:",Hs,Q,Ys,X,He=`<code>DebugUnderflowOverflow</code> inserisce dei ganci nel modello che dopo ogni chiamata
testeranno le variabili di ingresso e di uscita e anche i pesi del modulo corrispondente. Non appena viene rilevato <code>inf</code> o
o <code>nan</code> in almeno un elemento delle attivazioni o dei pesi, il programma lo notifica e stampa un rapporto come il seguente (questo è stato rilevato con <code>google/mt5-small</code> sotto fp16 mixed precision):`,Fs,z,Ps,D,Ye="L’output di esempio è stato tagliato al centro per brevità.",qs,S,Fe=`La seconda colonna mostra il valore dell’elemento più grande in assoluto,così se osserviamo da vicino gli ultimi istanti,
input e output sono nel range di <code>1e4</code>. Questo addestramento è stato eseguito con una mixed precision fp16 e l’ultimo passo usciva fuori (sotto <code>fp16</code> il valore più grande prima di <code>inf</code> è <code>64e3</code>). Per evitare overflows sotto <code>fp16</code> le attivazionioni devono rimanere molto al di sotto di <code>1e4</code>, perché <code>1e4 * 1e4 = 1e8</code> quindi qualsiasi moltiplicazione di matrice con grandi attivazioni porterà a una condizione di overflow numerico.`,Ks,H,Pe="All’inizio della traccia è possibile scoprire a quale lotto si è verificato il problema (questo <code>Detected inf/nan during batch_number=0</code> significa che il problema si è verificato nel primo lotto).",Os,Y,qe=`Ogni frame segnalato inizia dichiarando la voce completamente qualificata per il modulo corrispondente per il quale il frame è stato segnalato.
Se osserviamo il seguente frame:`,se,F,ee,P,Ke="Questo, <code>encoder.block.2.layer.1.layer_norm</code> indica che si tratta di un layer norm nel primo layer, del secondo blocco dell’encoder. E le chiamata specifica di <code>forward</code> è <code>T5LayerNorm</code>.",le,q,Oe="Osserviamo gli ultimi frame del report:",ae,K,ne,O,sl="L’ultimo frame report per la funzione <code>Dropout.forward</code> con la prima voce per l’unico input e la seconda per l’unico output. Si può notare che è stato richiamato da un attibuto <code>dropout</code> dentro la classe <code>DenseReluDense</code>. Si può notare che ciò è avvenuto durante il primo strato, del 2° blocco, durante il primissimo lotto. Infine, gli elementi di input più grandi in assoluto sono stati <code>6.27e+04</code> e l’equivalente per l’output era <code>inf</code>.",te,ss,el="Puoi vedere qui, che <code>T5DenseGatedGeluDense.forward</code> risulta in output activations, il cui valore massimo assoluto era circa 62,7K, che è molto vicino al limite massimo di 64K di fp16. Nel prossimo frame abbiamo <code>Dropout</code> che rinormalizza i pesi, dopo aver azzerato alcuni elementi, il che spinge il valore massimo assoluto a più di 64K e si verifica un overflow.(<code>inf</code>).",pe,es,ll="Come puoi notare, è nei frames precedenti che occorre esaminare quando i numeri iniziano a diventare molto grandi per i valori fp16.",ie,ls,al="Confrontiamo il report al codice <code>models/t5/modeling_t5.py</code>:",re,as,ue,ns,nl="Ora è facile vedere la chiamata <code>dropout</code>, e tutte le chiamate precedenti.",oe,ts,tl="Poiché il rilevamento avviene in un avanzamento (forward hook in eng.), i rapporti vengono creati immeditamente dopo ogni rientro da <code>forward</code> (forward returns in eng.).",ce,ps,pl="Tornando al rapporto completo, per agire e risolvere il problema, dobbiamo andare qualche frame più in alto, dove i numeri hanno iniziato a salire, e probabilmente passare alla modalità <code>fp32</code>, in modo che i numeri non trabocchino quando vengono moltiplicati o sommati. Naturalmente, potrebbero esserci altre soluzioni. Per esempio, potremmo spegnere temporanemante <code>amp</code> se è abilitato, successivamente spostare <code>forward</code> in un helper wrapper, come:",me,is,Me,rs,il=`Poiché il rilevatore automatico riporta solo gli ingressi e le uscite di fotogrammi completi, una volta che si sa dove cercare, si può
analizzare anche le fasi intermedie di una specifica funzione <code>forward</code>. In alcuni casi puoi usare la funzione di supporto <code>detect_overflow</code> per indirizzare il rilevatore dove preferisci, ad esempio:`,je,us,de,os,rl=`Si può vedere che abbiamo aggiunto 2 di questi e ora teniamo traccia se <code>inf</code> o <code>nan</code> per <code>forwarded_states</code> è stato rilevato
da qualche parte.`,we,cs,ul=`In realtà, il rilevatore li riporta già, perché ciascuna delle chiamate nell’esempio precedente è un <code>nn.Module</code>, ma
diciamo che se avessimo dei calcoli diretti locali, questo è il modo in cui lo faremmo.`,Te,ms,ol=`Inoltre, se si istanzia il debugger nel proprio codice, è possibile modificare il numero di fotogrammi stampati rispetto a
predefinito, ad esempio.:`,be,Ms,Je,js,he,ds,cl="La stessa classe di debug può essere utilizzata per il tracciamento per-batch con la funzione di rilevamento di underflow/overflow disattivata.",Ie,ws,ml=`Supponiamo di voler osservare i valori minimi e massimi assoluti per tutti gli ingredienti di ogni chiamata <code>forward</code> di un dato lotto.
lotto, e che lo si voglia fare solo per i lotti 1 e 3. Si istanzia questa classe come:`,ye,Ts,Ue,bs,Ml="Ora i batch completi 1 e 3 saranno tracciati utilizzando lo stesso formato del rilevatore di underflow/overflow.",fe,Js,jl="I batches sono 0-indexed.",Ce,hs,dl=`Questo è utile se si sa che il programma inizia a comportarsi male dopo un certo numero di batch, in modo da poter avanzare velocemente fino a quell’area.
direttamente a quell’area. Ecco un esempio di output troncato per questa configurazione:`,Ze,Is,Ae,ys,wl="Qui verrà scaricato un numero enorme di fotogrammi, tanti quanti sono le chiamate in avanti nel modello, quindi può essere o non essere quello che volete, ma a volte può essere più utile usarlo di un classico debugger. Per esempio, se il problema inizia a verificarsi a partire dal lotto numero 150. Quindi è possibile scaricare le tracce dei lotti 149 e 150 e confrontare i punti in cui i numeri hanno iniziato a divergere.",ve,Us,Tl="È inoltre possibile specificare il numero di batch dopo il quale interrompere l’addestramento, con:",Ge,fs,Ve,Cs,Be,Zs,$e;return f=new ge({props:{title:"Debugging",local:"debugging",headingTag:"h1"}}),C=new ge({props:{title:"Debug dei problemi di rete multi-GPU",local:"debug-dei-problemi-di-rete-multi-gpu",headingTag:"h2"}}),A=new T({props:{code:"d2dldCUyMGh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRmh1Z2dpbmdmYWNlJTJGdHJhbnNmb3JtZXJzJTJGbWFpbiUyRnNjcmlwdHMlMkZkaXN0cmlidXRlZCUyRnRvcmNoLWRpc3RyaWJ1dGVkLWdwdS10ZXN0LnB5",highlighted:"wget https://raw.githubusercontent.com/huggingface/transformers/main/scripts/distributed/torch-distributed-gpu-test.py",wrap:!1}}),G=new T({props:{code:"cHl0aG9uJTIwLW0lMjB0b3JjaC5kaXN0cmlidXRlZC5ydW4lMjAtLW5wcm9jX3Blcl9ub2RlJTIwMiUyMC0tbm5vZGVzJTIwMSUyMHRvcmNoLWRpc3RyaWJ1dGVkLWdwdS10ZXN0LnB5",highlighted:"python -m torch.distributed.run --nproc_per_node 2 --nnodes 1 torch-distributed-gpu-test.py",wrap:!1}}),R=new T({props:{code:"TkNDTF9ERUJVRyUzRElORk8lMjBweXRob24lMjAtbSUyMHRvcmNoLmRpc3RyaWJ1dGVkLnJ1biUyMC0tbnByb2NfcGVyX25vZGUlMjAyJTIwLS1ubm9kZXMlMjAxJTIwdG9yY2gtZGlzdHJpYnV0ZWQtZ3B1LXRlc3QucHk=",highlighted:"NCCL_DEBUG=INFO python -m torch.distributed.run --nproc_per_node 2 --nnodes 1 torch-distributed-gpu-test.py",wrap:!1}}),_=new ge({props:{title:"Rilevamento di Underflow e Overflow",local:"rilevamento-di-underflow-e-overflow",headingTag:"h2"}}),I=new Re({props:{$$slots:{default:[Vl]},$$scope:{ctx:h}}}),y=new Re({props:{$$slots:{default:[Bl]},$$scope:{ctx:h}}}),U=new Re({props:{$$slots:{default:[$l]},$$scope:{ctx:h}}}),W=new T({props:{code:"LS1kZWJ1ZyUyMHVuZGVyZmxvd19vdmVyZmxvdw==",highlighted:"--debug underflow_overflow",wrap:!1}}),Q=new T({props:{code:"ZnJvbSUyMC5kZWJ1Z191dGlscyUyMGltcG9ydCUyMERlYnVnVW5kZXJmbG93T3ZlcmZsb3clMEElMEFkZWJ1Z19vdmVyZmxvdyUyMCUzRCUyMERlYnVnVW5kZXJmbG93T3ZlcmZsb3cobW9kZWwp",highlighted:`<span class="hljs-keyword">from</span> .debug_utils <span class="hljs-keyword">import</span> DebugUnderflowOverflow

debug_overflow = DebugUnderflowOverflow(model)`,wrap:!1}}),z=new T({props:{code:"RGV0ZWN0ZWQlMjBpbmYlMkZuYW4lMjBkdXJpbmclMjBiYXRjaF9udW1iZXIlM0QwJTBBTGFzdCUyMDIxJTIwZm9yd2FyZCUyMGZyYW1lcyUzQSUwQWFicyUyMG1pbiUyMCUyMGFicyUyMG1heCUyMCUyMG1ldGFkYXRhJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci5ibG9jay4xLmxheWVyLjEuRGVuc2VSZWx1RGVuc2UuZHJvcG91dCUyMERyb3BvdXQlMEEwLjAwZSUyQjAwJTIwMi41N2UlMkIwMiUyMGlucHV0JTVCMCU1RCUwQTAuMDBlJTJCMDAlMjAyLjg1ZSUyQjAyJTIwb3V0cHV0JTBBJTVCLi4uJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci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2UlMkIwNCUyMGlucHV0JTVCMCU1RCUwQTAuMDBlJTJCMDAlMjAlMjAlMjAlMjAlMjAlMjBpbmYlMjBvdXRwdXQ=",highlighted:`<span class="hljs-attribute">Detected</span> inf/nan during batch_number=<span class="hljs-number">0</span>
<span class="hljs-attribute">Last</span> <span class="hljs-number">21</span> forward frames:
<span class="hljs-attribute">abs</span> min  abs max  metadata
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">1</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.dropout Dropout
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">2</span>.<span class="hljs-number">57</span>e+<span class="hljs-number">02</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">2</span>.<span class="hljs-number">85</span>e+<span class="hljs-number">02</span> output<span class="hljs-meta">
[...]</span>
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">0</span> T5LayerSelfAttention
<span class="hljs-attribute">6</span>.<span class="hljs-number">78</span>e-<span class="hljs-number">04</span> <span class="hljs-number">3</span>.<span class="hljs-number">15</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">2</span>.<span class="hljs-number">65</span>e-<span class="hljs-number">04</span> <span class="hljs-number">3</span>.<span class="hljs-number">42</span>e+<span class="hljs-number">03</span> output[<span class="hljs-number">0</span>]
             <span class="hljs-attribute">None</span> output[<span class="hljs-number">1</span>]
<span class="hljs-attribute">2</span>.<span class="hljs-number">25</span>e-<span class="hljs-number">01</span> <span class="hljs-number">1</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">04</span> output[<span class="hljs-number">2</span>]
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.layer_norm T5LayerNorm
<span class="hljs-attribute">8</span>.<span class="hljs-number">69</span>e-<span class="hljs-number">02</span> <span class="hljs-number">4</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">01</span> weight
<span class="hljs-attribute">2</span>.<span class="hljs-number">65</span>e-<span class="hljs-number">04</span> <span class="hljs-number">3</span>.<span class="hljs-number">42</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_0 Linear
<span class="hljs-attribute">2</span>.<span class="hljs-number">17</span>e-<span class="hljs-number">07</span> <span class="hljs-number">4</span>.<span class="hljs-number">50</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">2</span>.<span class="hljs-number">68</span>e-<span class="hljs-number">06</span> <span class="hljs-number">3</span>.<span class="hljs-number">70</span>e+<span class="hljs-number">01</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_1 Linear
<span class="hljs-attribute">8</span>.<span class="hljs-number">08</span>e-<span class="hljs-number">07</span> <span class="hljs-number">2</span>.<span class="hljs-number">66</span>e+<span class="hljs-number">01</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">1</span>.<span class="hljs-number">27</span>e-<span class="hljs-number">04</span> <span class="hljs-number">2</span>.<span class="hljs-number">37</span>e+<span class="hljs-number">02</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.dropout Dropout
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">8</span>.<span class="hljs-number">76</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">9</span>.<span class="hljs-number">74</span>e+<span class="hljs-number">03</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wo Linear
<span class="hljs-attribute">1</span>.<span class="hljs-number">01</span>e-<span class="hljs-number">06</span> <span class="hljs-number">6</span>.<span class="hljs-number">44</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">9</span>.<span class="hljs-number">74</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense T5DenseGatedGeluDense
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.dropout Dropout
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span>      inf output`,wrap:!1}}),F=new T({props:{code:"JTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci5ibG9jay4yLmxheWVyLjEubGF5ZXJfbm9ybSUyMFQ1TGF5ZXJOb3JtJTBBOC42OWUtMDIlMjA0LjE4ZS0wMSUyMHdlaWdodCUwQTIuNjVlLTA0JTIwMy40MmUlMkIwMyUyMGlucHV0JTVCMCU1RCUwQTEuNzllLTA2JTIwNC42NWUlMkIwMCUyMG91dHB1dA==",highlighted:`                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.layer_norm T5LayerNorm
<span class="hljs-attribute">8</span>.<span class="hljs-number">69</span>e-<span class="hljs-number">02</span> <span class="hljs-number">4</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">01</span> weight
<span class="hljs-attribute">2</span>.<span class="hljs-number">65</span>e-<span class="hljs-number">04</span> <span class="hljs-number">3</span>.<span class="hljs-number">42</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> output`,wrap:!1}}),K=new T({props:{code:"RGV0ZWN0ZWQlMjBpbmYlMkZuYW4lMjBkdXJpbmclMjBiYXRjaF9udW1iZXIlM0QwJTBBTGFzdCUyMDIxJTIwZm9yd2FyZCUyMGZyYW1lcyUzQSUwQWFicyUyMG1pbiUyMCUyMGFicyUyMG1heCUyMCUyMG1ldGFkYXRhJTBBJTVCLi4uJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTI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DYuMjdlJTJCMDQlMjBvdXRwdXQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGVyLmJsb2NrLjIubGF5ZXIuMS5kcm9wb3V0JTIwRHJvcG91dCUwQTMuMThlLTA0JTIwNi4yN2UlMkIwNCUyMGlucHV0JTVCMCU1RCUwQTAuMDBlJTJCMDAlMjAlMjAlMjAlMjAlMjAlMjBpbmYlMjBvdXRwdXQ=",highlighted:`<span class="hljs-attribute">Detected</span> inf/nan during batch_number=<span class="hljs-number">0</span>
<span class="hljs-attribute">Last</span> <span class="hljs-number">21</span> forward frames:
<span class="hljs-attribute">abs</span> min  abs max  metadata<span class="hljs-meta">
[...]</span>
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_0 Linear
<span class="hljs-attribute">2</span>.<span class="hljs-number">17</span>e-<span class="hljs-number">07</span> <span class="hljs-number">4</span>.<span class="hljs-number">50</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">2</span>.<span class="hljs-number">68</span>e-<span class="hljs-number">06</span> <span class="hljs-number">3</span>.<span class="hljs-number">70</span>e+<span class="hljs-number">01</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_1 Linear
<span class="hljs-attribute">8</span>.<span class="hljs-number">08</span>e-<span class="hljs-number">07</span> <span class="hljs-number">2</span>.<span class="hljs-number">66</span>e+<span class="hljs-number">01</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">1</span>.<span class="hljs-number">27</span>e-<span class="hljs-number">04</span> <span class="hljs-number">2</span>.<span class="hljs-number">37</span>e+<span class="hljs-number">02</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wo Linear
<span class="hljs-attribute">1</span>.<span class="hljs-number">01</span>e-<span class="hljs-number">06</span> <span class="hljs-number">6</span>.<span class="hljs-number">44</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">9</span>.<span class="hljs-number">74</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense T5DenseGatedGeluDense
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.dropout Dropout
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span>      inf output`,wrap:!1}}),as=new T({props:{code:"Y2xhc3MlM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MHNlbGYud2lfMShoaWRkZW5fc3RhdGVzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGhpZGRlbl9zdGF0ZXMlMjAlM0QlMjBoaWRkZW5fZ2VsdSUyMColMjBoaWRkZW5fbGluZWFyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaGlkZGVuX3N0YXRlcyUyMCUzRCUyMHNlbGYuZHJvcG91dChoaWRkZW5fc3RhdGVzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGhpZGRlbl9zdGF0ZXMlMjAlM0QlMjBzZWxmLndvKGhpZGRlbl9zdGF0ZXMpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwaGlkZGVuX3N0YXRlcw==",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">T5DenseGatedGeluDense</span>(nn.Module):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, config</span>):
        <span class="hljs-built_in">super</span>().__init__()
        self.wi_0 = nn.Linear(config.d_model, config.d_ff, bias=<span class="hljs-literal">False</span>)
        self.wi_1 = nn.Linear(config.d_model, config.d_ff, bias=<span class="hljs-literal">False</span>)
        self.wo = nn.Linear(config.d_ff, config.d_model, bias=<span class="hljs-literal">False</span>)
        self.dropout = nn.Dropout(config.dropout_rate)
        self.gelu_act = ACT2FN[<span class="hljs-string">&quot;gelu_new&quot;</span>]

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, hidden_states</span>):
        hidden_gelu = self.gelu_act(self.wi_0(hidden_states))
        hidden_linear = self.wi_1(hidden_states)
        hidden_states = hidden_gelu * hidden_linear
        hidden_states = self.dropout(hidden_states)
        hidden_states = self.wo(hidden_states)
        <span class="hljs-keyword">return</span> hidden_states`,wrap:!1}}),is=new T({props:{code:"ZGVmJTIwX2ZvcndhcmQoc2VsZiUyQyUyMGhpZGRlbl9zdGF0ZXMpJTNBJTBBJTIwJTIwJTIwJTIwaGlkZGVuX2dlbHUlMjAlM0QlMjBzZWxmLmdlbHVfYWN0KHNlbGYud2lfMChoaWRkZW5fc3RhdGVzKSklMEElMjAlMjAlMjAlMjBoaWRkZW5fbGluZWFyJTIwJTNEJTIwc2VsZi53aV8xKGhpZGRlbl9zdGF0ZXMpJTBBJTIwJTIwJTIwJTIwaGlkZGVuX3N0YXRlcyUyMCUzRCUyMGhpZGRlbl9nZWx1JTIwKiUyMGhpZGRlbl9saW5lYXIlMEElMjAlMjAlMjAlMjBoaWRkZW5fc3RhdGVzJTIwJTNEJTIwc2VsZi5kcm9wb3V0KGhpZGRlbl9zdGF0ZXMpJTBBJTIwJTIwJTIwJTIwaGlkZGVuX3N0YXRlcyUyMCUzRCUyMHNlbGYud28oaGlkZGVuX3N0YXRlcyklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBoaWRkZW5fc3RhdGVzJTBBJTBBJTBBaW1wb3J0JTIwdG9yY2glMEElMEElMEFkZWYlMjBmb3J3YXJkKHNlbGYlMkMlMjBoaWRkZW5fc3RhdGVzKSUzQSUwQSUyMCUyMCUyMCUyMGlmJTIwdG9yY2guaXNfYXV0b2Nhc3RfZW5hYmxlZCgpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwd2l0aCUyMHRvcmNoLmN1ZGEuYW1wLmF1dG9jYXN0KGVuYWJsZWQlM0RGYWxzZSklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBzZWxmLl9mb3J3YXJkKGhpZGRlbl9zdGF0ZXMpJTBBJTIwJTIwJTIwJTIwZWxzZSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMHNlbGYuX2ZvcndhcmQoaGlkZGVuX3N0YXRlcyk=",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">_forward</span>(<span class="hljs-params">self, hidden_states</span>):
    hidden_gelu = self.gelu_act(self.wi_0(hidden_states))
    hidden_linear = self.wi_1(hidden_states)
    hidden_states = hidden_gelu * hidden_linear
    hidden_states = self.dropout(hidden_states)
    hidden_states = self.wo(hidden_states)
    <span class="hljs-keyword">return</span> hidden_states


<span class="hljs-keyword">import</span> torch


<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, hidden_states</span>):
    <span class="hljs-keyword">if</span> torch.is_autocast_enabled():
        <span class="hljs-keyword">with</span> torch.cuda.amp.autocast(enabled=<span class="hljs-literal">False</span>):
            <span class="hljs-keyword">return</span> self._forward(hidden_states)
    <span class="hljs-keyword">else</span>:
        <span class="hljs-keyword">return</span> self._forward(hidden_states)`,wrap:!1}}),us=new T({props:{code:"ZnJvbSUyMGRlYnVnX3V0aWxzJTIwaW1wb3J0JTIwZGV0ZWN0X292ZXJmbG93JTBBJTBBJTBBY2xhc3MlMjBUNUxheWVyRkYobm4uTW9kdWxlKSUzQSUwQSUyMCUyMCUyMCUyMCU1Qi4uLiU1RCUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGZvcndhcmQoc2VsZiUyQyUyMGhpZGRlbl9zdGF0ZXMpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZm9yd2FyZGVkX3N0YXRlcyUyMCUzRCUyMHNlbGYubGF5ZXJfbm9ybShoaWRkZW5fc3RhdGVzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGRldGVjdF9vdmVyZmxvdyhmb3J3YXJkZWRfc3RhdGVzJTJDJTIwJTIyYWZ0ZXIlMjBsYXllcl9ub3JtJTIyKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZvcndhcmRlZF9zdGF0ZXMlMjAlM0QlMjBzZWxmLkRlbnNlUmVsdURlbnNlKGZvcndhcmRlZF9zdGF0ZXMpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZGV0ZWN0X292ZXJmbG93KGZvcndhcmRlZF9zdGF0ZXMlMkMlMjAlMjJhZnRlciUyMERlbnNlUmVsdURlbnNlJTIyKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGhpZGRlbl9zdGF0ZXMlMjAlMkIlMjBzZWxmLmRyb3BvdXQoZm9yd2FyZGVkX3N0YXRlcyk=",highlighted:`<span class="hljs-keyword">from</span> debug_utils <span class="hljs-keyword">import</span> detect_overflow


<span class="hljs-keyword">class</span> <span class="hljs-title class_">T5LayerFF</span>(nn.Module):
    [...]

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, hidden_states</span>):
        forwarded_states = self.layer_norm(hidden_states)
        detect_overflow(forwarded_states, <span class="hljs-string">&quot;after layer_norm&quot;</span>)
        forwarded_states = self.DenseReluDense(forwarded_states)
        detect_overflow(forwarded_states, <span class="hljs-string">&quot;after DenseReluDense&quot;</span>)
        <span class="hljs-keyword">return</span> hidden_states + self.dropout(forwarded_states)`,wrap:!1}}),Ms=new T({props:{code:"ZnJvbSUyMC5kZWJ1Z191dGlscyUyMGltcG9ydCUyMERlYnVnVW5kZXJmbG93T3ZlcmZsb3clMEElMEFkZWJ1Z19vdmVyZmxvdyUyMCUzRCUyMERlYnVnVW5kZXJmbG93T3ZlcmZsb3cobW9kZWwlMkMlMjBtYXhfZnJhbWVzX3RvX3NhdmUlM0QxMDAp",highlighted:`<span class="hljs-keyword">from</span> .debug_utils <span class="hljs-keyword">import</span> DebugUnderflowOverflow

debug_overflow = DebugUnderflowOverflow(model, max_frames_to_save=<span class="hljs-number">100</span>)`,wrap:!1}}),js=new ge({props:{title:"Tracciamento della mistura assoluta del lotto specifico e del valore massimo",local:"tracciamento-della-mistura-assoluta-del-lotto-specifico-e-del-valore-massimo",headingTag:"h3"}}),Ts=new T({props:{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwdHJhY2VfYmF0Y2hfbnVtcyUzRCU1QjElMkMlMjAzJTVEKQ==",highlighted:'debug_overflow = DebugUnderflowOverflow(model, trace_batch_nums=[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>])',wrap:!1}}),Is=new T({props:{code:"JTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKioqJTIwU3RhcnRpbmclMjBiYXRjaCUyMG51bWJlciUzRDElMjAqKiolMEFhYnMlMjBtaW4lMjAlMjBhYnMlMjBtYXglMjAlMjBtZXRhZGF0YSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNoYXJlZCUyMEVtYmVkZGluZyUwQTEuMDFlLTA2JTIwNy45MmUlMkIwMiUyMHdlaWdodCUwQTAuMDBlJTJCMDAlMjAyLjQ3ZSUyQjA0JTIwaW5wdXQlNUIwJTVEJTBBNS4zNmUtMDUlMjA3LjkyZSUyQjAyJTIwb3V0cHV0JTBBJTVCLi4uJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZGVjb2Rlci5kcm9wb3V0JTIwRHJvcG91dCUwQTEuNjBlLTA3JTIwMi4yN2UlMkIwMSUyMGlucHV0JTVCMCU1RCUwQTAuMDBlJTJCMDAlMjAyLjUyZSUyQjAxJTIwb3V0cHV0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZGVjb2RlciUyMFQ1U3RhY2slMEElMjAlMjAlMjAlMjAlMjBub3QlMjBhJTIwdGVuc29yJTIwb3V0cHV0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbG1faGVhZCUyMExpbmVhciUwQTEuMDFlLTA2JTIwNy45MmUlMkIwMiUyMHdlaWdodCUwQTAuMDBlJTJCMDAlMjAxLjExZSUyQjAwJTIwaW5wdXQlNUIwJTVEJTBBNi4wNmUtMDIlMjA4LjM5ZSUyQjAxJTIwb3V0cHV0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwVDVGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMjAlMjAlMjAlMjAlMjBub3QlMjBhJTIwdGVuc29yJTIwb3V0cHV0JTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKioqJTIwU3RhcnRpbmclMjBiYXRjaCUyMG51bWJlciUzRDMlMjAqKiolMEFhYnMlMjBtaW4lMjAlMjBhYnMlMjBtYXglMjAlMjBtZXRhZGF0YSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNoYXJlZCUyMEVtYmVkZGluZyUwQTEuMDFlLTA2JTIwNy45MmUlMkIwMiUyMHdlaWdodCUwQTAuMDBlJTJCMDAlMjAyLjc4ZSUyQjA0JTIwaW5wdXQlNUIwJTVEJTBBNS4zNmUtMDUlMjA3LjkyZSUyQjAyJTIwb3V0cHV0JTBBJTVCLi4uJTVE",highlighted:`                  *** Starting batch number=1 ***
abs min  abs max  metadata
                  shared Embedding
1.01e<span class="hljs-string">-06</span> 7.92e<span class="hljs-string">+02</span> weight
0.00e<span class="hljs-string">+00</span> 2.47e<span class="hljs-string">+04</span> input[0]
5.36e<span class="hljs-string">-05</span> 7.92e<span class="hljs-string">+02</span> output
[...]
                  decoder.dropout Dropout
1.60e<span class="hljs-string">-07</span> 2.27e<span class="hljs-string">+01</span> input[0]
0.00e<span class="hljs-string">+00</span> 2.52e<span class="hljs-string">+01</span> output
                  decoder T5Stack
     not a tensor output
                  lm_head Linear
1.01e<span class="hljs-string">-06</span> 7.92e<span class="hljs-string">+02</span> weight
0.00e<span class="hljs-string">+00</span> 1.11e<span class="hljs-string">+00</span> input[0]
6.06e<span class="hljs-string">-02</span> 8.39e<span class="hljs-string">+01</span> output
                   T5ForConditionalGeneration
     not a tensor output

                  *** Starting batch number=3 ***
abs min  abs max  metadata
                  shared Embedding
1.01e<span class="hljs-string">-06</span> 7.92e<span class="hljs-string">+02</span> weight
0.00e<span class="hljs-string">+00</span> 2.78e<span class="hljs-string">+04</span> input[0]
5.36e<span class="hljs-string">-05</span> 7.92e<span class="hljs-string">+02</span> output
[...]`,wrap:!1}}),fs=new T({props:{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwdHJhY2VfYmF0Y2hfbnVtcyUzRCU1QjElMkMlMjAzJTVEJTJDJTIwYWJvcnRfYWZ0ZXJfYmF0Y2hfbnVtJTNEMyk=",highlighted:'debug_overflow = DebugUnderflowOverflow(model, trace_batch_nums=[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>], abort_after_batch_num=<span class="hljs-number">3</span>)',wrap:!1}}),Cs=new Gl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/it/debugging.md"}}),{c(){u=p("meta"),b=n(),o=p("p"),J=n(),c(f.$$.fragment),As=n(),c(C.$$.fragment),vs=n(),Z=p("p"),Z.innerHTML=_e,Gs=n(),c(A.$$.fragment),Vs=n(),v=p("p"),v.textContent=Le,Bs=n(),c(G.$$.fragment),$s=n(),V=p("p"),V.textContent=Ne,gs=n(),B=p("p"),B.textContent=We,Rs=n(),$=p("p"),$.textContent=xe,ks=n(),g=p("p"),g.innerHTML=Ee,_s=n(),c(R.$$.fragment),Ls=n(),k=p("p"),k.textContent=Qe,Ns=n(),c(_.$$.fragment),Ws=n(),c(I.$$.fragment),xs=n(),c(y.$$.fragment),Es=n(),c(U.$$.fragment),Qs=n(),L=p("p"),L.innerHTML=Xe,Xs=n(),N=p("p"),N.innerHTML=ze,zs=n(),c(W.$$.fragment),Ds=n(),x=p("p"),x.innerHTML=De,Ss=n(),E=p("p"),E.textContent=Se,Hs=n(),c(Q.$$.fragment),Ys=n(),X=p("p"),X.innerHTML=He,Fs=n(),c(z.$$.fragment),Ps=n(),D=p("p"),D.textContent=Ye,qs=n(),S=p("p"),S.innerHTML=Fe,Ks=n(),H=p("p"),H.innerHTML=Pe,Os=n(),Y=p("p"),Y.textContent=qe,se=n(),c(F.$$.fragment),ee=n(),P=p("p"),P.innerHTML=Ke,le=n(),q=p("p"),q.textContent=Oe,ae=n(),c(K.$$.fragment),ne=n(),O=p("p"),O.innerHTML=sl,te=n(),ss=p("p"),ss.innerHTML=el,pe=n(),es=p("p"),es.textContent=ll,ie=n(),ls=p("p"),ls.innerHTML=al,re=n(),c(as.$$.fragment),ue=n(),ns=p("p"),ns.innerHTML=nl,oe=n(),ts=p("p"),ts.innerHTML=tl,ce=n(),ps=p("p"),ps.innerHTML=pl,me=n(),c(is.$$.fragment),Me=n(),rs=p("p"),rs.innerHTML=il,je=n(),c(us.$$.fragment),de=n(),os=p("p"),os.innerHTML=rl,we=n(),cs=p("p"),cs.innerHTML=ul,Te=n(),ms=p("p"),ms.textContent=ol,be=n(),c(Ms.$$.fragment),Je=n(),c(js.$$.fragment),he=n(),ds=p("p"),ds.textContent=cl,Ie=n(),ws=p("p"),ws.innerHTML=ml,ye=n(),c(Ts.$$.fragment),Ue=n(),bs=p("p"),bs.textContent=Ml,fe=n(),Js=p("p"),Js.textContent=jl,Ce=n(),hs=p("p"),hs.textContent=dl,Ze=n(),c(Is.$$.fragment),Ae=n(),ys=p("p"),ys.textContent=wl,ve=n(),Us=p("p"),Us.textContent=Tl,Ge=n(),c(fs.$$.fragment),Ve=n(),c(Cs.$$.fragment),Be=n(),Zs=p("p"),this.h()},l(s){const e=Al("svelte-u9bgzb",document.head);u=i(e,"META",{name:!0,content:!0}),e.forEach(l),b=t(s),o=i(s,"P",{}),Il(o).forEach(l),J=t(s),m(f.$$.fragment,s),As=t(s),m(C.$$.fragment,s),vs=t(s),Z=i(s,"P",{"data-svelte-h":!0}),r(Z)!=="svelte-1hyjvm9"&&(Z.innerHTML=_e),Gs=t(s),m(A.$$.fragment,s),Vs=t(s),v=i(s,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1vrdhm3"&&(v.textContent=Le),Bs=t(s),m(G.$$.fragment,s),$s=t(s),V=i(s,"P",{"data-svelte-h":!0}),r(V)!=="svelte-1vjn6kw"&&(V.textContent=Ne),gs=t(s),B=i(s,"P",{"data-svelte-h":!0}),r(B)!=="svelte-1miebc0"&&(B.textContent=We),Rs=t(s),$=i(s,"P",{"data-svelte-h":!0}),r($)!=="svelte-egqa4x"&&($.textContent=xe),ks=t(s),g=i(s,"P",{"data-svelte-h":!0}),r(g)!=="svelte-1tcqpd7"&&(g.innerHTML=Ee),_s=t(s),m(R.$$.fragment,s),Ls=t(s),k=i(s,"P",{"data-svelte-h":!0}),r(k)!=="svelte-mci54i"&&(k.textContent=Qe),Ns=t(s),m(_.$$.fragment,s),Ws=t(s),m(I.$$.fragment,s),xs=t(s),m(y.$$.fragment,s),Es=t(s),m(U.$$.fragment,s),Qs=t(s),L=i(s,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1m6be6"&&(L.innerHTML=Xe),Xs=t(s),N=i(s,"P",{"data-svelte-h":!0}),r(N)!=="svelte-2w4vg4"&&(N.innerHTML=ze),zs=t(s),m(W.$$.fragment,s),Ds=t(s),x=i(s,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1k981gw"&&(x.innerHTML=De),Ss=t(s),E=i(s,"P",{"data-svelte-h":!0}),r(E)!=="svelte-4ei2dy"&&(E.textContent=Se),Hs=t(s),m(Q.$$.fragment,s),Ys=t(s),X=i(s,"P",{"data-svelte-h":!0}),r(X)!=="svelte-6tyy5y"&&(X.innerHTML=He),Fs=t(s),m(z.$$.fragment,s),Ps=t(s),D=i(s,"P",{"data-svelte-h":!0}),r(D)!=="svelte-kogqcu"&&(D.textContent=Ye),qs=t(s),S=i(s,"P",{"data-svelte-h":!0}),r(S)!=="svelte-8epfn9"&&(S.innerHTML=Fe),Ks=t(s),H=i(s,"P",{"data-svelte-h":!0}),r(H)!=="svelte-dpn4oc"&&(H.innerHTML=Pe),Os=t(s),Y=i(s,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-1rpi62k"&&(Y.textContent=qe),se=t(s),m(F.$$.fragment,s),ee=t(s),P=i(s,"P",{"data-svelte-h":!0}),r(P)!=="svelte-uzqol6"&&(P.innerHTML=Ke),le=t(s),q=i(s,"P",{"data-svelte-h":!0}),r(q)!=="svelte-yq6hxy"&&(q.textContent=Oe),ae=t(s),m(K.$$.fragment,s),ne=t(s),O=i(s,"P",{"data-svelte-h":!0}),r(O)!=="svelte-1ozg43v"&&(O.innerHTML=sl),te=t(s),ss=i(s,"P",{"data-svelte-h":!0}),r(ss)!=="svelte-1ctj5ht"&&(ss.innerHTML=el),pe=t(s),es=i(s,"P",{"data-svelte-h":!0}),r(es)!=="svelte-ye3dns"&&(es.textContent=ll),ie=t(s),ls=i(s,"P",{"data-svelte-h":!0}),r(ls)!=="svelte-x6ixjy"&&(ls.innerHTML=al),re=t(s),m(as.$$.fragment,s),ue=t(s),ns=i(s,"P",{"data-svelte-h":!0}),r(ns)!=="svelte-1779sq1"&&(ns.innerHTML=nl),oe=t(s),ts=i(s,"P",{"data-svelte-h":!0}),r(ts)!=="svelte-1qyizrp"&&(ts.innerHTML=tl),ce=t(s),ps=i(s,"P",{"data-svelte-h":!0}),r(ps)!=="svelte-6pjqi9"&&(ps.innerHTML=pl),me=t(s),m(is.$$.fragment,s),Me=t(s),rs=i(s,"P",{"data-svelte-h":!0}),r(rs)!=="svelte-nw19bs"&&(rs.innerHTML=il),je=t(s),m(us.$$.fragment,s),de=t(s),os=i(s,"P",{"data-svelte-h":!0}),r(os)!=="svelte-1m3tmw7"&&(os.innerHTML=rl),we=t(s),cs=i(s,"P",{"data-svelte-h":!0}),r(cs)!=="svelte-1kpe9jg"&&(cs.innerHTML=ul),Te=t(s),ms=i(s,"P",{"data-svelte-h":!0}),r(ms)!=="svelte-1gdmp6v"&&(ms.textContent=ol),be=t(s),m(Ms.$$.fragment,s),Je=t(s),m(js.$$.fragment,s),he=t(s),ds=i(s,"P",{"data-svelte-h":!0}),r(ds)!=="svelte-1ic92zk"&&(ds.textContent=cl),Ie=t(s),ws=i(s,"P",{"data-svelte-h":!0}),r(ws)!=="svelte-12o5m27"&&(ws.innerHTML=ml),ye=t(s),m(Ts.$$.fragment,s),Ue=t(s),bs=i(s,"P",{"data-svelte-h":!0}),r(bs)!=="svelte-jzxj8u"&&(bs.textContent=Ml),fe=t(s),Js=i(s,"P",{"data-svelte-h":!0}),r(Js)!=="svelte-1q6w0pe"&&(Js.textContent=jl),Ce=t(s),hs=i(s,"P",{"data-svelte-h":!0}),r(hs)!=="svelte-w6uanh"&&(hs.textContent=dl),Ze=t(s),m(Is.$$.fragment,s),Ae=t(s),ys=i(s,"P",{"data-svelte-h":!0}),r(ys)!=="svelte-16p7gx8"&&(ys.textContent=wl),ve=t(s),Us=i(s,"P",{"data-svelte-h":!0}),r(Us)!=="svelte-1ptunxg"&&(Us.textContent=Tl),Ge=t(s),m(fs.$$.fragment,s),Ve=t(s),m(Cs.$$.fragment,s),Be=t(s),Zs=i(s,"P",{}),Il(Zs).forEach(l),this.h()},h(){yl(u,"name","hf:doc:metadata"),yl(u,"content",Rl)},m(s,e){vl(document.head,u),a(s,b,e),a(s,o,e),a(s,J,e),M(f,s,e),a(s,As,e),M(C,s,e),a(s,vs,e),a(s,Z,e),a(s,Gs,e),M(A,s,e),a(s,Vs,e),a(s,v,e),a(s,Bs,e),M(G,s,e),a(s,$s,e),a(s,V,e),a(s,gs,e),a(s,B,e),a(s,Rs,e),a(s,$,e),a(s,ks,e),a(s,g,e),a(s,_s,e),M(R,s,e),a(s,Ls,e),a(s,k,e),a(s,Ns,e),M(_,s,e),a(s,Ws,e),M(I,s,e),a(s,xs,e),M(y,s,e),a(s,Es,e),M(U,s,e),a(s,Qs,e),a(s,L,e),a(s,Xs,e),a(s,N,e),a(s,zs,e),M(W,s,e),a(s,Ds,e),a(s,x,e),a(s,Ss,e),a(s,E,e),a(s,Hs,e),M(Q,s,e),a(s,Ys,e),a(s,X,e),a(s,Fs,e),M(z,s,e),a(s,Ps,e),a(s,D,e),a(s,qs,e),a(s,S,e),a(s,Ks,e),a(s,H,e),a(s,Os,e),a(s,Y,e),a(s,se,e),M(F,s,e),a(s,ee,e),a(s,P,e),a(s,le,e),a(s,q,e),a(s,ae,e),M(K,s,e),a(s,ne,e),a(s,O,e),a(s,te,e),a(s,ss,e),a(s,pe,e),a(s,es,e),a(s,ie,e),a(s,ls,e),a(s,re,e),M(as,s,e),a(s,ue,e),a(s,ns,e),a(s,oe,e),a(s,ts,e),a(s,ce,e),a(s,ps,e),a(s,me,e),M(is,s,e),a(s,Me,e),a(s,rs,e),a(s,je,e),M(us,s,e),a(s,de,e),a(s,os,e),a(s,we,e),a(s,cs,e),a(s,Te,e),a(s,ms,e),a(s,be,e),M(Ms,s,e),a(s,Je,e),M(js,s,e),a(s,he,e),a(s,ds,e),a(s,Ie,e),a(s,ws,e),a(s,ye,e),M(Ts,s,e),a(s,Ue,e),a(s,bs,e),a(s,fe,e),a(s,Js,e),a(s,Ce,e),a(s,hs,e),a(s,Ze,e),M(Is,s,e),a(s,Ae,e),a(s,ys,e),a(s,ve,e),a(s,Us,e),a(s,Ge,e),M(fs,s,e),a(s,Ve,e),M(Cs,s,e),a(s,Be,e),a(s,Zs,e),$e=!0},p(s,[e]){const bl={};e&2&&(bl.$$scope={dirty:e,ctx:s}),I.$set(bl);const Jl={};e&2&&(Jl.$$scope={dirty:e,ctx:s}),y.$set(Jl);const hl={};e&2&&(hl.$$scope={dirty:e,ctx:s}),U.$set(hl)},i(s){$e||(j(f.$$.fragment,s),j(C.$$.fragment,s),j(A.$$.fragment,s),j(G.$$.fragment,s),j(R.$$.fragment,s),j(_.$$.fragment,s),j(I.$$.fragment,s),j(y.$$.fragment,s),j(U.$$.fragment,s),j(W.$$.fragment,s),j(Q.$$.fragment,s),j(z.$$.fragment,s),j(F.$$.fragment,s),j(K.$$.fragment,s),j(as.$$.fragment,s),j(is.$$.fragment,s),j(us.$$.fragment,s),j(Ms.$$.fragment,s),j(js.$$.fragment,s),j(Ts.$$.fragment,s),j(Is.$$.fragment,s),j(fs.$$.fragment,s),j(Cs.$$.fragment,s),$e=!0)},o(s){d(f.$$.fragment,s),d(C.$$.fragment,s),d(A.$$.fragment,s),d(G.$$.fragment,s),d(R.$$.fragment,s),d(_.$$.fragment,s),d(I.$$.fragment,s),d(y.$$.fragment,s),d(U.$$.fragment,s),d(W.$$.fragment,s),d(Q.$$.fragment,s),d(z.$$.fragment,s),d(F.$$.fragment,s),d(K.$$.fragment,s),d(as.$$.fragment,s),d(is.$$.fragment,s),d(us.$$.fragment,s),d(Ms.$$.fragment,s),d(js.$$.fragment,s),d(Ts.$$.fragment,s),d(Is.$$.fragment,s),d(fs.$$.fragment,s),d(Cs.$$.fragment,s),$e=!1},d(s){s&&(l(b),l(o),l(J),l(As),l(vs),l(Z),l(Gs),l(Vs),l(v),l(Bs),l($s),l(V),l(gs),l(B),l(Rs),l($),l(ks),l(g),l(_s),l(Ls),l(k),l(Ns),l(Ws),l(xs),l(Es),l(Qs),l(L),l(Xs),l(N),l(zs),l(Ds),l(x),l(Ss),l(E),l(Hs),l(Ys),l(X),l(Fs),l(Ps),l(D),l(qs),l(S),l(Ks),l(H),l(Os),l(Y),l(se),l(ee),l(P),l(le),l(q),l(ae),l(ne),l(O),l(te),l(ss),l(pe),l(es),l(ie),l(ls),l(re),l(ue),l(ns),l(oe),l(ts),l(ce),l(ps),l(me),l(Me),l(rs),l(je),l(de),l(os),l(we),l(cs),l(Te),l(ms),l(be),l(Je),l(he),l(ds),l(Ie),l(ws),l(ye),l(Ue),l(bs),l(fe),l(Js),l(Ce),l(hs),l(Ze),l(Ae),l(ys),l(ve),l(Us),l(Ge),l(Ve),l(Be),l(Zs)),l(u),w(f,s),w(C,s),w(A,s),w(G,s),w(R,s),w(_,s),w(I,s),w(y,s),w(U,s),w(W,s),w(Q,s),w(z,s),w(F,s),w(K,s),w(as,s),w(is,s),w(us,s),w(Ms,s),w(js,s),w(Ts,s),w(Is,s),w(fs,s),w(Cs,s)}}}const Rl='{"title":"Debugging","local":"debugging","sections":[{"title":"Debug dei problemi di rete multi-GPU","local":"debug-dei-problemi-di-rete-multi-gpu","sections":[],"depth":2},{"title":"Rilevamento di Underflow e Overflow","local":"rilevamento-di-underflow-e-overflow","sections":[{"title":"Tracciamento della mistura assoluta del lotto specifico e del valore massimo","local":"tracciamento-della-mistura-assoluta-del-lotto-specifico-e-del-valore-massimo","sections":[],"depth":3}],"depth":2}],"depth":1}';function kl(h){return fl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class El extends Cl{constructor(u){super(),Zl(this,u,kl,gl,Ul,{})}}export{El as component};
