-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update validation scripts to CMSSW_14_1_0 (#323)
* update validation for cmssw 14 * it's running * update dqm for cmssw 14 * update with link * update recipe * added runtime plot notebook
- Loading branch information
Showing
9 changed files
with
346 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "edf63d45-5656-4b3f-8cd3-244aad8853b1", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt\n", | ||
"import pandas as pd\n", | ||
"import numpy as np" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "c08aa3bd-5ccf-4317-b357-0f91f1a08812", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"s1 = \"\"\"\n", | ||
"timing/gpu_fp32_fused.txt:Nelem=2560 mean_time=6.99 ms stddev_time=2.89 ms mem_used=1678 MB\n", | ||
"timing/gpu_fp32_fused.txt:Nelem=5120 mean_time=16.59 ms stddev_time=0.15 ms mem_used=1946 MB\n", | ||
"timing/gpu_fp32_fused.txt:Nelem=10240 mean_time=53.13 ms stddev_time=0.23 ms mem_used=1946 MB\n", | ||
"\"\"\"\n", | ||
"\n", | ||
"s2 = \"\"\"\n", | ||
"timing/gpu_fp32_unfused.txt:Nelem=2560 mean_time=39.31 ms stddev_time=1.73 ms mem_used=3817 MB\n", | ||
"timing/gpu_fp32_unfused.txt:Nelem=5120 mean_time=130.18 ms stddev_time=6.52 ms mem_used=12407 MB\n", | ||
"timing/gpu_fp32_unfused.txt:Nelem=10240 mean_time=465.09 ms stddev_time=25.82 ms mem_used=46766 MB\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8bac11cf-3b44-4156-97bf-7efc7a2a6da4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def parse_str(s):\n", | ||
" data = pd.DataFrame()\n", | ||
" Nelem = []\n", | ||
" mean_time = []\n", | ||
" stddev_time = []\n", | ||
" mem_used = []\n", | ||
" for line in s.strip().split(\"\\n\"):\n", | ||
" elems = line.split(\":\")[1].split()\n", | ||
" print(elems)\n", | ||
" Nelem.append(int(elems[0].split(\"=\")[1]))\n", | ||
" mean_time.append(float(elems[1].split(\"=\")[1]))\n", | ||
" stddev_time.append(float(elems[3].split(\"=\")[1]))\n", | ||
" mem_used.append(float(elems[5].split(\"=\")[1]))\n", | ||
" data[\"Nelem\"] = Nelem\n", | ||
" data[\"mean_time\"] = mean_time\n", | ||
" data[\"stddev_time\"] = stddev_time\n", | ||
" data[\"mem_used\"] = mem_used\n", | ||
" return data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "012a42e2-210e-48af-8419-9cde7acc53c4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"data_fused = parse_str(s1)\n", | ||
"data_unfused = parse_str(s2)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4c27f336-174e-430b-9035-80ad60c74e1b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plt.errorbar(data_unfused[\"Nelem\"], data_unfused[\"mean_time\"], yerr=data_unfused[\"stddev_time\"], marker=\"o\", label=\"ONNX unfused attention\")\n", | ||
"plt.errorbar(data_fused[\"Nelem\"], data_fused[\"mean_time\"], yerr=data_fused[\"stddev_time\"], marker=\"o\", label=\"ONNX fused attention\")\n", | ||
"plt.xticks(data_fused[\"Nelem\"])\n", | ||
"plt.ylabel(\"Runtime per event [ms]\")\n", | ||
"plt.xlabel(\"Elements per event\")\n", | ||
"plt.title(\"MLPF runtime, 2x6 layers, ONNX backend, A100\")\n", | ||
"plt.legend(loc=\"best\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b05b10e9-acca-4c71-945e-8568ac9ac3b5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plt.errorbar(data_unfused[\"Nelem\"], data_unfused[\"mem_used\"], marker=\"o\", label=\"ONNX unfused attention\")\n", | ||
"plt.errorbar(data_fused[\"Nelem\"], data_fused[\"mem_used\"], marker=\"o\", label=\"ONNX fused attention\")\n", | ||
"plt.xticks(data_fused[\"Nelem\"])\n", | ||
"plt.ylabel(\"GPU memory used [MB]\")\n", | ||
"plt.xlabel(\"Elements per event\")\n", | ||
"plt.title(\"MLPF memory, 2x6 layers, ONNX backend, A100\")\n", | ||
"plt.yscale(\"log\")\n", | ||
"plt.legend(loc=\"best\")\n", | ||
"ytick = [1000,2000,10000,20000,40000]\n", | ||
"plt.yticks(ytick, ytick)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "30df457b-bd9a-4dd4-a6ea-156dac41b7eb", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"s_cpu_pf = \"\"\"\n", | ||
"log_cpu_pf.txt:TimeModule> 35002 1 particleFlowTmp PFProducer 0.00893436\n", | ||
"log_cpu_pf.txt:TimeModule> 35005 1 particleFlowTmp PFProducer 0.00696006\n", | ||
"log_cpu_pf.txt:TimeModule> 35001 1 particleFlowTmp PFProducer 0.0205714\n", | ||
"log_cpu_pf.txt:TimeModule> 35004 1 particleFlowTmp PFProducer 0.0115013\n", | ||
"log_cpu_pf.txt:TimeModule> 35003 1 particleFlowTmp PFProducer 0.010012\n", | ||
"log_cpu_pf.txt:TimeModule> 35006 1 particleFlowTmp PFProducer 0.00605446\n", | ||
"log_cpu_pf.txt:TimeModule> 35010 1 particleFlowTmp PFProducer 0.0122532\n", | ||
"log_cpu_pf.txt:TimeModule> 35009 1 particleFlowTmp PFProducer 0.0221017\n", | ||
"log_cpu_pf.txt:TimeModule> 35008 1 particleFlowTmp PFProducer 0.00843328\n", | ||
"log_cpu_pf.txt:TimeModule> 35011 1 particleFlowTmp PFProducer 0.0095517\n", | ||
"log_cpu_pf.txt:TimeModule> 35012 1 particleFlowTmp PFProducer 0.00850458\n", | ||
"log_cpu_pf.txt:TimeModule> 35014 1 particleFlowTmp PFProducer 0.0196761\n", | ||
"log_cpu_pf.txt:TimeModule> 35007 1 particleFlowTmp PFProducer 0.00726191\n", | ||
"log_cpu_pf.txt:TimeModule> 35017 1 particleFlowTmp PFProducer 0.0126049\n", | ||
"log_cpu_pf.txt:TimeModule> 35018 1 particleFlowTmp PFProducer 0.00476037\n", | ||
"log_cpu_pf.txt:TimeModule> 35013 1 particleFlowTmp PFProducer 0.0111422\n", | ||
"log_cpu_pf.txt:TimeModule> 35016 1 particleFlowTmp PFProducer 0.0135155\n", | ||
"log_cpu_pf.txt:TimeModule> 35019 1 particleFlowTmp PFProducer 0.00631518\n", | ||
"log_cpu_pf.txt:TimeModule> 35015 1 particleFlowTmp PFProducer 0.00879818\n", | ||
"log_cpu_pf.txt:TimeModule> 35021 1 particleFlowTmp PFProducer 0.0111998\n", | ||
"\"\"\"\n", | ||
"\n", | ||
"s_cpu_mlpf = \"\"\"\n", | ||
"log_cpu.txt:TimeModule> 35002 1 particleFlowTmp MLPFProducer 9.4116\n", | ||
"log_cpu.txt:TimeModule> 35005 1 particleFlowTmp MLPFProducer 8.02389\n", | ||
"log_cpu.txt:TimeModule> 35001 1 particleFlowTmp MLPFProducer 13.4437\n", | ||
"log_cpu.txt:TimeModule> 35004 1 particleFlowTmp MLPFProducer 10.4151\n", | ||
"log_cpu.txt:TimeModule> 35003 1 particleFlowTmp MLPFProducer 12.1385\n", | ||
"log_cpu.txt:TimeModule> 35006 1 particleFlowTmp MLPFProducer 7.06085\n", | ||
"log_cpu.txt:TimeModule> 35010 1 particleFlowTmp MLPFProducer 12.1508\n", | ||
"log_cpu.txt:TimeModule> 35009 1 particleFlowTmp MLPFProducer 13.2121\n", | ||
"log_cpu.txt:TimeModule> 35008 1 particleFlowTmp MLPFProducer 10.3394\n", | ||
"log_cpu.txt:TimeModule> 35011 1 particleFlowTmp MLPFProducer 9.24309\n", | ||
"log_cpu.txt:TimeModule> 35012 1 particleFlowTmp MLPFProducer 9.26367\n", | ||
"log_cpu.txt:TimeModule> 35014 1 particleFlowTmp MLPFProducer 13.2224\n", | ||
"log_cpu.txt:TimeModule> 35007 1 particleFlowTmp MLPFProducer 8.03034\n", | ||
"log_cpu.txt:TimeModule> 35017 1 particleFlowTmp MLPFProducer 12.1319\n", | ||
"log_cpu.txt:TimeModule> 35018 1 particleFlowTmp MLPFProducer 5.83649\n", | ||
"log_cpu.txt:TimeModule> 35013 1 particleFlowTmp MLPFProducer 11.9684\n", | ||
"log_cpu.txt:TimeModule> 35016 1 particleFlowTmp MLPFProducer 10.2273\n", | ||
"log_cpu.txt:TimeModule> 35019 1 particleFlowTmp MLPFProducer 6.9992\n", | ||
"log_cpu.txt:TimeModule> 35015 1 particleFlowTmp MLPFProducer 7.96592\n", | ||
"log_cpu.txt:TimeModule> 35021 1 particleFlowTmp MLPFProducer 11.9789\n", | ||
"\"\"\"\n", | ||
"\n", | ||
"s_gpu_mlpf = \"\"\"\n", | ||
"log_gpu.txt:TimeModule> 35002 1 particleFlowTmp MLPFProducer 0.177305\n", | ||
"log_gpu.txt:TimeModule> 35005 1 particleFlowTmp MLPFProducer 0.0156437\n", | ||
"log_gpu.txt:TimeModule> 35001 1 particleFlowTmp MLPFProducer 0.0187983\n", | ||
"log_gpu.txt:TimeModule> 35004 1 particleFlowTmp MLPFProducer 0.0158696\n", | ||
"log_gpu.txt:TimeModule> 35003 1 particleFlowTmp MLPFProducer 0.0171756\n", | ||
"log_gpu.txt:TimeModule> 35006 1 particleFlowTmp MLPFProducer 0.0125436\n", | ||
"log_gpu.txt:TimeModule> 35010 1 particleFlowTmp MLPFProducer 0.0167758\n", | ||
"log_gpu.txt:TimeModule> 35009 1 particleFlowTmp MLPFProducer 0.0184546\n", | ||
"log_gpu.txt:TimeModule> 35008 1 particleFlowTmp MLPFProducer 0.0161449\n", | ||
"log_gpu.txt:TimeModule> 35011 1 particleFlowTmp MLPFProducer 0.0146528\n", | ||
"log_gpu.txt:TimeModule> 35012 1 particleFlowTmp MLPFProducer 0.0149266\n", | ||
"log_gpu.txt:TimeModule> 35014 1 particleFlowTmp MLPFProducer 0.0183499\n", | ||
"log_gpu.txt:TimeModule> 35007 1 particleFlowTmp MLPFProducer 0.0130879\n", | ||
"log_gpu.txt:TimeModule> 35017 1 particleFlowTmp MLPFProducer 0.0170359\n", | ||
"log_gpu.txt:TimeModule> 35018 1 particleFlowTmp MLPFProducer 0.0111724\n", | ||
"log_gpu.txt:TimeModule> 35013 1 particleFlowTmp MLPFProducer 0.0167873\n", | ||
"log_gpu.txt:TimeModule> 35016 1 particleFlowTmp MLPFProducer 0.0162624\n", | ||
"log_gpu.txt:TimeModule> 35019 1 particleFlowTmp MLPFProducer 0.0118865\n", | ||
"log_gpu.txt:TimeModule> 35015 1 particleFlowTmp MLPFProducer 0.0126998\n", | ||
"log_gpu.txt:TimeModule> 35021 1 particleFlowTmp MLPFProducer 0.0169669\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f4d38d03-5980-4c05-9320-84f3801d4d4a", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def parse_cmssw(s):\n", | ||
" s = s.strip()\n", | ||
" times = []\n", | ||
" for line in s.split(\"\\n\"):\n", | ||
" if len(line)>0:\n", | ||
" time = float(line.split()[-1])*1000.0\n", | ||
" times.append(time)\n", | ||
" return np.array(times)\n", | ||
" " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ec4031a8-0730-4a52-9918-bb2e0b918e62", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"times_pf_cpu = parse_cmssw(s_cpu_pf)\n", | ||
"times_mlpf_cpu = parse_cmssw(s_cpu_mlpf)\n", | ||
"times_mlpf_gpu = parse_cmssw(s_gpu_mlpf)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "1b1ce3d3-083d-49b6-a367-79a9376eac1b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plt.bar([0,1], [np.mean(times_pf_cpu[1:]), np.mean(times_mlpf_gpu[1:])], yerr=[np.std(times_pf_cpu[1:]), np.std(times_mlpf_gpu[1:])])\n", | ||
"plt.xticks([0,1], [\"PF on CPU\", \"MLPF-2x6x512-relu on GPU\"])\n", | ||
"plt.ylabel(\"runtime per event [ms]\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.