hynky HF staff commited on
Commit
8bf5408
·
1 Parent(s): 5b7848c
README.md CHANGED
@@ -27,3 +27,23 @@ npm run dev
27
  npm run build
28
  // And commit the dist folder
29
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  npm run build
28
  // And commit the dist folder
29
  ```
30
+
31
+ ## Loading HTML fragments:
32
+ There are two way to load HTML fragments:
33
+ 1. Compile them into html during build time
34
+ 2. Fetch them and insert them during run-time
35
+
36
+ ## When to use what
37
+ - Use compile time fragments only on parts which you want to ensure are seen by every user right after page load (e.g logo)
38
+ - Use run-time fragments for everything else so that the final HTML is of reasonable size (<1MB idealy)
39
+
40
+ ## How to add a new fragment
41
+ - Add it to the `src/fragments` folder (e.g. `src/fragments/banner.html`)
42
+ - For run-time fragments, add {{{fragment-name}}} to appropriate place in `src/index.html` (e.g. {{{fragment-banner}}})
43
+ - For compile-time fragments, add <div id="fragment-name"></div> to `src/index.html` where you want to insert the fragment (e.g. <div id="fragment-banner"></div>)
44
+
45
+
46
+ ## How to know which fragments are available
47
+ - Run `npm run dev` and look at the console for available fragments
48
+
49
+
dist/fragments/banner.html ADDED
The diff for this file is too large to render. See raw diff
 
dist/fragments/benchmarks_interactive.html ADDED
The diff for this file is too large to render. See raw diff
 
dist/fragments/memory-profile.html ADDED
The diff for this file is too large to render. See raw diff
 
dist/fragments/memory-recomputation.html ADDED
@@ -0,0 +1 @@
 
 
1
+ <div> <div id=3a29a7b6-5a6e-4e51-aabe-515dafefbd63 class=plotly-graph-div style="height:500px; width:850px;"></div> <script>window.PLOTLYENV=window.PLOTLYENV||{},document.getElementById("3a29a7b6-5a6e-4e51-aabe-515dafefbd63")&&Plotly.newPlot("3a29a7b6-5a6e-4e51-aabe-515dafefbd63",[{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(78, 165, 183)"},name:"parameters",showlegend:!0,visible:!0,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAEjnD0AAAAAASPcPQAAAAACkCxBAAAAAAKQrEEA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(227, 138, 66)"},name:"gradients",showlegend:!0,visible:!0,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAEjnD0AAAAAASPcPQAAAAACkCxBAAAAAAKQrEEA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(232, 137, 171)"},name:"optimizer",showlegend:!0,visible:!0,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAEjnH0AAAAAASPcfQAAAAACkCyBAAAAAAKQrIEA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(206, 192, 250)"},name:"activations",showlegend:!0,visible:!0,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAACEDEAAAAAAAEIoQAAAAAAAIUZAAAAAAIAQZUA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(78, 165, 183)"},name:"parameters",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAKWXKkAAAAAApZ0qQAAAAAClqSpAAAAAAKXBKkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(227, 138, 66)"},name:"gradients",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAKWXKkAAAAAApZ0qQAAAAAClqSpAAAAAAKXBKkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(232, 137, 171)"},name:"optimizer",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAKWXOkAAAAAApZ06QAAAAAClqTpAAAAAAKXBOkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(206, 192, 250)"},name:"activations",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAABLGEAAAAAAgLUyQAAAAACA1U9AAAAAAMAKbUA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(78, 165, 183)"},name:"parameters",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAKL6OUAAAAAAov45QAAAAACiBjpAAAAAAKIWOkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(227, 138, 66)"},name:"gradients",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAKL6OUAAAAAAov45QAAAAACiBjpAAAAAAKIWOkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(232, 137, 171)"},name:"optimizer",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAKL6SUAAAAAAov5JQAAAAACiBkpAAAAAAKIWSkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(206, 192, 250)"},name:"activations",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAACCIkAAAAAAAII8QAAAAAAAQVhAAAAAAIAgdkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(78, 165, 183)"},name:"parameters",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAgER/bkAAAACARIBuQAAAAIBEgm5AAAAAgESGbkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(227, 138, 66)"},name:"gradients",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAgER/bkAAAACARIBuQAAAAIBEgm5AAAAAgESGbkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(232, 137, 171)"},name:"optimizer",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAgER/fkAAAACARIB+QAAAAIBEgn5AAAAAgESGfkA="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(206, 192, 250)"},name:"activations",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAAAhR0AAAAAAgNBhQAAAAACAUH5AAAAAAECom0A="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(78, 165, 183)"},name:"parameters",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAgPa/l0AAAACANsCXQAAAAIC2wJdAAAAAgLbBl0A="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(227, 138, 66)"},name:"gradients",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAgPa/l0AAAACANsCXQAAAAIC2wJdAAAAAgLbBl0A="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(232, 137, 171)"},name:"optimizer",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAgPa/p0AAAACANsCnQAAAAIC2wKdAAAAAgLbBp0A="},type:"bar"},{hovertemplate:"Seq len=%{x}<br>Mem=%{y:.1f}GB<br>%{data.name}<extra></extra>",marker:{color:"rgb(206, 192, 250)"},name:"activations",showlegend:!0,visible:!1,x:["1024","2048","4096","8192"],y:{dtype:"f8",bdata:"AAAAAIA2YkAAAAAAgA58QAAAAABA35dAAAAAAKDHtUA="},type:"bar"}],{template:{data:{barpolar:[{marker:{line:{color:"white",width:.5},pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"barpolar"}],bar:[{error_x:{color:"#2a3f5f"},error_y:{color:"#2a3f5f"},marker:{line:{color:"white",width:.5},pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"bar"}],carpet:[{aaxis:{endlinecolor:"#2a3f5f",gridcolor:"#C8D4E3",linecolor:"#C8D4E3",minorgridcolor:"#C8D4E3",startlinecolor:"#2a3f5f"},baxis:{endlinecolor:"#2a3f5f",gridcolor:"#C8D4E3",linecolor:"#C8D4E3",minorgridcolor:"#C8D4E3",startlinecolor:"#2a3f5f"},type:"carpet"}],choropleth:[{colorbar:{outlinewidth:0,ticks:""},type:"choropleth"}],contourcarpet:[{colorbar:{outlinewidth:0,ticks:""},type:"contourcarpet"}],contour:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"contour"}],heatmap:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"heatmap"}],histogram2dcontour:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"histogram2dcontour"}],histogram2d:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"histogram2d"}],histogram:[{marker:{pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"histogram"}],mesh3d:[{colorbar:{outlinewidth:0,ticks:""},type:"mesh3d"}],parcoords:[{line:{colorbar:{outlinewidth:0,ticks:""}},type:"parcoords"}],pie:[{automargin:!0,type:"pie"}],scatter3d:[{line:{colorbar:{outlinewidth:0,ticks:""}},marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatter3d"}],scattercarpet:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattercarpet"}],scattergeo:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattergeo"}],scattergl:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattergl"}],scattermapbox:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattermapbox"}],scattermap:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattermap"}],scatterpolargl:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterpolargl"}],scatterpolar:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterpolar"}],scatter:[{fillpattern:{fillmode:"overlay",size:10,solidity:.2},type:"scatter"}],scatterternary:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterternary"}],surface:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"surface"}],table:[{cells:{fill:{color:"#EBF0F8"},line:{color:"white"}},header:{fill:{color:"#C8D4E3"},line:{color:"white"}},type:"table"}]},layout:{annotationdefaults:{arrowcolor:"#2a3f5f",arrowhead:0,arrowwidth:1},autotypenumbers:"strict",coloraxis:{colorbar:{outlinewidth:0,ticks:""}},colorscale:{diverging:[[0,"#8e0152"],[.1,"#c51b7d"],[.2,"#de77ae"],[.3,"#f1b6da"],[.4,"#fde0ef"],[.5,"#f7f7f7"],[.6,"#e6f5d0"],[.7,"#b8e186"],[.8,"#7fbc41"],[.9,"#4d9221"],[1,"#276419"]],sequential:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],sequentialminus:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]]},colorway:["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],font:{color:"#2a3f5f"},geo:{bgcolor:"white",lakecolor:"white",landcolor:"white",showlakes:!0,showland:!0,subunitcolor:"#C8D4E3"},hoverlabel:{align:"left"},hovermode:"closest",mapbox:{style:"light"},paper_bgcolor:"white",plot_bgcolor:"white",polar:{angularaxis:{gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:""},bgcolor:"white",radialaxis:{gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:""}},scene:{xaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"},yaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"},zaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"}},shapedefaults:{line:{color:"#2a3f5f"}},ternary:{aaxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""},baxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""},bgcolor:"white",caxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""}},title:{x:.05},xaxis:{automargin:!0,gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:"",title:{standoff:15},zerolinecolor:"#EBF0F8",zerolinewidth:2},yaxis:{automargin:!0,gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:"",title:{standoff:15},zerolinecolor:"#EBF0F8",zerolinewidth:2}}},title:{text:"Memory Usage with Recomputation",x:.5,y:.95},margin:{r:80},legend:{y:.95,x:1.02,xanchor:"left",yanchor:"top"},updatemenus:[{active:0,buttons:[{args:[{visible:[!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1]},{"yaxis.range":[0,203.1547058105469]}],label:"1B",method:"update"},{args:[{visible:[!1,!1,!1,!1,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1]},{"yaxis.range":[0,314.4336639404297]}],label:"3B",method:"update"},{args:[{visible:[!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1]},{"yaxis.range":[0,504.2233764648438]}],label:"8B",method:"update"},{args:[{visible:[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!1,!1,!1,!1]},{"yaxis.range":[0,3021.530541992188]}],label:"70B",method:"update"},{args:[{visible:[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0]},{"yaxis.range":[0,12823.0716796875]}],label:"405B",method:"update"}],direction:"down",showactive:!0,x:1.035,xanchor:"left",y:.6,yanchor:"top"},{active:0,buttons:[{args:[{y:[[3.9879302978515625,3.9957427978515625,4.0113677978515625,4.0426177978515625],[3.9879302978515625,3.9957427978515625,4.0113677978515625,4.0426177978515625],[7.975860595703125,7.991485595703125,8.022735595703125,8.085235595703125],[3.564453125,12.12890625,44.2578125,168.515625],[13.296180725097656,13.307899475097656,13.331336975097656,13.378211975097656],[13.296180725097656,13.307899475097656,13.331336975097656,13.378211975097656],[26.592361450195313,26.615798950195313,26.662673950195313,26.756423950195313],[6.0732421875,18.708984375,63.66796875,232.3359375],[25.979034423828125,25.994659423828125,26.025909423828125,26.088409423828125],[25.979034423828125,25.994659423828125,26.025909423828125,26.088409423828125],[51.95806884765625,51.98931884765625,52.05181884765625,52.17681884765625],[9.25390625,28.5078125,97.015625,354.03125],[243.97711181640625,244.00836181640625,244.07086181640625,244.19586181640625],[243.97711181640625,244.00836181640625,244.07086181640625,244.19586181640625],[487.9542236328125,488.0167236328125,488.1417236328125,488.3917236328125],[46.2578125,142.515625,485.03125,1770.0625],[1519.99072265625,1520.05322265625,1520.17822265625,1520.42822265625],[1519.99072265625,1520.05322265625,1520.17822265625,1520.42822265625],[3039.9814453125,3040.1064453125,3040.3564453125,3040.8564453125],[145.703125,448.90625,1527.8125,5575.625]]}],label:"None",method:"restyle"},{args:[{y:[[3.9879302978515625,3.9957427978515625,4.0113677978515625,4.0426177978515625],[3.9879302978515625,3.9957427978515625,4.0113677978515625,4.0426177978515625],[7.975860595703125,7.991485595703125,8.022735595703125,8.085235595703125],[1.064453125,2.12890625,4.2578125,8.515625],[13.296180725097656,13.307899475097656,13.331336975097656,13.378211975097656],[13.296180725097656,13.307899475097656,13.331336975097656,13.378211975097656],[26.592361450195313,26.615798950195313,26.662673950195313,26.756423950195313],[2.7919921875,5.583984375,11.16796875,22.3359375],[25.979034423828125,25.994659423828125,26.025909423828125,26.088409423828125],[25.979034423828125,25.994659423828125,26.025909423828125,26.088409423828125],[51.95806884765625,51.98931884765625,52.05181884765625,52.17681884765625],[4.25390625,8.5078125,17.015625,34.03125],[243.97711181640625,244.00836181640625,244.07086181640625,244.19586181640625],[243.97711181640625,244.00836181640625,244.07086181640625,244.19586181640625],[487.9542236328125,488.0167236328125,488.1417236328125,488.3917236328125],[21.2578125,42.515625,85.03125,170.0625],[1519.99072265625,1520.05322265625,1520.17822265625,1520.42822265625],[1519.99072265625,1520.05322265625,1520.17822265625,1520.42822265625],[3039.9814453125,3040.1064453125,3040.3564453125,3040.8564453125],[66.953125,133.90625,267.8125,535.625]]}],label:"selective",method:"restyle"},{args:[{y:[[3.9879302978515625,3.9957427978515625,4.0113677978515625,4.0426177978515625],[3.9879302978515625,3.9957427978515625,4.0113677978515625,4.0426177978515625],[7.975860595703125,7.991485595703125,8.022735595703125,8.085235595703125],[.064453125,.12890625,.2578125,.515625],[13.296180725097656,13.307899475097656,13.331336975097656,13.378211975097656],[13.296180725097656,13.307899475097656,13.331336975097656,13.378211975097656],[26.592361450195313,26.615798950195313,26.662673950195313,26.756423950195313],[.1669921875,.333984375,.66796875,1.3359375],[25.979034423828125,25.994659423828125,26.025909423828125,26.088409423828125],[25.979034423828125,25.994659423828125,26.025909423828125,26.088409423828125],[51.95806884765625,51.98931884765625,52.05181884765625,52.17681884765625],[.25390625,.5078125,1.015625,2.03125],[243.97711181640625,244.00836181640625,244.07086181640625,244.19586181640625],[243.97711181640625,244.00836181640625,244.07086181640625,244.19586181640625],[487.9542236328125,488.0167236328125,488.1417236328125,488.3917236328125],[1.2578125,2.515625,5.03125,10.0625],[1519.99072265625,1520.05322265625,1520.17822265625,1520.42822265625],[1519.99072265625,1520.05322265625,1520.17822265625,1520.42822265625],[3039.9814453125,3040.1064453125,3040.3564453125,3040.8564453125],[3.953125,7.90625,15.8125,31.625]]}],label:"full",method:"restyle"}],direction:"down",showactive:!0,x:1.035,xanchor:"left",y:.4,yanchor:"top"}],barmode:"stack",xaxis:{title:{text:"Sequence Length"}},yaxis:{title:{text:"Memory (GB)"},range:[0,203.1547058105469]},width:850,height:500,annotations:[{showarrow:!1,text:"Model Size:",x:1.035,xanchor:"left",xref:"paper",y:.6,yanchor:"bottom",yref:"paper"},{showarrow:!1,text:"Recomputation:",x:1.035,xanchor:"left",xref:"paper",y:.4,yanchor:"bottom",yref:"paper"}]},{responsive:!0,scrollZoom:!1})</script> </div>
dist/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
dist/main.bundle.js CHANGED
@@ -5280,11 +5280,277 @@ var init_memory_plot = function init_memory_plot() {
5280
  }
5281
  updateGraph();
5282
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5283
  ;// ./src/index.js
5284
  // import { plotClusters } from './clusters'
5285
 
 
5286
  document.addEventListener("DOMContentLoaded", function () {
5287
  console.log("DOMContentLoaded");
 
5288
  init_memory_plot();
5289
  }, {
5290
  once: true
 
5280
  }
5281
  updateGraph();
5282
  };
5283
+ ;// ./src/fragmentLoader.js
5284
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5285
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
5286
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5287
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5288
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
5289
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
5290
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5291
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
5292
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
5293
+ function loadFragments() {
5294
+ return _loadFragments.apply(this, arguments);
5295
+ }
5296
+ function _loadFragments() {
5297
+ _loadFragments = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
5298
+ var fragmentElements, FetchQueue, fetchQueue, currentIndex, elements;
5299
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
5300
+ while (1) switch (_context7.prev = _context7.next) {
5301
+ case 0:
5302
+ // Find all elements with ids starting with 'fragment-'
5303
+ fragmentElements = Array.from(document.querySelectorAll('[id^="fragment-"]'));
5304
+ FetchQueue = /*#__PURE__*/function () {
5305
+ function FetchQueue() {
5306
+ var maxConcurrent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
5307
+ _classCallCheck(this, FetchQueue);
5308
+ this.queue = [];
5309
+ this.maxConcurrent = maxConcurrent;
5310
+ this.activeFetches = 0;
5311
+ this.maxRetries = 3; // Maximum number of retry attempts
5312
+ this.baseDelay = 1000; // Base delay in milliseconds (1 second)
5313
+ }
5314
+ return _createClass(FetchQueue, [{
5315
+ key: "sleep",
5316
+ value: function () {
5317
+ var _sleep = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ms) {
5318
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5319
+ while (1) switch (_context.prev = _context.next) {
5320
+ case 0:
5321
+ return _context.abrupt("return", new Promise(function (resolve) {
5322
+ return setTimeout(resolve, ms);
5323
+ }));
5324
+ case 1:
5325
+ case "end":
5326
+ return _context.stop();
5327
+ }
5328
+ }, _callee);
5329
+ }));
5330
+ function sleep(_x) {
5331
+ return _sleep.apply(this, arguments);
5332
+ }
5333
+ return sleep;
5334
+ }()
5335
+ }, {
5336
+ key: "fetchWithRetry",
5337
+ value: function () {
5338
+ var _fetchWithRetry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(fragmentPath) {
5339
+ var retryCount,
5340
+ response,
5341
+ delay,
5342
+ _args2 = arguments;
5343
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5344
+ while (1) switch (_context2.prev = _context2.next) {
5345
+ case 0:
5346
+ retryCount = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 0;
5347
+ _context2.prev = 1;
5348
+ _context2.next = 4;
5349
+ return fetch(fragmentPath);
5350
+ case 4:
5351
+ response = _context2.sent;
5352
+ if (response.ok) {
5353
+ _context2.next = 7;
5354
+ break;
5355
+ }
5356
+ throw new Error("HTTP error! status: ".concat(response.status));
5357
+ case 7:
5358
+ _context2.next = 9;
5359
+ return response.text();
5360
+ case 9:
5361
+ return _context2.abrupt("return", _context2.sent);
5362
+ case 12:
5363
+ _context2.prev = 12;
5364
+ _context2.t0 = _context2["catch"](1);
5365
+ if (!(retryCount < this.maxRetries)) {
5366
+ _context2.next = 20;
5367
+ break;
5368
+ }
5369
+ // Exponential backoff: 1s, 2s, 4s
5370
+ delay = this.baseDelay * Math.pow(2, retryCount);
5371
+ console.warn("Retry ".concat(retryCount + 1, "/").concat(this.maxRetries, " for ").concat(fragmentPath, " after ").concat(delay, "ms"));
5372
+ _context2.next = 19;
5373
+ return this.sleep(delay);
5374
+ case 19:
5375
+ return _context2.abrupt("return", this.fetchWithRetry(fragmentPath, retryCount + 1));
5376
+ case 20:
5377
+ throw _context2.t0;
5378
+ case 21:
5379
+ case "end":
5380
+ return _context2.stop();
5381
+ }
5382
+ }, _callee2, this, [[1, 12]]);
5383
+ }));
5384
+ function fetchWithRetry(_x2) {
5385
+ return _fetchWithRetry.apply(this, arguments);
5386
+ }
5387
+ return fetchWithRetry;
5388
+ }()
5389
+ }, {
5390
+ key: "addFetch",
5391
+ value: function () {
5392
+ var _addFetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(element) {
5393
+ var _this = this;
5394
+ var fragmentName, fragmentPath;
5395
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
5396
+ while (1) switch (_context5.prev = _context5.next) {
5397
+ case 0:
5398
+ fragmentName = element.id.replace('fragment-', '');
5399
+ fragmentPath = "/fragments/".concat(fragmentName, ".html");
5400
+ return _context5.abrupt("return", new Promise(/*#__PURE__*/function () {
5401
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(resolve, reject) {
5402
+ var fetchPromise;
5403
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
5404
+ while (1) switch (_context4.prev = _context4.next) {
5405
+ case 0:
5406
+ try {
5407
+ fetchPromise = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
5408
+ var html, temp, scripts;
5409
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
5410
+ while (1) switch (_context3.prev = _context3.next) {
5411
+ case 0:
5412
+ _context3.prev = 0;
5413
+ _context3.next = 3;
5414
+ return _this.fetchWithRetry(fragmentPath);
5415
+ case 3:
5416
+ html = _context3.sent;
5417
+ // Process the fragment
5418
+ temp = document.createElement('div');
5419
+ temp.innerHTML = html;
5420
+ element.innerHTML = temp.innerHTML;
5421
+
5422
+ // Handle scripts
5423
+ scripts = temp.getElementsByTagName('script');
5424
+ Array.from(scripts).forEach(function (oldScript) {
5425
+ var newScript = document.createElement('script');
5426
+ Array.from(oldScript.attributes).forEach(function (attr) {
5427
+ newScript.setAttribute(attr.name, attr.value);
5428
+ });
5429
+ newScript.textContent = oldScript.textContent;
5430
+ oldScript.parentNode.removeChild(oldScript);
5431
+ document.body.appendChild(newScript);
5432
+ });
5433
+ _this.activeFetches--;
5434
+ resolve();
5435
+ _context3.next = 18;
5436
+ break;
5437
+ case 13:
5438
+ _context3.prev = 13;
5439
+ _context3.t0 = _context3["catch"](0);
5440
+ console.error("Failed to load fragment ".concat(fragmentPath, " after ").concat(_this.maxRetries, " retries:"), _context3.t0);
5441
+ _this.activeFetches--;
5442
+ reject(_context3.t0);
5443
+ case 18:
5444
+ case "end":
5445
+ return _context3.stop();
5446
+ }
5447
+ }, _callee3, null, [[0, 13]]);
5448
+ }))();
5449
+ _this.queue.push(fetchPromise);
5450
+ _this.activeFetches++;
5451
+ } catch (error) {
5452
+ reject(error);
5453
+ }
5454
+ case 1:
5455
+ case "end":
5456
+ return _context4.stop();
5457
+ }
5458
+ }, _callee4);
5459
+ }));
5460
+ return function (_x4, _x5) {
5461
+ return _ref.apply(this, arguments);
5462
+ };
5463
+ }()));
5464
+ case 3:
5465
+ case "end":
5466
+ return _context5.stop();
5467
+ }
5468
+ }, _callee5);
5469
+ }));
5470
+ function addFetch(_x3) {
5471
+ return _addFetch.apply(this, arguments);
5472
+ }
5473
+ return addFetch;
5474
+ }()
5475
+ }, {
5476
+ key: "processNext",
5477
+ value: function () {
5478
+ var _processNext = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(element) {
5479
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
5480
+ while (1) switch (_context6.prev = _context6.next) {
5481
+ case 0:
5482
+ if (!(this.activeFetches < this.maxConcurrent && element)) {
5483
+ _context6.next = 3;
5484
+ break;
5485
+ }
5486
+ _context6.next = 3;
5487
+ return this.addFetch(element);
5488
+ case 3:
5489
+ case "end":
5490
+ return _context6.stop();
5491
+ }
5492
+ }, _callee6, this);
5493
+ }));
5494
+ function processNext(_x6) {
5495
+ return _processNext.apply(this, arguments);
5496
+ }
5497
+ return processNext;
5498
+ }()
5499
+ }]);
5500
+ }(); // Initialize queue
5501
+ fetchQueue = new FetchQueue(3);
5502
+ currentIndex = 0;
5503
+ elements = fragmentElements; // Assuming this is defined elsewhere
5504
+ // Initial loading of first 3 elements
5505
+ case 5:
5506
+ if (!(currentIndex < elements.length && currentIndex < 3)) {
5507
+ _context7.next = 11;
5508
+ break;
5509
+ }
5510
+ _context7.next = 8;
5511
+ return fetchQueue.processNext(elements[currentIndex]);
5512
+ case 8:
5513
+ currentIndex++;
5514
+ _context7.next = 5;
5515
+ break;
5516
+ case 11:
5517
+ if (!(currentIndex < elements.length)) {
5518
+ _context7.next = 20;
5519
+ break;
5520
+ }
5521
+ _context7.next = 14;
5522
+ return Promise.race(fetchQueue.queue);
5523
+ case 14:
5524
+ // Remove completed fetch from queue
5525
+ fetchQueue.queue = fetchQueue.queue.filter(function (p) {
5526
+ return p.status === 'pending';
5527
+ });
5528
+ // Add next element to queue
5529
+ _context7.next = 17;
5530
+ return fetchQueue.processNext(elements[currentIndex]);
5531
+ case 17:
5532
+ currentIndex++;
5533
+ _context7.next = 11;
5534
+ break;
5535
+ case 20:
5536
+ _context7.next = 22;
5537
+ return Promise.all(fetchQueue.queue);
5538
+ case 22:
5539
+ case "end":
5540
+ return _context7.stop();
5541
+ }
5542
+ }, _callee7);
5543
+ }));
5544
+ return _loadFragments.apply(this, arguments);
5545
+ }
5546
+
5547
  ;// ./src/index.js
5548
  // import { plotClusters } from './clusters'
5549
 
5550
+
5551
  document.addEventListener("DOMContentLoaded", function () {
5552
  console.log("DOMContentLoaded");
5553
+ loadFragments();
5554
  init_memory_plot();
5555
  }, {
5556
  once: true
dist/main.bundle.js.map CHANGED
The diff for this file is too large to render. See raw diff
 
src/fragmentLoader.js ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ async function loadFragments() {
2
+ // Find all elements with ids starting with 'fragment-'
3
+ const fragmentElements = Array.from(document.querySelectorAll('[id^="fragment-"]'));
4
+
5
+ class FetchQueue {
6
+ constructor(maxConcurrent = 3) {
7
+ this.queue = [];
8
+ this.maxConcurrent = maxConcurrent;
9
+ this.activeFetches = 0;
10
+ this.maxRetries = 3; // Maximum number of retry attempts
11
+ this.baseDelay = 1000; // Base delay in milliseconds (1 second)
12
+ }
13
+
14
+ async sleep(ms) {
15
+ return new Promise(resolve => setTimeout(resolve, ms));
16
+ }
17
+
18
+ async fetchWithRetry(fragmentPath, retryCount = 0) {
19
+ try {
20
+ const response = await fetch(fragmentPath);
21
+ if (!response.ok) {
22
+ throw new Error(`HTTP error! status: ${response.status}`);
23
+ }
24
+ return await response.text();
25
+ } catch (error) {
26
+ if (retryCount < this.maxRetries) {
27
+ // Exponential backoff: 1s, 2s, 4s
28
+ const delay = this.baseDelay * Math.pow(2, retryCount);
29
+ console.warn(`Retry ${retryCount + 1}/${this.maxRetries} for ${fragmentPath} after ${delay}ms`);
30
+ await this.sleep(delay);
31
+ return this.fetchWithRetry(fragmentPath, retryCount + 1);
32
+ }
33
+ throw error;
34
+ }
35
+ }
36
+
37
+ async addFetch(element) {
38
+ const fragmentName = element.id.replace('fragment-', '');
39
+ const fragmentPath = `/fragments/${fragmentName}.html`;
40
+
41
+ return new Promise(async (resolve, reject) => {
42
+ try {
43
+ const fetchPromise = (async () => {
44
+ try {
45
+ const html = await this.fetchWithRetry(fragmentPath);
46
+
47
+ // Process the fragment
48
+ const temp = document.createElement('div');
49
+ temp.innerHTML = html;
50
+ element.innerHTML = temp.innerHTML;
51
+
52
+ // Handle scripts
53
+ const scripts = temp.getElementsByTagName('script');
54
+ Array.from(scripts).forEach(oldScript => {
55
+ const newScript = document.createElement('script');
56
+ Array.from(oldScript.attributes).forEach(attr => {
57
+ newScript.setAttribute(attr.name, attr.value);
58
+ });
59
+ newScript.textContent = oldScript.textContent;
60
+ oldScript.parentNode.removeChild(oldScript);
61
+ document.body.appendChild(newScript);
62
+ });
63
+
64
+ this.activeFetches--;
65
+ resolve();
66
+ } catch (error) {
67
+ console.error(`Failed to load fragment ${fragmentPath} after ${this.maxRetries} retries:`, error);
68
+ this.activeFetches--;
69
+ reject(error);
70
+ }
71
+ })();
72
+
73
+ this.queue.push(fetchPromise);
74
+ this.activeFetches++;
75
+ } catch (error) {
76
+ reject(error);
77
+ }
78
+ });
79
+ }
80
+
81
+ async processNext(element) {
82
+ if (this.activeFetches < this.maxConcurrent && element) {
83
+ await this.addFetch(element);
84
+ }
85
+ }
86
+ }
87
+
88
+ // Initialize queue
89
+ const fetchQueue = new FetchQueue(3);
90
+ let currentIndex = 0;
91
+ const elements = fragmentElements; // Assuming this is defined elsewhere
92
+
93
+ // Initial loading of first 3 elements
94
+ while (currentIndex < elements.length && currentIndex < 3) {
95
+ await fetchQueue.processNext(elements[currentIndex]);
96
+ currentIndex++;
97
+ }
98
+
99
+ // Process remaining elements as fetches complete
100
+ while (currentIndex < elements.length) {
101
+ // Wait for any fetch to complete
102
+ await Promise.race(fetchQueue.queue);
103
+ // Remove completed fetch from queue
104
+ fetchQueue.queue = fetchQueue.queue.filter(p => p.status === 'pending');
105
+ // Add next element to queue
106
+ await fetchQueue.processNext(elements[currentIndex]);
107
+ currentIndex++;
108
+ }
109
+
110
+ // Wait for remaining fetches to complete
111
+ await Promise.all(fetchQueue.queue);
112
+ }
113
+
114
+ export { loadFragments }
src/index.html CHANGED
@@ -41,7 +41,7 @@
41
  <h1 class="l-page" style="text-align: center;">The Ultra-Scale Playbook:<br>Training LLMs on GPU Clusters</h1>
42
  <div id="title-plot" class="main-plot-container l-screen" style="overflow-x: hidden; width: 100%; text-align: center;">
43
  <div style="display: flex; justify-content: center; position: relative;">
44
- {{{banner-html}}}
45
  </div>
46
  <p style="text-align: cekter; font-style: italic; margin-top: 10px; max-width: 900px; margin-left: auto; margin-right: auto;">We ran over 4000 scaling experiments on up to 512 GPUs and measured throughput (size of markers) and GPU utilization (color of markers). Note that both are normalized per model size in this visualization.</p>
47
 
@@ -206,8 +206,9 @@
206
 
207
  <p><strong>Real training efficiency benchmarks:</strong> Finally, how to <em>actually</em> scale your LLM training depends on your infrastructure, such as the kind of chips, interconnect etc., and we can’t give a single unified recipe. What we will give though is a way to benchmark several setups and it is what we have done on our cluster! We ran over 4100 distributed experiments (over 16k including test runs) with up to 512 GPUs to scan many possible distributed training layouts and model sizes. </p>
208
 
209
- <iframe id="plotFrame" src="assets/data/benchmarks/benchmarks_interactive.html" scrolling="no" frameborder="0" height="840" width="720"></iframe>
210
- {{{benchmarks-interactive-html}}}
 
211
 
212
  <p>As you can see, there’s a lot of ground to be covered. Before getting into the trenches of distributed training let’s take a quick high level look on the challenges we'll cover in the book.</p>
213
 
 
41
  <h1 class="l-page" style="text-align: center;">The Ultra-Scale Playbook:<br>Training LLMs on GPU Clusters</h1>
42
  <div id="title-plot" class="main-plot-container l-screen" style="overflow-x: hidden; width: 100%; text-align: center;">
43
  <div style="display: flex; justify-content: center; position: relative;">
44
+ {{{fragment-banner}}}
45
  </div>
46
  <p style="text-align: cekter; font-style: italic; margin-top: 10px; max-width: 900px; margin-left: auto; margin-right: auto;">We ran over 4000 scaling experiments on up to 512 GPUs and measured throughput (size of markers) and GPU utilization (color of markers). Note that both are normalized per model size in this visualization.</p>
47
 
 
206
 
207
  <p><strong>Real training efficiency benchmarks:</strong> Finally, how to <em>actually</em> scale your LLM training depends on your infrastructure, such as the kind of chips, interconnect etc., and we can’t give a single unified recipe. What we will give though is a way to benchmark several setups and it is what we have done on our cluster! We ran over 4100 distributed experiments (over 16k including test runs) with up to 512 GPUs to scan many possible distributed training layouts and model sizes. </p>
208
 
209
+ <!-- <iframe id="plotFrame" src="assets/data/benchmarks/benchmarks_interactive.html" scrolling="no" frameborder="0" height="840" width="720"></iframe> -->
210
+ <div id="fragment-benchmarks_interactive"></div>
211
+ <!-- {{{benchmarks-interactive-html}}} -->
212
 
213
  <p>As you can see, there’s a lot of ground to be covered. Before getting into the trenches of distributed training let’s take a quick high level look on the challenges we'll cover in the book.</p>
214
 
src/index.js CHANGED
@@ -1,7 +1,9 @@
1
  // import { plotClusters } from './clusters'
2
  import { init_memory_plot } from './memory'
 
3
 
4
  document.addEventListener("DOMContentLoaded", () => {
5
  console.log("DOMContentLoaded");
 
6
  init_memory_plot();
7
  }, { once: true });
 
1
  // import { plotClusters } from './clusters'
2
  import { init_memory_plot } from './memory'
3
+ import { loadFragments } from './fragmentLoader'
4
 
5
  document.addEventListener("DOMContentLoaded", () => {
6
  console.log("DOMContentLoaded");
7
+ loadFragments();
8
  init_memory_plot();
9
  }, { once: true });
webpack.config.js CHANGED
@@ -5,7 +5,8 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPl
5
  const Handlebars = require("handlebars");
6
  const fs = require("fs");
7
  const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
8
- const { swcMinifyFragment} = require("html-minimizer-webpack-plugin")
 
9
 
10
  const FRAGMENTS_PATH = "src/fragments";
11
 
@@ -23,10 +24,12 @@ const loadFragmentsMap = (() => {
23
  if (fs.statSync(filePath).isDirectory()) {
24
  await walkDir(filePath, relativePath);
25
  } else {
26
- const dottedPath = relativePath.replace(/\\/g, '-').replace(/\//g, '-').replace(/\./g, '-');
 
 
27
  const content = fs.readFileSync(filePath, "utf8");
28
  // Minify the HTML content using swcMinifyFragment
29
- const minifiedRes = await swcMinifyFragment({"tmp.html": content})
30
  if (minifiedRes.errors) {
31
  console.error(minifiedRes.errors)
32
  }
@@ -83,13 +86,13 @@ module.exports = {
83
  from: "assets",
84
  to: "assets",
85
  },
 
86
  { from: "src/style.css", to: "style.css" },
87
  { from: "src/bibliography.bib", to: "bibliography.bib" },
88
  {
89
  from: "src/index.html",
90
  to: "index.html",
91
  transform: transformHandlebars,
92
- noErrorOnMissing: true
93
  },
94
  ],
95
  }),
@@ -130,6 +133,11 @@ module.exports = {
130
  }
131
  ]
132
  }),
 
 
 
 
 
133
  ]
134
  },
135
  };
 
5
  const Handlebars = require("handlebars");
6
  const fs = require("fs");
7
  const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
8
+ const HtmlMinimizerPlugin = require("html-minimizer-webpack-plugin");
9
+
10
 
11
  const FRAGMENTS_PATH = "src/fragments";
12
 
 
24
  if (fs.statSync(filePath).isDirectory()) {
25
  await walkDir(filePath, relativePath);
26
  } else {
27
+ // Remove the .html extension before creating the dotted path
28
+ const nameWithoutExt = relativePath.replace(/\.html$/, '');
29
+ const dottedPath = 'fragment-' + nameWithoutExt.replace(/\\/g, '-').replace(/\//g, '-').replace(/\./g, '-');
30
  const content = fs.readFileSync(filePath, "utf8");
31
  // Minify the HTML content using swcMinifyFragment
32
+ const minifiedRes = await HtmlMinimizerPlugin.swcMinifyFragment({"tmp.html": content})
33
  if (minifiedRes.errors) {
34
  console.error(minifiedRes.errors)
35
  }
 
86
  from: "assets",
87
  to: "assets",
88
  },
89
+ { from: "src/fragments/*", to: "fragments/[name].html" },
90
  { from: "src/style.css", to: "style.css" },
91
  { from: "src/bibliography.bib", to: "bibliography.bib" },
92
  {
93
  from: "src/index.html",
94
  to: "index.html",
95
  transform: transformHandlebars,
 
96
  },
97
  ],
98
  }),
 
133
  }
134
  ]
135
  }),
136
+ //Hynek: Ideally we don't run this twice but we
137
+ new HtmlMinimizerPlugin({
138
+ test: /fragments\/.*\.html$/i,
139
+ minify: HtmlMinimizerPlugin.swcMinifyFragment,
140
+ })
141
  ]
142
  },
143
  };