Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: YunLiu <[email protected]>
  • Loading branch information
KumoLiu committed Mar 21, 2024
1 parent 348aa89 commit 1c98556
Showing 1 changed file with 28 additions and 47 deletions.
75 changes: 28 additions & 47 deletions pathology/tumor_detection/ignite/profiling_camelyon_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -173,68 +173,49 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Generating SQLite file profile_report.sqlite from profile_report.nsys-rep\n",
"Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_sum.py]... \n",
"\n",
" ** NVTX Push/Pop Range Summary (nvtx_pushpop_sum):\n",
"\n",
"+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+\n",
"| Time (%) | Total Time (ns) | Instances | Avg (ns) | Med (ns) | Min (ns) | Max (ns) | StdDev (ns) | Range |\n",
"+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+\n",
"| 34.4 | 47704653683 | 129 | 369803516.9 | 358617801.0 | 234738021 | 535108737 | 33489230.8 | Batch |\n",
"| 27.2 | 37699714377 | 1287 | 29292707.4 | 27888842.0 | 20820937 | 145382974 | 4765249.1 | Preprocessing |\n",
"| 16.6 | 23051261956 | 11583 | 1990094.3 | 1837250.0 | 1560394 | 7255081 | 341473.8 | TorchVisiond_ColorJitter |\n",
"| 8.7 | 12131330955 | 128 | 94776023.1 | 94214722.5 | 93444336 | 104074967 | 1749829.5 | Iteration |\n",
"| 3.5 | 4881131268 | 11574 | 421732.4 | 69884.5 | 53105 | 119024837 | 1281351.6 | RandZoomd |\n",
"| 1.5 | 2075900733 | 11550 | 179731.7 | 175026.5 | 167517 | 612451 | 21171.5 | Postprocessing |\n",
"| 1.3 | 1836174761 | 11583 | 158523.2 | 62934.0 | 49873 | 659180 | 116884.3 | RandRotate90d |\n",
"| 1.3 | 1744964291 | 11583 | 150648.7 | 105426.0 | 43448 | 646626 | 106911.0 | RandFlipd |\n",
"| 1.3 | 1737814097 | 11574 | 150148.1 | 147480.5 | 109352 | 396708 | 23842.2 | ScaleIntensityRanged |\n",
"| 0.7 | 990281724 | 11550 | 85738.7 | 83495.0 | 79084 | 298498 | 11668.8 | Activationsd |\n",
"| 0.6 | 883141689 | 11574 | 76303.9 | 73304.0 | 66864 | 163580 | 9082.6 | ToTensord_2 |\n",
"| 0.6 | 872809870 | 11551 | 75561.4 | 73521.0 | 70010 | 502970 | 11286.8 | AsDiscreted |\n",
"| 0.6 | 825739652 | 1287 | 641600.4 | 586861.0 | 510347 | 11857031 | 490294.7 | GridSplitd |\n",
"| 0.6 | 800538524 | 11583 | 69113.2 | 64120.0 | 58171 | 189635 | 12929.6 | ToNumpyd |\n",
"| 0.4 | 500292340 | 128 | 3908533.9 | 3835848.5 | 3714814 | 8492318 | 429547.1 | ResNet18 |\n",
"| 0.3 | 484610710 | 11576 | 41863.4 | 39431.5 | 25715 | 204417 | 13330.5 | CastToTyped |\n",
"| 0.3 | 469505639 | 11583 | 40534.0 | 37522.0 | 34480 | 103847 | 7448.3 | ToTensord |\n",
"| 0.1 | 111048250 | 1287 | 86284.6 | 82394.0 | 75459 | 222575 | 12660.6 | Lambdad |\n",
"| 0.0 | 14901334 | 128 | 116416.7 | 113834.0 | 107397 | 171060 | 9555.4 | Loss |\n",
"+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+\n",
"\n",
"Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_sum.py] to [profile_report_nvtx_pushpop_sum.csv]... PROCESSED\n",
"\n",
"Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_trace.py] to [profile_report_nvtx_pushpop_trace.csv]... PROCESSED\n",
"\n"
]
}
],
"outputs": [],
"source": [
"!nsys stats \\\n",
" --report nvtx_pushpop_sum,nvtx_pushpop_sum,nvtx_pushpop_trace \\\n",
" --format table,csv \\\n",
" --output -,. \\\n",
" --force-overwrite true \\\n",
" profile_report.nsys-rep"
" profile_report.nsys-rep > ./test.log"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/workspace/Code/tutorials/pathology/tumor_detection/ignite\n"
]
},
{
"ename": "ValueError",
"evalue": "current_dir: /workspace/Code/tutorials/pathology/tumor_detection/ignite,\n output mes: ['', 'NOTICE: Existing SQLite export found: profile_report.sqlite', 'It is assumed file was previously exported from: profile_report.nsys-rep', 'Consider using --force-export=true if needed.', '', 'Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_sum.py]...', '', '** NVTX Push/Pop Range Summary (nvtx_pushpop_sum):', '', '+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+', '| Time (%) | Total Time (ns) | Instances | Avg (ns) | Med (ns) | Min (ns) | Max (ns) | StdDev (ns) | Range |', '+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+', '| 34.2 | 47482362631 | 128 | 370955958.1 | 358562192.0 | 327889378 | 648551751 | 40447366.0 | Batch |', '| 27.2 | 37652273041 | 1283 | 29347056.2 | 27990309.0 | 25510981 | 63006131 | 4219002.3 | Preprocessing |', '| 16.7 | 23152629098 | 11548 | 2004903.8 | 1847443.0 | 1516855 | 5860395 | 364009.9 | TorchVisiond_ColorJitter |', '| 8.8 | 12256579557 | 129 | 95012244.6 | 94605781.0 | 12875054 | 208296279 | 12394152.4 | Iteration |', '| 3.5 | 4806197198 | 11556 | 415904.9 | 70161.0 | 52826 | 5152586 | 661896.3 | RandZoomd |', '| 1.5 | 2084419592 | 11520 | 180939.2 | 176996.5 | 169304 | 445132 | 18836.6 | Postprocessing |', '| 1.3 | 1832796075 | 11556 | 158601.3 | 62354.5 | 49292 | 727842 | 118659.5 | RandRotate90d |', '| 1.3 | 1760763827 | 11556 | 152367.9 | 105570.0 | 44092 | 695443 | 110395.5 | RandFlipd |', '| 1.2 | 1691950895 | 11556 | 146413.2 | 142806.0 | 106748 | 370831 | 30029.8 | ScaleIntensityRanged |', '| 0.7 | 994755525 | 11520 | 86350.3 | 84425.0 | 80408 | 250947 | 10746.7 | Activationsd |', '| 0.6 | 881793011 | 11556 | 76306.1 | 72938.5 | 67501 | 168425 | 10725.6 | ToTensord_2 |', '| 0.6 | 878529245 | 11520 | 76261.2 | 74537.0 | 71016 | 300255 | 9709.4 | AsDiscreted |', '| 0.6 | 809885387 | 1283 | 631243.5 | 581810.0 | 509254 | 11570290 | 451577.9 | GridSplitd |', '| 0.6 | 799377380 | 11556 | 69174.2 | 64053.5 | 58099 | 368143 | 13890.4 | ToNumpyd |', '| 0.4 | 510636803 | 129 | 3958424.8 | 3883326.0 | 3775417 | 9349836 | 492280.2 | ResNet18 |', '| 0.3 | 476016190 | 11556 | 41192.1 | 38019.0 | 25499 | 210803 | 14052.4 | CastToTyped |', '| 0.3 | 470000875 | 11547 | 40703.3 | 37342.0 | 34594 | 136998 | 8392.8 | ToTensord |', '| 0.1 | 110408584 | 1283 | 86055.0 | 82258.0 | 74326 | 206279 | 12671.7 | Lambdad |', '| 0.0 | 14785990 | 129 | 114620.1 | 111590.0 | 107197 | 229349 | 13553.9 | Loss |', '+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+', '', 'Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_sum.py] to [profile_report_nvtx_pushpop_sum.csv]... PROCESSED', '', 'Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_trace.py] to [profile_report_nvtx_pushpop_trace.csv]... PROCESSED', '']",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[5], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m file_path \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mjoin(current_dir, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mprofile_report_nvtx_pushpop_sum.csv\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28mprint\u001b[39m(current_dir)\n\u001b[0;32m----> 6\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcurrent_dir: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcurrent_dir\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m,\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m output mes: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mlines\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n",
"\u001b[0;31mValueError\u001b[0m: current_dir: /workspace/Code/tutorials/pathology/tumor_detection/ignite,\n output mes: ['', 'NOTICE: Existing SQLite export found: profile_report.sqlite', 'It is assumed file was previously exported from: profile_report.nsys-rep', 'Consider using --force-export=true if needed.', '', 'Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_sum.py]...', '', '** NVTX Push/Pop Range Summary (nvtx_pushpop_sum):', '', '+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+', '| Time (%) | Total Time (ns) | Instances | Avg (ns) | Med (ns) | Min (ns) | Max (ns) | StdDev (ns) | Range |', '+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+', '| 34.2 | 47482362631 | 128 | 370955958.1 | 358562192.0 | 327889378 | 648551751 | 40447366.0 | Batch |', '| 27.2 | 37652273041 | 1283 | 29347056.2 | 27990309.0 | 25510981 | 63006131 | 4219002.3 | Preprocessing |', '| 16.7 | 23152629098 | 11548 | 2004903.8 | 1847443.0 | 1516855 | 5860395 | 364009.9 | TorchVisiond_ColorJitter |', '| 8.8 | 12256579557 | 129 | 95012244.6 | 94605781.0 | 12875054 | 208296279 | 12394152.4 | Iteration |', '| 3.5 | 4806197198 | 11556 | 415904.9 | 70161.0 | 52826 | 5152586 | 661896.3 | RandZoomd |', '| 1.5 | 2084419592 | 11520 | 180939.2 | 176996.5 | 169304 | 445132 | 18836.6 | Postprocessing |', '| 1.3 | 1832796075 | 11556 | 158601.3 | 62354.5 | 49292 | 727842 | 118659.5 | RandRotate90d |', '| 1.3 | 1760763827 | 11556 | 152367.9 | 105570.0 | 44092 | 695443 | 110395.5 | RandFlipd |', '| 1.2 | 1691950895 | 11556 | 146413.2 | 142806.0 | 106748 | 370831 | 30029.8 | ScaleIntensityRanged |', '| 0.7 | 994755525 | 11520 | 86350.3 | 84425.0 | 80408 | 250947 | 10746.7 | Activationsd |', '| 0.6 | 881793011 | 11556 | 76306.1 | 72938.5 | 67501 | 168425 | 10725.6 | ToTensord_2 |', '| 0.6 | 878529245 | 11520 | 76261.2 | 74537.0 | 71016 | 300255 | 9709.4 | AsDiscreted |', '| 0.6 | 809885387 | 1283 | 631243.5 | 581810.0 | 509254 | 11570290 | 451577.9 | GridSplitd |', '| 0.6 | 799377380 | 11556 | 69174.2 | 64053.5 | 58099 | 368143 | 13890.4 | ToNumpyd |', '| 0.4 | 510636803 | 129 | 3958424.8 | 3883326.0 | 3775417 | 9349836 | 492280.2 | ResNet18 |', '| 0.3 | 476016190 | 11556 | 41192.1 | 38019.0 | 25499 | 210803 | 14052.4 | CastToTyped |', '| 0.3 | 470000875 | 11547 | 40703.3 | 37342.0 | 34594 | 136998 | 8392.8 | ToTensord |', '| 0.1 | 110408584 | 1283 | 86055.0 | 82258.0 | 74326 | 206279 | 12671.7 | Lambdad |', '| 0.0 | 14785990 | 129 | 114620.1 | 111590.0 | 107197 | 229349 | 13553.9 | Loss |', '+----------+-----------------+-----------+-------------+-------------+-----------+-----------+-------------+--------------------------+', '', 'Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_sum.py] to [profile_report_nvtx_pushpop_sum.csv]... PROCESSED', '', 'Processing [profile_report.sqlite] with [/usr/local/cuda-12.4/NsightSystems-cli-2024.2.1/target-linux-x64/reports/nvtx_pushpop_trace.py] to [profile_report_nvtx_pushpop_trace.csv]... PROCESSED', '']"
]
}
],
"source": [
"with open(\"./test.log\") as f:\n",
" lines = [line.strip() for line in f.readlines()]\n",
"current_dir = os.getcwd()\n",
"file_path = os.path.join(current_dir, \"profile_report_nvtx_pushpop_sum.csv\")\n",
"print(current_dir)\n",
"assert os.path.isfile(file_path)"
"raise ValueError(f\"current_dir: {current_dir},\\n output mes: {lines}\")"
]
},
{
Expand Down Expand Up @@ -717,7 +698,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1c98556

Please sign in to comment.