|
82 | 82 | "name": "stdout",
|
83 | 83 | "output_type": "stream",
|
84 | 84 | "text": [
|
85 |
| - "Error! wrong oneAPI installation path\n" |
| 85 | + "Success! found oneAPI installation\n" |
86 | 86 | ]
|
87 | 87 | }
|
88 | 88 | ],
|
|
94 | 94 | " print(\"Success! found oneAPI installation\")"
|
95 | 95 | ]
|
96 | 96 | },
|
| 97 | + { |
| 98 | + "cell_type": "markdown", |
| 99 | + "metadata": {}, |
| 100 | + "source": [ |
| 101 | + "Clone the oneDNN repo to current directory " |
| 102 | + ] |
| 103 | + }, |
| 104 | + { |
| 105 | + "cell_type": "code", |
| 106 | + "execution_count": null, |
| 107 | + "metadata": {}, |
| 108 | + "outputs": [], |
| 109 | + "source": [ |
| 110 | + "!git clone https://github.com/oneapi-src/oneDNN.git" |
| 111 | + ] |
| 112 | + }, |
97 | 113 | {
|
98 | 114 | "cell_type": "markdown",
|
99 | 115 | "metadata": {},
|
|
519 | 535 | "! chmod 755 run_blocked_v.sh;if [ -x \"$(command -v qsub)\" ]; then ./q run_blocked_v.sh; else ./run_blocked_v.sh; fi"
|
520 | 536 | ]
|
521 | 537 | },
|
| 538 | + { |
| 539 | + "cell_type": "markdown", |
| 540 | + "metadata": {}, |
| 541 | + "source": [ |
| 542 | + "### (Optional) BenchDNN with GPU\n", |
| 543 | + "\n", |
| 544 | + "In this optional section users can build benchdnn with GPU support and run GPU performance benchmarking." |
| 545 | + ] |
| 546 | + }, |
| 547 | + { |
| 548 | + "cell_type": "markdown", |
| 549 | + "metadata": {}, |
| 550 | + "source": [ |
| 551 | + "#### Script - build_gpu.sh\n", |
| 552 | + "The script **build_gpu.sh** encapsulates the compiler command and flags that will generate our benchDNN executable with DPCPP GPU runtime support." |
| 553 | + ] |
| 554 | + }, |
| 555 | + { |
| 556 | + "cell_type": "code", |
| 557 | + "execution_count": null, |
| 558 | + "metadata": {}, |
| 559 | + "outputs": [], |
| 560 | + "source": [ |
| 561 | + "%%writefile build_gpu.sh\n", |
| 562 | + "#!/bin/bash\n", |
| 563 | + "source /opt/intel/oneapi/setvars.sh --force\n", |
| 564 | + "cd oneDNN\n", |
| 565 | + "\n", |
| 566 | + "rm -rf build_gpu\n", |
| 567 | + "mkdir build_gpu\n", |
| 568 | + "cd build_gpu\n", |
| 569 | + " \n", |
| 570 | + "export CC=icx\n", |
| 571 | + "export CXX=icpx\n", |
| 572 | + "\n", |
| 573 | + "cmake -DDNNL_GPU_RUNTIME=SYCL ..\n", |
| 574 | + "make benchdnn" |
| 575 | + ] |
| 576 | + }, |
| 577 | + { |
| 578 | + "cell_type": "markdown", |
| 579 | + "metadata": {}, |
| 580 | + "source": [ |
| 581 | + "#### Submitting **build_gpu.sh** to the job queue\n", |
| 582 | + "Submit the **build_gpu.sh** to the job queue." |
| 583 | + ] |
| 584 | + }, |
| 585 | + { |
| 586 | + "cell_type": "code", |
| 587 | + "execution_count": null, |
| 588 | + "metadata": {}, |
| 589 | + "outputs": [], |
| 590 | + "source": [ |
| 591 | + "!chmod 755 q;chmod 755 build_gpu.sh;if [ -x \"$(command -v qsub)\" ]; then ./q build_gpu.sh; else ./build_gpu.sh; fi" |
| 592 | + ] |
| 593 | + }, |
| 594 | + { |
| 595 | + "cell_type": "markdown", |
| 596 | + "metadata": {}, |
| 597 | + "source": [ |
| 598 | + "#### Script - run_gpu.sh\n", |
| 599 | + "The script **run_gpu.sh** runs the benchdnn while invoking --engine=gpu:0 to run on the GPU:" |
| 600 | + ] |
| 601 | + }, |
| 602 | + { |
| 603 | + "cell_type": "code", |
| 604 | + "execution_count": null, |
| 605 | + "metadata": {}, |
| 606 | + "outputs": [], |
| 607 | + "source": [ |
| 608 | + "%%writefile run_gpu.sh\n", |
| 609 | + "#!/bin/bash\n", |
| 610 | + "echo \"########## Executing the run ##########\"\n", |
| 611 | + "export ONEDNN_VERBOSE=1\n", |
| 612 | + "export BENCHDNN_ROOT=oneDNN/build_gpu/tests/benchdnn\n", |
| 613 | + "export PROBLEM=g1mb256ic3ih227iw227oc96oh55ow55kh11kw11sh4sw4ph0pw0n\"alexnet:conv1\"\n", |
| 614 | + "\n", |
| 615 | + "./$BENCHDNN_ROOT/benchdnn --conv --engine=gpu:0 --mode=p --alg=direct $PROBLEM &> alexnet_gpu.log 2>&1\n", |
| 616 | + "\n", |
| 617 | + "echo \"########## Done with the run ##########\"" |
| 618 | + ] |
| 619 | + }, |
| 620 | + { |
| 621 | + "cell_type": "markdown", |
| 622 | + "metadata": {}, |
| 623 | + "source": [ |
| 624 | + "#### Submitting **run_gpu.sh** to the job queue\n", |
| 625 | + "Submit the **run_gpu.sh** to the job queue." |
| 626 | + ] |
| 627 | + }, |
| 628 | + { |
| 629 | + "cell_type": "code", |
| 630 | + "execution_count": null, |
| 631 | + "metadata": {}, |
| 632 | + "outputs": [], |
| 633 | + "source": [ |
| 634 | + "! chmod 755 run_gpu.sh;if [ -x \"$(command -v qsub)\" ]; then ./q run_gpu.sh; else ./run_gpu.sh; fi" |
| 635 | + ] |
| 636 | + }, |
522 | 637 | {
|
523 | 638 | "cell_type": "markdown",
|
524 | 639 | "metadata": {},
|
|
785 | 900 | ],
|
786 | 901 | "metadata": {
|
787 | 902 | "kernelspec": {
|
788 |
| - "display_name": "Python 3 (ipykernel)", |
| 903 | + "display_name": "Python 3 (Intel® oneAPI 2023.0)", |
789 | 904 | "language": "python",
|
790 |
| - "name": "python3" |
| 905 | + "name": "c009-intel_distribution_of_python_3_oneapi-beta05-python" |
791 | 906 | },
|
792 | 907 | "language_info": {
|
793 | 908 | "codemirror_mode": {
|
|
799 | 914 | "name": "python",
|
800 | 915 | "nbconvert_exporter": "python",
|
801 | 916 | "pygments_lexer": "ipython3",
|
802 |
| - "version": "3.9.12" |
| 917 | + "version": "3.9.15" |
803 | 918 | },
|
804 | 919 | "nbTranslate": {
|
805 | 920 | "displayLangs": [
|
|
0 commit comments