Add scheduling, machine info, caching strategies and devices (#9)
Reviewed-on: Rubydragon/MetagraphOptimization.jl#9 Co-authored-by: Anton Reinhard <anton.reinhard@proton.me> Co-committed-by: Anton Reinhard <anton.reinhard@proton.me>
This commit is contained in:
678
notebooks/abc_model_large.ipynb
Normal file
678
notebooks/abc_model_large.ipynb
Normal file
@ -0,0 +1,678 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using MetagraphOptimization"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Graph:\n",
|
||||
" Nodes: Total: 438436, ComputeTaskP: 10, ComputeTaskU: 10, \n",
|
||||
" ComputeTaskV: 109600, ComputeTaskSum: 1, ComputeTaskS2: 40320, \n",
|
||||
" ComputeTaskS1: 69272, DataTask: 219223\n",
|
||||
" Edges: 628665\n",
|
||||
" Total Compute Effort: 1.903443e6\n",
|
||||
" Total Data Transfer: 1.8040896e7\n",
|
||||
" Total Compute Intensity: 0.10550712115407128\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"model = ABCModel()\n",
|
||||
"process_str = \"AB->ABBBBBBB\"\n",
|
||||
"process = parse_process(process_str, model)\n",
|
||||
"graph = parse_dag(\"../input/$process_str.txt\", model)\n",
|
||||
"print(graph)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"351.606942 seconds (1.13 G allocations: 25.949 GiB, 1.33% gc time, 0.72% compilation time)\n",
|
||||
"Graph:\n",
|
||||
" Nodes: Total: 277188, ComputeTaskP: 10, ComputeTaskU: 10, \n",
|
||||
" ComputeTaskV: 69288, ComputeTaskSum: 1, ComputeTaskS2: 40320, \n",
|
||||
" ComputeTaskS1: 28960, DataTask: 138599\n",
|
||||
" Edges: 427105\n",
|
||||
" Total Compute Effort: 1.218139e6\n",
|
||||
" Total Data Transfer: 1.2235968e7\n",
|
||||
" Total Compute Intensity: 0.0995539543745129\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"include(\"../examples/profiling_utilities.jl\")\n",
|
||||
"@time reduce_all!(graph)\n",
|
||||
"print(graph)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Found 1 NUMA nodes\n",
|
||||
"CUDA is non-functional\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Get machine and set dictionary caching strategy\n",
|
||||
"machine = get_machine_info()\n",
|
||||
"MetagraphOptimization.set_cache_strategy(machine.devices[1], MetagraphOptimization.Dictionary())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"2315.896312 seconds (87.18 M allocations: 132.726 GiB, 0.11% gc time, 0.04% compilation time)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"compute__8fd7c454_6214_11ee_3616_0f2435e477fe (generic function with 1 method)"
|
||||
]
|
||||
},
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"@time compute_AB_AB7 = get_compute_function(graph, process, machine)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
" 1.910169 seconds (4.34 M allocations: 278.284 MiB, 6.25% gc time, 99.23% compilation time)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"1000-element Vector{ABCProcessInput}:\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.411745173347825, 0.0, 0.0, 8.352092962924948]\n",
|
||||
" B: [8.411745173347825, 0.0, 0.0, -8.352092962924948]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.003428483168789, 1.2386385417950023, -0.8321671195319228, 0.8871291535745444]\n",
|
||||
" B: [-2.444326994820653, 1.1775023368116424, -0.9536682034633904, 1.6366855721594777]\n",
|
||||
" B: [-4.289211829680359, -3.7216649121036443, 1.128125248220305, 1.50793959634144]\n",
|
||||
" B: [-1.2727607454602508, 0.07512513775641204, 0.6370236198332677, -0.45659285653208986]\n",
|
||||
" B: [-1.8777156401619268, -1.042329795325101, -0.5508846238377632, -1.0657817573524957]\n",
|
||||
" B: [-1.1322368113474306, 0.0498922458527246, -0.2963537951915457, -0.4377732162313449]\n",
|
||||
" B: [-1.4340705015357569, 0.7798902829682378, 0.144450581630926, -0.6538068364381232]\n",
|
||||
" B: [-2.369739340520482, 1.4429461622447262, 0.7234742923401235, -1.4177996555214083]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.262146117199348, 0.0, 0.0, 8.201405883258813]\n",
|
||||
" B: [8.262146117199348, 0.0, 0.0, -8.201405883258813]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.022253637967156, 0.040616190652067494, 1.5789161216660899, -0.7712872241073523]\n",
|
||||
" B: [-1.085155894223277, -0.4013306445746292, 0.044561160964560184, -0.12046298778597243]\n",
|
||||
" B: [-2.3099664718736963, -0.6028883246226666, 0.7721426580907682, 1.8374619682515352]\n",
|
||||
" B: [-3.8528592267292674, -1.1057919702708323, -3.154341441424319, -1.6345881470237529]\n",
|
||||
" B: [-1.445065980497648, -0.3803292238069696, -0.9038074225417192, 0.3559459403736899]\n",
|
||||
" B: [-1.637993216461692, 0.18276067729419151, -0.6165325663294264, 1.1267244146927589]\n",
|
||||
" B: [-3.0791604558286254, 1.8666082398498536, 2.1149851082876507, -0.7237684597886623]\n",
|
||||
" B: [-1.091837350817336, 0.4003550554789843, 0.16407638128639515, -0.0700255046122441]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [9.522164300929319, 0.0, 0.0, 9.4695096480173]\n",
|
||||
" B: [9.522164300929319, 0.0, 0.0, -9.4695096480173]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.2614545815907876, 0.09596466269330481, -1.680314037563078, -1.1320390202111377]\n",
|
||||
" B: [-2.5164555101345942, 2.0544568173259474, 0.7608284478099104, 0.7299969816600982]\n",
|
||||
" B: [-3.527555187469315, 3.1461533872404055, -0.4998113855480195, 1.1382236350884531]\n",
|
||||
" B: [-1.5843416170605953, -0.649775322646379, 0.6368565466386346, -0.8260412390634552]\n",
|
||||
" B: [-1.0715042390215452, 0.33101538188959895, -0.19275377509309963, -0.037364868271978664]\n",
|
||||
" B: [-1.8269658913133924, -1.2104472444295427, -0.7036857693244948, 0.6143681099517287]\n",
|
||||
" B: [-1.7510547915269752, 0.35168054121444203, 0.408535633181173, -1.3325210378384098]\n",
|
||||
" B: [-4.504996783741433, -4.119048223287777, 1.270344339898973, 0.8453774386847008]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [7.225275339000687, 0.0, 0.0, 7.1557392157883655]\n",
|
||||
" B: [7.225275339000687, 0.0, 0.0, -7.1557392157883655]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.5721586195862234, -0.6346644373772993, 0.7957285133297657, -0.6600756851617959]\n",
|
||||
" B: [-1.0093393293662618, -0.11321130994303012, 0.07324286826550051, -0.024177745030521003]\n",
|
||||
" B: [-2.7355755394886443, 0.2329840388558535, -2.4939308642531, -0.4576033371958622]\n",
|
||||
" B: [-1.618399027736879, -0.47727357006920945, 1.0132042772011558, -0.6040218911217943]\n",
|
||||
" B: [-1.7201610947708947, 0.01110230391313025, 0.8839000043421623, -1.0851505486038107]\n",
|
||||
" B: [-1.792300907703241, 0.8101193095744785, -0.625916307414256, 1.0790171565463333]\n",
|
||||
" B: [-1.5563810656498285, -1.1865287585293671, 0.12019738267353275, -0.004910793671790455]\n",
|
||||
" B: [-2.4462350936994026, 1.3574724235754438, 0.2335741258552372, 1.7569228442392408]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [7.94532861335446, 0.0, 0.0, 7.882147345374172]\n",
|
||||
" B: [7.94532861335446, 0.0, 0.0, -7.882147345374172]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.118671714766621, -0.6322452591326608, -1.2236882164873555, -1.2615953852509143]\n",
|
||||
" B: [-2.560753710001491, -1.7412395645571277, -1.5891033163317627, 0.01717533495153369]\n",
|
||||
" B: [-1.5550581087132076, -0.639122838128628, -0.9624327134008909, 0.2888788525193626]\n",
|
||||
" B: [-2.181477133464949, 0.4918918998013713, 1.8559068969600523, -0.2692479016749415]\n",
|
||||
" B: [-1.2628370388798702, -0.4013500667990802, 0.24813196852393224, 0.6100049482124643]\n",
|
||||
" B: [-1.901139724448186, 1.3625293914322611, -0.8176066997802711, 0.2989401174693193]\n",
|
||||
" B: [-2.2302691928842697, -0.1867565668705846, 1.9609184768063308, 0.3066290670808993]\n",
|
||||
" B: [-2.0804506035503256, 1.7462930042544484, 0.5278736037099664, 0.009214966692276028]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [5.597768901835826, 0.0, 0.0, 5.507723366179557]\n",
|
||||
" B: [5.597768901835826, 0.0, 0.0, -5.507723366179557]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.0009073340208385, 0.03522831505376105, -0.010844681575969111, -0.021374049609080487]\n",
|
||||
" B: [-1.3943823799403026, -0.886019044587247, 0.21582726795187737, -0.3356948979730148]\n",
|
||||
" B: [-1.0593061926863385, 0.3261714964515558, -0.10930051701751846, -0.06160488410736567]\n",
|
||||
" B: [-1.0190344437384602, 0.02512063114228613, 0.04379726771854621, -0.18942531709556668]\n",
|
||||
" B: [-1.0919277601624486, -0.39612686480944176, 0.07078221355247243, -0.17429750036714983]\n",
|
||||
" B: [-1.8292258091360047, 1.1565638126055895, 0.329244535677723, 0.9486966026643375]\n",
|
||||
" B: [-1.7379569022732355, 0.6562121276078657, 0.7749535141539342, -0.9946491284065995]\n",
|
||||
" B: [-2.0627969817140217, -0.9171504734643696, -1.3144596004610647, 0.8283491748944392]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [6.860362769879496, 0.0, 0.0, 6.787089017712134]\n",
|
||||
" B: [6.860362769879496, 0.0, 0.0, -6.787089017712134]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.1483538194490985, 1.8204047500578164, 0.1342978924269131, -0.532461036694855]\n",
|
||||
" B: [-1.2136825716769264, 0.12932805245115084, -0.43609629710270903, -0.5158678699965871]\n",
|
||||
" B: [-3.3642987422516573, -1.7653207470663739, 0.533955101409256, 2.630026736893018]\n",
|
||||
" B: [-1.053677321951765, 0.11000921943972916, 0.04739423847128557, -0.30965732123337875]\n",
|
||||
" B: [-1.2932387925896982, -0.6843810329952256, 0.045636429012288295, -0.4494513240410521]\n",
|
||||
" B: [-1.1237194151971648, -0.45140047643622017, 0.19994785657222267, -0.13785422959193222]\n",
|
||||
" B: [-1.7619597212239484, 1.3299261857304887, 0.561749934748497, 0.1422512233127988]\n",
|
||||
" B: [-1.7617951554187332, -0.488565951181366, -1.0868851555377534, -0.8269861786480115]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [9.57507915889135, 0.0, 0.0, 9.522717096450755]\n",
|
||||
" B: [9.57507915889135, 0.0, 0.0, -9.522717096450755]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-3.4305207411483516, 2.6682294806816835, -1.883054168339437, -0.3211401453721668]\n",
|
||||
" B: [-2.185574270107571, 1.4558232366821502, 1.2235951792097912, 0.40016050668089054]\n",
|
||||
" B: [-3.0259648593433583, -0.9184166853584697, -0.10930222461665634, -2.7020412923806107]\n",
|
||||
" B: [-3.246659025038245, -2.493839704051011, -1.0189869044243565, 1.5110340975546257]\n",
|
||||
" B: [-1.4247322676315595, 0.05954103854817788, 0.9940897925990366, -0.19519831815252583]\n",
|
||||
" B: [-1.4889906300188005, 0.5912092032645169, -0.19371449043911573, -0.9110650198822441]\n",
|
||||
" B: [-1.1268952499657272, 0.36236812621338876, -0.3636229828302436, 0.07975319340034331]\n",
|
||||
" B: [-3.220821274529085, -1.7249146959804351, 1.350995798840981, 2.1384969781516885]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.472852690841874, 0.0, 0.0, 8.413633740584764]\n",
|
||||
" B: [8.472852690841874, 0.0, 0.0, -8.413633740584764]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.1530011327357317, 0.34211475449117323, -0.45923141786607913, -0.03841369149190832]\n",
|
||||
" B: [-2.62915067223017, 1.042431210232047, 0.6288618003426715, -2.1048285595963105]\n",
|
||||
" B: [-1.1265473249385953, -0.4344882737979479, -0.1553035746380426, 0.2370856700921221]\n",
|
||||
" B: [-1.4826889242092416, -0.5889894099544346, -0.45026884678673923, -0.8054290077639529]\n",
|
||||
" B: [-4.118520088756618, -2.101194203160593, -3.0008966741533745, 1.5943054265577095]\n",
|
||||
" B: [-3.9992129109551517, 1.0607252636964415, 3.6847882851419875, 0.539352496783755]\n",
|
||||
" B: [-1.3172538577755006, 0.4084669000294691, -0.6351790575407871, 0.4060296568803221]\n",
|
||||
" B: [-1.1193304700827373, 0.2709337584638445, 0.3872294855003629, 0.17189800853826395]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [5.913538688235051, 0.0, 0.0, 5.828373685450576]\n",
|
||||
" B: [5.913538688235051, 0.0, 0.0, -5.828373685450576]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.6813734506828508, -1.1942921586618185, -0.384476919421686, 0.5028522833318558]\n",
|
||||
" B: [-1.412586238014363, 0.010275442474480664, 0.8780055986304257, -0.4737092609218783]\n",
|
||||
" B: [-1.5338446207986793, 1.1234162145644635, 0.1670274754582306, -0.25043392751132176]\n",
|
||||
" B: [-1.4260274101869397, 0.9023875675844153, -0.4646063309051003, -0.058239245843783906]\n",
|
||||
" B: [-1.1055189977833793, -0.3699146930280028, 0.2809292901965394, -0.08008812803177658]\n",
|
||||
" B: [-1.1926016738662872, 0.4242726765633766, 0.34415633034138016, -0.3519202590308968]\n",
|
||||
" B: [-1.4188061371181722, 0.47356120240959365, 0.33662773751584696, 0.8218469496393668]\n",
|
||||
" B: [-2.0563188480194308, -1.3697062519065082, -1.1576631818156364, -0.1103084116315648]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [6.062750568659298, 0.0, 0.0, 5.979711068085032]\n",
|
||||
" B: [6.062750568659298, 0.0, 0.0, -5.979711068085032]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.1157392140073992, -0.0424317149721654, 0.4662958482482185, -0.16013033799016252]\n",
|
||||
" B: [-2.395340693850968, -1.171776361305547, -1.746409249879336, 0.5609384374776449]\n",
|
||||
" B: [-1.0289722654275464, 0.23139962589771268, 0.07055331234631396, 0.01613586906426155]\n",
|
||||
" B: [-1.212565238145815, -0.6377842504248107, 0.04163119753237706, 0.24862129848767983]\n",
|
||||
" B: [-1.8156755638105053, -0.3987185167288875, 1.2510245302740972, 0.7567290942527487]\n",
|
||||
" B: [-2.003891077687212, 1.2159250459117166, 0.38048599808923245, -1.1799729400359336]\n",
|
||||
" B: [-1.4663599649673638, 0.593985649692284, -0.7733488095969958, -0.44645740391848543]\n",
|
||||
" B: [-1.086957119421786, 0.20940052192969777, 0.3097671729860923, 0.20413598266224653]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [7.088363151833832, 0.0, 0.0, 7.017470496715726]\n",
|
||||
" B: [7.088363151833832, 0.0, 0.0, -7.017470496715726]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-3.1474601133746627, 0.14412280671945385, 2.7364508363525357, 1.1821889028802701]\n",
|
||||
" B: [-1.256451004773104, 0.1153142495225348, -0.7455659837621855, -0.09748392231091944]\n",
|
||||
" B: [-1.4964417911663928, -0.0996845872039782, -0.8492275192498467, 0.7128910421459969]\n",
|
||||
" B: [-3.2499484244824526, -0.8927423628721523, -1.0242747556675866, -2.777775559729678]\n",
|
||||
" B: [-1.0489067674373789, -0.31603136975662793, 0.016268502528308637, -0.008057042333727152]\n",
|
||||
" B: [-1.6957667777105587, 1.0857339287179024, 0.6252297389508089, 0.5530773670555896]\n",
|
||||
" B: [-1.243679438145053, 0.06348629097723194, -0.7145975145476898, 0.17904867473682565]\n",
|
||||
" B: [-1.0380719865780628, -0.10019895610436466, -0.044283304604344965, 0.2561105375556422]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [9.842517855137334, 0.0, 0.0, 9.791586068084028]\n",
|
||||
" B: [9.842517855137334, 0.0, 0.0, -9.791586068084028]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.0081083393933719, 0.09315850477843095, -0.05390640772287413, 0.06854207575149836]\n",
|
||||
" B: [-1.2533776879399583, -0.09567218890986252, -0.022562148977002077, -0.749195175056841]\n",
|
||||
" B: [-4.199102452438099, 3.1204551726062775, 2.23725963921713, 1.3747327844190023]\n",
|
||||
" B: [-5.1018332572388285, -4.999892707918183, 0.09407944148737099, -0.14465321518774693]\n",
|
||||
" B: [-3.7582268429742243, 2.1814891293707577, -1.5410280493623207, -2.4475715991095703]\n",
|
||||
" B: [-1.1792132348986593, 0.6125282131702711, -0.12369433042852651, -0.007263198361168502]\n",
|
||||
" B: [-1.3600169327450258, -0.07835376476887727, -0.6694537001487819, 0.6287594836317273]\n",
|
||||
" B: [-1.8251569626465018, -0.8337123583288142, 0.07930555593500455, 1.2766488439130985]\n",
|
||||
"\n",
|
||||
" ⋮\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [9.861596443743153, 0.0, 0.0, 9.810763702141012]\n",
|
||||
" B: [9.861596443743153, 0.0, 0.0, -9.810763702141012]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.8179384769334697, 0.9572508915748105, -0.9794338269553214, 0.6551949443563104]\n",
|
||||
" B: [-2.1028582035167607, -0.7676665378472812, 0.6218562087985972, -1.5639678917247444]\n",
|
||||
" B: [-3.1263866679666865, 2.3808322573838474, -1.6099851834448586, 0.7168535896041835]\n",
|
||||
" B: [-5.177179415841987, -1.3605325795287053, 4.805481256903438, -0.9270855911989424]\n",
|
||||
" B: [-1.2605754590213083, -0.023284320526100116, -0.14250915308265208, 0.7537900699744495]\n",
|
||||
" B: [-2.712925004518324, -1.4343063146086636, -1.452340398698398, 1.4810249296764189]\n",
|
||||
" B: [-2.3798188172675734, 0.6412170781802653, -1.487389994435021, -1.4283029321979925]\n",
|
||||
" B: [-1.1455108424201939, -0.39351047462817185, 0.24432109091421514, 0.3124928815103169]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [5.611571819338176, 0.0, 0.0, 5.521751378284825]\n",
|
||||
" B: [5.611571819338176, 0.0, 0.0, -5.521751378284825]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.0759150984150232, -0.3903007964405737, 0.045679777762273936, -0.05632002484775736]\n",
|
||||
" B: [-1.021003529021616, -0.07269336486556076, 0.11388411952175649, 0.15554513267817288]\n",
|
||||
" B: [-1.6939705353811365, -0.1440535362616654, -0.25084793375093056, -1.3363607550219565]\n",
|
||||
" B: [-1.185801144621379, -0.31618880274591826, 0.5459120200606805, -0.09016131075324207]\n",
|
||||
" B: [-1.197431131926246, 0.16472462054297168, -0.17198607315407527, -0.6141074056988615]\n",
|
||||
" B: [-1.0089442324730478, -0.12314856400749492, -0.027052115631495212, -0.04550910308256443]\n",
|
||||
" B: [-2.703474424566498, 0.16902217864171518, -0.14049660772763695, 2.502092358533033]\n",
|
||||
" B: [-1.3366035422714058, 0.7126382651365266, -0.11509318708057305, -0.5151788918068239]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.775111706253933, 0.0, 0.0, 8.717946171962454]\n",
|
||||
" B: [8.775111706253933, 0.0, 0.0, -8.717946171962454]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.2750151423103953, 1.8467170131598, 0.8729070809034145, 0.05799482008261441]\n",
|
||||
" B: [-1.5756212156561644, 1.0377655822554295, 0.3001332912880399, 0.5617337616455574]\n",
|
||||
" B: [-1.6945981163898138, -0.5153714693329569, 0.050834292767083435, 1.2662823142365867]\n",
|
||||
" B: [-2.630307241578496, -0.5126707368632603, 1.3344949978186418, -1.9684532002212756]\n",
|
||||
" B: [-3.0848917600353407, -2.827901193400985, -0.46541663267058264, -0.5503811129833626]\n",
|
||||
" B: [-2.812675339815945, 2.346626876124383, -1.1757879806725677, 0.14834923648401968]\n",
|
||||
" B: [-1.695817659938434, -0.3817827622891304, -0.19598317768122073, 1.3006267920675472]\n",
|
||||
" B: [-1.7812969367832734, -0.9933833096532803, -0.7211818717528079, -0.8161526113116866]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [6.832501783927461, 0.0, 0.0, 6.758925996589395]\n",
|
||||
" B: [6.832501783927461, 0.0, 0.0, -6.758925996589395]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.0114752465345387, -0.11558780230223581, -0.03776248532804595, -0.09108034372406744]\n",
|
||||
" B: [-1.031154612454516, -0.04425244057817861, -0.0789748074180023, -0.23470095032271823]\n",
|
||||
" B: [-2.2555952063288855, 1.7491237654517413, -0.4233804231771479, -0.9214254203222908]\n",
|
||||
" B: [-2.089561973736715, 0.9235335217807571, 1.3477207222453012, -0.8348676128969853]\n",
|
||||
" B: [-1.3199981586264844, -0.6902187266500668, -0.06216816149242132, -0.5119847340063199]\n",
|
||||
" B: [-1.0105028642371863, -0.09317036739551621, -0.041275823376393385, -0.1035935696630954]\n",
|
||||
" B: [-1.2426376312622325, -0.48126859609618416, 0.05225488689293943, -0.5565952280036419]\n",
|
||||
" B: [-3.704077874674367, -1.2481593542103167, -0.7564139083462295, 3.254247858939119]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.775903429741401, 0.0, 0.0, 8.718743086485969]\n",
|
||||
" B: [8.775903429741401, 0.0, 0.0, -8.718743086485969]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.7137666526922533, 1.1358800766324049, 0.08268488211087159, 0.7999598750311686]\n",
|
||||
" B: [-1.1669696745288112, -0.04351472671445914, 0.5992401461010018, 0.028912577361687116]\n",
|
||||
" B: [-3.5481649603318184, 0.4490928742123019, 1.0371640968528058, -3.21124287656006]\n",
|
||||
" B: [-1.276578701414564, -0.08287623449031867, -0.6317118623642547, -0.47299559576203803]\n",
|
||||
" B: [-4.955351547203613, -2.6459981607514886, 0.5026315754882429, 4.037519558961317]\n",
|
||||
" B: [-2.3130557250521284, 1.4242375193555785, -1.5228161303749386, 0.05296516521446809]\n",
|
||||
" B: [-1.4353464814836179, 0.25997106791735547, -0.029309860840599063, -0.9958792586507745]\n",
|
||||
" B: [-1.1425731167759967, -0.4967924161613736, -0.03788284697312998, -0.23923944559576807]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.907102929629284, 0.0, 0.0, 8.850789942090511]\n",
|
||||
" B: [8.907102929629284, 0.0, 0.0, -8.850789942090511]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.946046511363992, -0.9439001466724447, 2.1873638734369836, 1.4155146927582347]\n",
|
||||
" B: [-3.7848309582649415, -2.22832689875391, -0.18756115269295068, -2.885190709282662]\n",
|
||||
" B: [-1.0159875652570234, 0.04172671107403079, -0.15271016054388648, 0.08467125371989566]\n",
|
||||
" B: [-2.0867601165869685, -1.8155383548303043, -0.021995043965926685, -0.24063350631004576]\n",
|
||||
" B: [-4.34790862339958, 3.6266859724946396, -1.8990793068549607, 1.0700261868843775]\n",
|
||||
" B: [-1.1578951917200673, 0.35622580432348594, 0.23734793715600985, 0.3968506117802061]\n",
|
||||
" B: [-1.4421363377447174, 1.0156020669389267, -0.20020339434090184, -0.0907097523285523]\n",
|
||||
" B: [-1.0326405549212787, -0.052475154574424254, 0.03683724780563263, 0.24947122277854633]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [6.294285658794556, 0.0, 0.0, 6.214340830249562]\n",
|
||||
" B: [6.294285658794556, 0.0, 0.0, -6.214340830249562]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.06844272609547, -0.2848922847204133, 0.15179083391454987, -0.19330232226393051]\n",
|
||||
" B: [-2.114647837734541, -1.6956804594706658, -0.38950327120442063, 0.6668511518515798]\n",
|
||||
" B: [-1.494217345848325, 0.7529614584695401, -0.5432224448027106, -0.6088053006963738]\n",
|
||||
" B: [-1.3783311635115514, 0.9215501628423943, 0.0395584401371469, -0.2213079833313275]\n",
|
||||
" B: [-1.7816982863175768, 0.5393674002906785, 0.38766524831377364, 1.316528482874748]\n",
|
||||
" B: [-1.659172767477475, 0.17135237894801714, -1.2297516401309854, -0.45956886117628726]\n",
|
||||
" B: [-1.55277617510909, -0.23319042207457166, 1.041131562383322, 0.522284545863997]\n",
|
||||
" B: [-1.5392850154950812, -0.17146823428497893, 0.5423312713893238, -1.022679713122405]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [6.965556009635571, 0.0, 0.0, 6.8934005050751415]\n",
|
||||
" B: [6.965556009635571, 0.0, 0.0, -6.8934005050751415]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.0775179795487104, -0.05690318568456522, -0.2919638065794134, 0.269377354945329]\n",
|
||||
" B: [-3.216279237662679, -2.600571207682032, 0.23217633942174215, 1.5898351096286563]\n",
|
||||
" B: [-1.9852997763312183, 1.2696870590322706, -0.6412445999499571, -0.9581833525279955]\n",
|
||||
" B: [-1.9885313318262752, 0.8019078287339996, 1.2060162608136897, 0.9255946577864792]\n",
|
||||
" B: [-1.4288503016026572, 0.2805632486843285, 0.07929023042776773, -0.9780646743628009]\n",
|
||||
" B: [-1.3652585458391595, -0.12810083240879516, 0.7809145290728301, -0.4875382774777694]\n",
|
||||
" B: [-1.8158888731893035, 0.7439741257624499, -1.2924797037897653, -0.2710186621991885]\n",
|
||||
" B: [-1.0534859732711408, -0.3105570364376559, -0.07270924941689365, -0.0900021557927108]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [6.43062328219917, 0.0, 0.0, 6.352394493225528]\n",
|
||||
" B: [6.43062328219917, 0.0, 0.0, -6.352394493225528]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.125364788369443, -1.214725294501684, 0.4075454777366224, 1.369497946736289]\n",
|
||||
" B: [-1.1032249572940587, -0.2977536437640783, 0.35819035202044425, 0.012155070594697458]\n",
|
||||
" B: [-2.225917349319406, 1.3039585629995813, -0.8668848261688078, 1.2259326287114942]\n",
|
||||
" B: [-2.717025897056506, -0.9721840017189309, 0.6274004665152297, -2.2457641565164295]\n",
|
||||
" B: [-1.000557419196324, 0.013685057618434337, 0.015873673340379625, 0.025997976872664537]\n",
|
||||
" B: [-1.1652637249339481, 0.20750251779397902, -0.05219673300317853, -0.5586212982154317]\n",
|
||||
" B: [-1.4667402310584912, 0.9160649085291783, -0.533306342231441, -0.16654228923208916]\n",
|
||||
" B: [-1.057152197170161, 0.043451893043520345, 0.0433779317907512, 0.3373441210488047]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [8.156196486154876, 0.0, 0.0, 8.094661272762755]\n",
|
||||
" B: [8.156196486154876, 0.0, 0.0, -8.094661272762755]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.4617318374080812, 0.10404421660552193, -0.19476289320497314, -1.0430254938944576]\n",
|
||||
" B: [-2.745518719911882, 2.0283487429720055, -0.01415841484271091, -1.556751090431481]\n",
|
||||
" B: [-1.193795120882441, -0.223211890483827, 0.20666745479885903, 0.5767250694363129]\n",
|
||||
" B: [-1.0771186742980503, 0.29121400254582763, -0.18584437613704033, 0.20209134345899718]\n",
|
||||
" B: [-2.9756813564276348, 0.7747616688600099, 0.31071107817153876, 2.6754219325851647]\n",
|
||||
" B: [-1.8605025819101852, -0.3441559100391822, 0.5570133470539003, 1.4257498722017754]\n",
|
||||
" B: [-3.3546424693401353, -1.4228183303706836, -0.7768040014609222, -2.7614832317390525]\n",
|
||||
" B: [-1.6434022121313414, -1.2081825000896715, 0.0971778056213486, 0.48127159838273986]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [9.631814348202784, 0.0, 0.0, 9.579762399884718]\n",
|
||||
" B: [9.631814348202784, 0.0, 0.0, -9.579762399884718]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-2.4271747113709625, -0.9216752449526319, 0.35006248470601437, 1.9796838331313595]\n",
|
||||
" B: [-1.926574191117535, -0.6155920425308834, -0.36855158619622796, 1.4821957628346814]\n",
|
||||
" B: [-2.809711053334662, 0.053095841327541846, -2.415282611989454, -1.0286238083410733]\n",
|
||||
" B: [-2.069340346061984, 0.0706218659128716, 1.6880494984307581, 0.6539655271821153]\n",
|
||||
" B: [-1.600891859223819, 0.522182956459051, 1.0136801062226364, -0.5124766796267364]\n",
|
||||
" B: [-2.3653602811566903, 0.7359929823506941, 2.003935313635875, 0.19361520696286152]\n",
|
||||
" B: [-4.134587420071929, 0.11270979705086029, -1.0448676862999513, -3.871738776569513]\n",
|
||||
" B: [-1.9299888340679847, 0.04266384438249662, -1.2270255185096508, 1.1033789344263045]\n",
|
||||
"\n",
|
||||
" Input for ABC Process: 'AB->ABBBBBBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [7.383091586636561, 0.0, 0.0, 7.31505580133628]\n",
|
||||
" B: [7.383091586636561, 0.0, 0.0, -7.31505580133628]\n",
|
||||
" 8 Outgoing Particles:\n",
|
||||
" A: [-1.0026822379766207, 0.02425303574920085, -0.0683120173174935, 0.010813366763733786]\n",
|
||||
" B: [-3.2851307251831745, -2.830568076855887, -0.9156122597784988, 0.9703723169846757]\n",
|
||||
" B: [-2.028220232462834, 1.6810294384373135, 0.4923274291375999, -0.21314558638988076]\n",
|
||||
" B: [-1.5191535227395792, -0.17123543395193966, -1.1293131485074372, -0.05619309939470401]\n",
|
||||
" B: [-1.1059696544762567, 0.2375361941082015, -0.40208228112542477, -0.07124094550113935]\n",
|
||||
" B: [-1.371740281577803, -0.2278482692103191, -0.6986437390927988, -0.5845113276468179]\n",
|
||||
" B: [-1.2867512190171768, 0.6015837296464805, -0.16735271525316733, -0.5155761675681034]\n",
|
||||
" B: [-3.166535299839676, 0.6852493820769491, 2.888988731937221, 0.4594814427522358]\n"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"@time inputs = [gen_process_input(process) for _ in 1:1000]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Internal error: stack overflow in type inference of materialize(Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(MetagraphOptimization.compute__8fd7c454_6214_11ee_3616_0f2435e477fe), Tuple{Array{MetagraphOptimization.ABCProcessInput, 1}}}).\n",
|
||||
"This might be caused by recursion over very long tuples or argument lists.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ename": "LoadError",
|
||||
"evalue": "StackOverflowError:",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"StackOverflowError:",
|
||||
"",
|
||||
"Stacktrace:",
|
||||
" [1] get",
|
||||
" @ ./iddict.jl:102 [inlined]",
|
||||
" [2] in",
|
||||
" @ ./iddict.jl:189 [inlined]",
|
||||
" [3] haskey",
|
||||
" @ ./abstractdict.jl:17 [inlined]",
|
||||
" [4] findall(sig::Type, table::Core.Compiler.CachedMethodTable{Core.Compiler.InternalMethodTable}; limit::Int64)",
|
||||
" @ Core.Compiler ./compiler/methodtable.jl:120",
|
||||
" [5] findall",
|
||||
" @ ./compiler/methodtable.jl:114 [inlined]",
|
||||
" [6] find_matching_methods(argtypes::Vector{Any}, atype::Any, method_table::Core.Compiler.CachedMethodTable{Core.Compiler.InternalMethodTable}, union_split::Int64, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:336",
|
||||
" [7] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:80",
|
||||
" [8] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1949",
|
||||
" [9] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2020",
|
||||
" [10] abstract_apply(interp::Core.Compiler.NativeInterpreter, argtypes::Vector{Any}, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1566",
|
||||
" [11] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1855",
|
||||
" [12] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2020",
|
||||
" [13] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1999",
|
||||
" [14] abstract_eval_statement_expr(interp::Core.Compiler.NativeInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2183",
|
||||
" [15] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2396",
|
||||
" [16] abstract_eval_basic_statement(interp::Core.Compiler.NativeInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2682",
|
||||
" [17] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2867",
|
||||
" [18] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2955",
|
||||
" [19] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:246",
|
||||
" [20] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:216",
|
||||
" [21] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:932",
|
||||
" [22] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:611",
|
||||
" [23] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:152",
|
||||
"--- the last 16 lines are repeated 413 more times ---",
|
||||
" [6632] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1949",
|
||||
" [6633] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2020",
|
||||
" [6634] abstract_apply(interp::Core.Compiler.NativeInterpreter, argtypes::Vector{Any}, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1566",
|
||||
" [6635] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1855",
|
||||
" [6636] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2020",
|
||||
" [6637] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1999",
|
||||
" [6638] abstract_eval_statement_expr(interp::Core.Compiler.NativeInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2183",
|
||||
" [6639] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2396",
|
||||
" [6640] abstract_eval_basic_statement(interp::Core.Compiler.NativeInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2658",
|
||||
" [6641] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2867",
|
||||
" [6642] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2955",
|
||||
" [6643] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:246",
|
||||
" [6644] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:216",
|
||||
" [6645] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:932",
|
||||
" [6646] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:611",
|
||||
" [6647] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:152",
|
||||
" [6648] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1949",
|
||||
" [6649] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Nothing)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2020",
|
||||
" [6650] abstract_call(interp::Core.Compiler.NativeInterpreter, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:1999",
|
||||
" [6651] abstract_eval_statement_expr(interp::Core.Compiler.NativeInterpreter, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState, mi::Nothing)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2183",
|
||||
" [6652] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2396",
|
||||
" [6653] abstract_eval_basic_statement(interp::Core.Compiler.NativeInterpreter, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2682",
|
||||
" [6654] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2867",
|
||||
" [6655] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/abstractinterpretation.jl:2955",
|
||||
" [6656] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:246",
|
||||
" [6657] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:216",
|
||||
" [6658] typeinf",
|
||||
" @ ./compiler/typeinfer.jl:12 [inlined]",
|
||||
" [6659] typeinf_type(interp::Core.Compiler.NativeInterpreter, method::Method, atype::Any, sparams::Core.SimpleVector)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:1079",
|
||||
" [6660] return_type(interp::Core.Compiler.NativeInterpreter, t::DataType)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:1140",
|
||||
" [6661] return_type(f::Any, t::DataType)",
|
||||
" @ Core.Compiler ./compiler/typeinfer.jl:1112",
|
||||
" [6662] combine_eltypes(f::Function, args::Tuple{Vector{ABCProcessInput}})",
|
||||
" @ Base.Broadcast ./broadcast.jl:730",
|
||||
" [6663] copy(bc::Base.Broadcast.Broadcasted{Style}) where Style",
|
||||
" @ Base.Broadcast ./broadcast.jl:895",
|
||||
" [6664] materialize(bc::Base.Broadcast.Broadcasted)",
|
||||
" @ Base.Broadcast ./broadcast.jl:873",
|
||||
" [6665] var\"##core#293\"()",
|
||||
" @ Main ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:489",
|
||||
" [6666] var\"##sample#294\"(::Tuple{}, __params::BenchmarkTools.Parameters)",
|
||||
" @ Main ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:495",
|
||||
" [6667] _run(b::BenchmarkTools.Benchmark, p::BenchmarkTools.Parameters; verbose::Bool, pad::String, kwargs::Base.Pairs{Symbol, Integer, NTuple{4, Symbol}, NamedTuple{(:samples, :evals, :gctrial, :gcsample), Tuple{Int64, Int64, Bool, Bool}}})",
|
||||
" @ BenchmarkTools ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:99",
|
||||
" [6668] #invokelatest#2",
|
||||
" @ ./essentials.jl:821 [inlined]",
|
||||
" [6669] invokelatest",
|
||||
" @ ./essentials.jl:816 [inlined]",
|
||||
" [6670] #run_result#45",
|
||||
" @ ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:34 [inlined]",
|
||||
" [6671] run_result",
|
||||
" @ ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:34 [inlined]",
|
||||
" [6672] run(b::BenchmarkTools.Benchmark, p::BenchmarkTools.Parameters; progressid::Nothing, nleaves::Float64, ndone::Float64, kwargs::Base.Pairs{Symbol, Integer, NTuple{5, Symbol}, NamedTuple{(:verbose, :samples, :evals, :gctrial, :gcsample), Tuple{Bool, Int64, Int64, Bool, Bool}}})",
|
||||
" @ BenchmarkTools ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:117",
|
||||
" [6673] run (repeats 2 times)",
|
||||
" @ ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:117 [inlined]",
|
||||
" [6674] #warmup#54",
|
||||
" @ ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:169 [inlined]",
|
||||
" [6675] warmup(item::BenchmarkTools.Benchmark)",
|
||||
" @ BenchmarkTools ~/.julia/packages/BenchmarkTools/0owsb/src/execution.jl:168"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"using BenchmarkTools\n",
|
||||
"@benchmark compute_AB_AB7.(inputs)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.9.3",
|
||||
"language": "julia",
|
||||
"name": "julia-1.9"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.9.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
409
notebooks/abc_model_showcase.ipynb
Normal file
409
notebooks/abc_model_showcase.ipynb
Normal file
@ -0,0 +1,409 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"id": "20768e45-df62-4638-ba33-b0ccf239f1aa",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using Revise\n",
|
||||
"using MetagraphOptimization\n",
|
||||
"using BenchmarkTools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"id": "ff5f4a49",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Found 1 NUMA nodes\n",
|
||||
"CUDA is non-functional\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"Machine(MetagraphOptimization.AbstractDevice[MetagraphOptimization.NumaNode(0x0000, 0x0001, MetagraphOptimization.LocalVariables(), -1.0, UUID(\"a89974f6-6212-11ee-0866-0f591a3b69ea\"))], [-1.0;;])"
|
||||
]
|
||||
},
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Get our machine's info\n",
|
||||
"machine = get_machine_info()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"id": "9df482a4-ca44-44c5-9ea7-7a2977d529be",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"ABCModel()"
|
||||
]
|
||||
},
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Create a model identifier\n",
|
||||
"model = ABCModel()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"id": "30b16872-07f7-4d47-8ff8-8c3a849c9d4e",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"ABC Process: 'AB->ABBB'"
|
||||
]
|
||||
},
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Create a process in our model\n",
|
||||
"process_str = \"AB->ABBB\"\n",
|
||||
"process = parse_process(process_str, model)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"id": "043bd9e2-f89a-4362-885a-8c89d4cdd76f",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Total: 280, ComputeTaskP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"Graph:\n",
|
||||
" Nodes: \n",
|
||||
" Edges: 385\n",
|
||||
" Total Compute Effort: 1075.0\n",
|
||||
" Total Data Transfer: 10944.0\n",
|
||||
" Total Compute Intensity: 0.09822733918128655\n"
|
||||
]
|
||||
},
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
": 6, ComputeTaskU: 6, \n",
|
||||
" ComputeTaskV: 64, ComputeTaskSum: 1, ComputeTaskS2: 24, \n",
|
||||
" ComputeTaskS1: 36, DataTask: 143"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Read the graph (of the same process) from a file\n",
|
||||
"graph = parse_dag(\"../input/$process_str.txt\", model)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"id": "02f01ad3-fd10-48d5-a0e0-c03dc83c80a4",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"Input for ABC Process: 'AB->ABBB':\n",
|
||||
" 2 Incoming particles:\n",
|
||||
" A: [5.77986599979293, 0.0, 0.0, 5.692701553354288]\n",
|
||||
" B: [5.77986599979293, 0.0, 0.0, -5.692701553354288]\n",
|
||||
" 4 Outgoing Particles:\n",
|
||||
" A: [-3.8835293143673746, -1.4292027910861678, 2.8576090179942106, 1.968057422378813]\n",
|
||||
" B: [-1.1554024905063585, -0.1464656500147254, -0.2082400426692148, 0.5197487980391896]\n",
|
||||
" B: [-2.849749730594798, -1.0177034035100576, -2.464951858896686, -0.09677625137882176]\n",
|
||||
" B: [-3.6710504641173287, 2.5933718446109513, -0.1844171164283155, -2.391029969039186]\n"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Generate some random input data for our process\n",
|
||||
"input_data = gen_process_input(process)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"id": "083fb1be-ce2a-47f9-afb9-60a6fdfaed0b",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"compute__af4450a2_6212_11ee_2601_cde7cf2aedc1 (generic function with 1 method)"
|
||||
]
|
||||
},
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Get the function computing the result of the process from a ProcessInput\n",
|
||||
"AB_AB3_compute = get_compute_function(graph, process, machine)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"id": "a40c9500-8f79-4f04-b3c5-59b72a6b7ba9",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"-1.8924431710735022e-13"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Actually compute a result using the generated function and the input data\n",
|
||||
"result = AB_AB3_compute(input_data)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"id": "80c70010",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"include(\"../examples/profiling_utilities.jl\")\n",
|
||||
"\n",
|
||||
"# We can also mute the graph by applying some operations to it\n",
|
||||
"reduce_all!(graph)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"id": "5b192b44",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# The result should be the same as before (we can use execute to save having to generate the function ourselves)\n",
|
||||
"@assert result ≈ execute(graph, process, machine, input_data)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"id": "9b2f4a3f",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"1000-element Vector{Float64}:\n",
|
||||
" -2.1491995259940396e-11\n",
|
||||
" -1.04995646459455e-11\n",
|
||||
" 5.821760691187782e-15\n",
|
||||
" -6.556969485683705e-14\n",
|
||||
" -1.3588086164373753e-14\n",
|
||||
" -1.8789662441593694e-13\n",
|
||||
" -2.131973301835892e-13\n",
|
||||
" -5.3359759072004825e-12\n",
|
||||
" -9.053914191490223e-13\n",
|
||||
" -5.61107901706923e-13\n",
|
||||
" -5.063492275603428e-11\n",
|
||||
" 2.9168508985811397e-15\n",
|
||||
" -1.6420151378194157e-13\n",
|
||||
" ⋮\n",
|
||||
" 1.0931677247833436e-13\n",
|
||||
" -7.704755306462797e-16\n",
|
||||
" -1.8385907037491397e-12\n",
|
||||
" -6.036215596560059e-14\n",
|
||||
" -9.98872401400362e-12\n",
|
||||
" 3.4861755637292935e-13\n",
|
||||
" -1.1051119822969222e-10\n",
|
||||
" -2.496572513216201e-12\n",
|
||||
" -3.8682427847201926e-11\n",
|
||||
" 7.904149696653438e-15\n",
|
||||
" -7.606811743178716e-11\n",
|
||||
" -5.100594937480292e-13"
|
||||
]
|
||||
},
|
||||
"execution_count": 12,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Now we can generate a function and use it on lots of inputs\n",
|
||||
"inputs = [gen_process_input(process) for _ in 1:1000]\n",
|
||||
"AB_AB3_reduced_compute = get_compute_function(graph, process, machine)\n",
|
||||
"\n",
|
||||
"results = AB_AB3_reduced_compute.(inputs)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"id": "d43e4ff0",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"BenchmarkTools.Trial: 879 samples with 1 evaluation.\n",
|
||||
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m4.567 ms\u001b[22m\u001b[39m … \u001b[35m14.334 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m0.00% … 54.51%\n",
|
||||
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m4.998 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m0.00%\n",
|
||||
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m5.686 ms\u001b[22m\u001b[39m ± \u001b[32m 1.414 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m9.09% ± 14.49%\n",
|
||||
"\n",
|
||||
" \u001b[39m \u001b[39m \u001b[39m▃\u001b[39m▇\u001b[39m█\u001b[34m▅\u001b[39m\u001b[39m▄\u001b[39m▁\u001b[39m \u001b[39m▁\u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m \u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m▁\u001b[39m▁\u001b[39m \u001b[39m▁\u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
|
||||
" \u001b[39m▆\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[34m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m█\u001b[39m▇\u001b[39m▇\u001b[32m█\u001b[39m\u001b[39m▆\u001b[39m█\u001b[39m█\u001b[39m▆\u001b[39m▆\u001b[39m▇\u001b[39m▅\u001b[39m▅\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▅\u001b[39m▅\u001b[39m▆\u001b[39m▅\u001b[39m▅\u001b[39m▄\u001b[39m▁\u001b[39m▄\u001b[39m▄\u001b[39m▁\u001b[39m▅\u001b[39m▄\u001b[39m▄\u001b[39m▆\u001b[39m▇\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▄\u001b[39m▅\u001b[39m▆\u001b[39m▅\u001b[39m▅\u001b[39m▅\u001b[39m▁\u001b[39m▅\u001b[39m▄\u001b[39m▄\u001b[39m▅\u001b[39m▁\u001b[39m▄\u001b[39m \u001b[39m▇\n",
|
||||
" 4.57 ms\u001b[90m \u001b[39m\u001b[90mHistogram: \u001b[39m\u001b[90m\u001b[1mlog(\u001b[22m\u001b[39m\u001b[90mfrequency\u001b[39m\u001b[90m\u001b[1m)\u001b[22m\u001b[39m\u001b[90m by time\u001b[39m 10 ms \u001b[0m\u001b[1m<\u001b[22m\n",
|
||||
"\n",
|
||||
" Memory estimate\u001b[90m: \u001b[39m\u001b[33m6.17 MiB\u001b[39m, allocs estimate\u001b[90m: \u001b[39m\u001b[33m143006\u001b[39m."
|
||||
]
|
||||
},
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"@benchmark results = AB_AB3_compute.($inputs)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"id": "e18d9546",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"BenchmarkTools.Trial: 1089 samples with 1 evaluation.\n",
|
||||
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m3.637 ms\u001b[22m\u001b[39m … \u001b[35m10.921 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m 0.00% … 59.52%\n",
|
||||
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m4.098 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m 0.00%\n",
|
||||
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m4.587 ms\u001b[22m\u001b[39m ± \u001b[32m 1.334 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m10.21% ± 15.77%\n",
|
||||
"\n",
|
||||
" \u001b[39m \u001b[39m▂\u001b[39m▆\u001b[39m▆\u001b[39m▇\u001b[34m█\u001b[39m\u001b[39m▆\u001b[39m▂\u001b[39m \u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m▁\u001b[39m▁\u001b[39m \u001b[39m▁\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
|
||||
" \u001b[39m▆\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m█\u001b[34m█\u001b[39m\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m█\u001b[39m▇\u001b[32m▆\u001b[39m\u001b[39m▅\u001b[39m▇\u001b[39m▅\u001b[39m▅\u001b[39m▅\u001b[39m▄\u001b[39m▆\u001b[39m▄\u001b[39m▅\u001b[39m▅\u001b[39m▅\u001b[39m▅\u001b[39m▆\u001b[39m▄\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▄\u001b[39m▆\u001b[39m▆\u001b[39m▆\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m█\u001b[39m█\u001b[39m▆\u001b[39m▆\u001b[39m▆\u001b[39m█\u001b[39m█\u001b[39m▇\u001b[39m▆\u001b[39m▄\u001b[39m▄\u001b[39m \u001b[39m█\n",
|
||||
" 3.64 ms\u001b[90m \u001b[39m\u001b[90mHistogram: \u001b[39m\u001b[90m\u001b[1mlog(\u001b[22m\u001b[39m\u001b[90mfrequency\u001b[39m\u001b[90m\u001b[1m)\u001b[22m\u001b[39m\u001b[90m by time\u001b[39m 8.78 ms \u001b[0m\u001b[1m<\u001b[22m\n",
|
||||
"\n",
|
||||
" Memory estimate\u001b[90m: \u001b[39m\u001b[33m5.26 MiB\u001b[39m, allocs estimate\u001b[90m: \u001b[39m\u001b[33m123006\u001b[39m."
|
||||
]
|
||||
},
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"@benchmark results = AB_AB3_reduced_compute.($inputs)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"id": "13efed12-3547-400b-a7a2-5dfae9a973a2",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Set a different caching strategy\n",
|
||||
"MetagraphOptimization.set_cache_strategy(machine.devices[1], MetagraphOptimization.Dictionary())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"id": "ef62716b-a219-4f6e-9150-f984d3734839",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"BenchmarkTools.Trial: 331 samples with 1 evaluation.\n",
|
||||
" Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m12.148 ms\u001b[22m\u001b[39m … \u001b[35m24.164 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m 0.00% … 13.35%\n",
|
||||
" Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m15.412 ms \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m17.47%\n",
|
||||
" Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m15.117 ms\u001b[22m\u001b[39m ± \u001b[32m 2.194 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m12.31% ± 8.95%\n",
|
||||
"\n",
|
||||
" \u001b[39m \u001b[39m▄\u001b[39m█\u001b[39m▄\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[32m▄\u001b[39m\u001b[39m▄\u001b[34m▂\u001b[39m\u001b[39m \u001b[39m▂\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \n",
|
||||
" \u001b[39m▅\u001b[39m█\u001b[39m█\u001b[39m█\u001b[39m▅\u001b[39m▃\u001b[39m▃\u001b[39m▂\u001b[39m▃\u001b[39m▂\u001b[39m▅\u001b[39m▂\u001b[39m▃\u001b[39m▁\u001b[39m▂\u001b[39m▂\u001b[39m▂\u001b[39m▃\u001b[39m▂\u001b[39m▃\u001b[32m█\u001b[39m\u001b[39m█\u001b[34m█\u001b[39m\u001b[39m▇\u001b[39m█\u001b[39m▄\u001b[39m▆\u001b[39m▄\u001b[39m▆\u001b[39m▄\u001b[39m▄\u001b[39m▆\u001b[39m▅\u001b[39m▄\u001b[39m▃\u001b[39m▄\u001b[39m▂\u001b[39m▂\u001b[39m▃\u001b[39m▃\u001b[39m▄\u001b[39m▃\u001b[39m▂\u001b[39m▂\u001b[39m▁\u001b[39m▂\u001b[39m▂\u001b[39m▃\u001b[39m▂\u001b[39m▂\u001b[39m▁\u001b[39m▂\u001b[39m▁\u001b[39m▃\u001b[39m▃\u001b[39m▂\u001b[39m▂\u001b[39m▁\u001b[39m▂\u001b[39m \u001b[39m▃\n",
|
||||
" 12.1 ms\u001b[90m Histogram: frequency by time\u001b[39m 21 ms \u001b[0m\u001b[1m<\u001b[22m\n",
|
||||
"\n",
|
||||
" Memory estimate\u001b[90m: \u001b[39m\u001b[33m27.46 MiB\u001b[39m, allocs estimate\u001b[90m: \u001b[39m\u001b[33m118013\u001b[39m."
|
||||
]
|
||||
},
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# ... and bench again\n",
|
||||
"AB_AB3_reduced_dict_compute = get_compute_function(graph, process, machine)\n",
|
||||
"@benchmark results = AB_AB3_reduced_dict_compute.($inputs)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "5461ffd4-6a0e-4f1f-b1f1-3a2854a8ae88",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.9.3",
|
||||
"language": "julia",
|
||||
"name": "julia-1.9"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.9.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
70
notebooks/profiling.ipynb
Normal file
70
notebooks/profiling.ipynb
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using Revise; using MetagraphOptimization; using BenchmarkTools; using ProfileView\n",
|
||||
"using Base.Threads\n",
|
||||
"nthreads()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"model = ABCModel()\n",
|
||||
"process_str = \"AB->ABBBBB\"\n",
|
||||
"process = parse_process(process_str, model)\n",
|
||||
"graph = parse_dag(\"../input/$process_str.txt\", model)\n",
|
||||
"print(graph)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"include(\"../examples/profiling_utilities.jl\")\n",
|
||||
"@ProfileView.profview reduce_all!(graph)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"@ProfileView.profview comp_func = get_compute_function(graph, process)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.9.3",
|
||||
"language": "julia",
|
||||
"name": "julia-1.9"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.9.3"
|
||||
},
|
||||
"orig_nbformat": 4
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
Reference in New Issue
Block a user