python:pyopencl

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
python:pyopencl [2019/09/16 12:57] – [OpenCL ベンチマーク] ともやんpython:pyopencl [2020/08/19 09:31] ともやん
行 1: 行 1:
 <html> <html>
 +  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
 +  
   <style>   <style>
-    #result pre { +    #result pre, #mincode pre { 
-      height: 200px;+      overflow: hidden; 
 +      font-size: 10px; 
 +    } 
 +    #result_long pre, #mincode_long pre { 
 +      height: 250px;
       overflow: scroll;       overflow: scroll;
       overflow-x: hidden;       overflow-x: hidden;
 +      font-size: 10px;
 +    }
 +    #mintbl table {
 +      font-size: 12px;
 +    }
 +    #mintbl td pre {
 +      margin: 0;
 +    }
 +    #img_long {
 +      height: 400px;
 +      overflow: scroll;
 +      overflow-x: hidden;
 +    }
 +    .dokuwiki .plugin_wrap table {
 +      width: auto;
 +    }
 +    #logo {
 +      background-color: white;
 +      padding: 10px;
 +      width: fit-content;
 +    }
 +    #logo p {
 +      margin: 0;
     }     }
   </style>   </style>
行 10: 行 39:
 ====== PyOpenCL のインストール ====== ====== PyOpenCL のインストール ======
 ここでは、以下の CPU および GPU を使用してベンチマークを行った。\\ ここでは、以下の CPU および GPU を使用してベンチマークを行った。\\
-  * AMD(R) GPU Radeon HD 5870 +  * AMD® GPU Radeon HD 5870 
-  * AMD(R) CPU Phenom(tm) II X6 1100T Processor +  * AMD® CPU Phenom™ II X6 1100T Processor 
-  * Intel(R) GPU  HD Graphics 4000 +  * Intel® GPU  HD Graphics 4000 
-  * Intel(R) CPU Core(TM) i7-3517U CPU @ 1.90GHz +  * Intel® CPU Core™ i7-3517U CPU @ 1.90GHz 
-  * NVIDIA(R) GPU GeForce GT 640M+  * NVIDIA® GPU GeForce GT 640M 
 +  * NVIDIA® Tesla® T4
  
 +<html>
 +  <div id="chart_div" style="width: 640px; height: 400px; overflow-x: scroll;"></div>
 +  <script>
 +    google.charts.load('current', {
 +      packages: ['corechart', 'bar']
 +    });
 +    google.charts.setOnLoadCallback(drawMultSeries);
 +    
 +    function drawMultSeries() {
 +      let data = google.visualization.arrayToDataTable([
 +        ['モデル', '実行時間'],
 +        ['AMD® GPU Radeon\nHD 5870',
 +          {v: 0.0000072220, f: 0.0000072220}],
 +        ['Intel® GPU HD Graphics 4000',
 +          {v: 0.0007947200, f: 0.0007947200}],
 +        ['NVIDIA® Tesla® T4\n(Google Colab)',
 +          {v: 0.0010557440, f: 0.0010557440}],
 +        ['AMD® CPU Phenom™ II X6 1100T Processor',
 +          {v: 0.0010633330, f: 0.0010633330}],
 +        ['Intel® CPU Core™ i7-3517U CPU @ 1.90GHz',
 +          {v: 0.0011095000, f: 0.0011095000}],
 +        ['NVIDIA® GPU GeForce GT 640M',
 +          {v: 0.0015742400, f: 0.0015742400}]
 +      ]);
 +      
 +      let options = {
 +        title: 'OpenCL ベンチマーク - benchmark-all.py 実行時間(秒)',
 +        chartArea: {
 +          width: '50%',
 +        },
 +        width: 600,
 +        height: 400,
 +        is3D: true,
 +        hAxis: {
 +          title: '<- fast | slow ->',
 +          minValue: 0,
 +          scaleType: 'log'
 +        },
 +        vAxis: {
 +          title: 'モデル'
 +        },
 +        explorer: { 
 +          actions: ['dragToZoom', 'rightClickToReset'],
 +          axis: 'horizontal',
 +          keepInBounds: true,
 +          maxZoomIn: 4.0
 +        }
 +      };
 +      
 +      let chart = new google.visualization.BarChart(document.getElementById('chart_div'));
 +      chart.draw(data, options);
 +    }
 +  </script>
 +</html>
 ===== Windows ===== ===== Windows =====
 PyOpenCL をインストールするには、[[windows:visualstudio|Microsoft Visual Studio]]、および、[[c_cpp:opencl_sdk|OpenCL 開発環境構築]] が必要である。\\ PyOpenCL をインストールするには、[[windows:visualstudio|Microsoft Visual Studio]]、および、[[c_cpp:opencl_sdk|OpenCL 開発環境構築]] が必要である。\\
行 64: 行 148:
 </WRAP> </WRAP>
  
-==== OpenCL ベンチマーク ====+===== OpenCL ベンチマーク =====
 OpenCL のベンチマークには以下のプログラムを使用しました。\\ OpenCL のベンチマークには以下のプログラムを使用しました。\\
 https://github.com/stefanv/PyOpenCL/blob/master/examples/benchmark-all.py\\ https://github.com/stefanv/PyOpenCL/blob/master/examples/benchmark-all.py\\
行 152: 行 236:
 </file> </file>
  
-=== MGC 開発マシン === +===== MGC 開発マシン ===== 
-{{:python:mgc_thecircle_cpu_gpu.png?680|MGC TheCircle CPU GPU}}\\+{{python:mgc_thecircle_cpu_gpu.png?680|MGC TheCircle CPU GPU}}\\
 **HIS Radeon HD 5870**\\ **HIS Radeon HD 5870**\\
 <code> <code>
行 162: 行 246:
 Shading Units: 1400 Shading Units: 1400
 </code> </code>
-{{:python:his_radeon_hd5870.png?640|HIS Radeon HD 5870}}\\+{{python:his_radeon_hd5870.png?640|HIS Radeon HD 5870}}\\
 \\ \\
-**AMD Phenom(tm) II X6 1100T Processor, Black Edition 3.30GHz**\\+**AMD Phenom() II X6 1100T Processor, Black Edition 3.30GHz**\\
 <code> <code>
 TDP: 125W TDP: 125W
行 171: 行 255:
 </code> </code>
 ※FLOPS は理論値(4 FLOPS/Clock × 3.3GHz × 6コア)\\ ※FLOPS は理論値(4 FLOPS/Clock × 3.3GHz × 6コア)\\
-{{:python:amd_phenom_ii_x6_1100t_processor.png?200|AMD Phenom(tm) II X6 1100T Processor 3.30GHz}}\\+{{python:amd_phenom_ii_x6_1100t_processor.png?200|AMD Phenom() II X6 1100T Processor 3.30GHz}}\\
 \\ \\
 <code> <code>
行 204: 行 288:
 </code> </code>
  
-=== マウスコンピュータ LB-L561S === +===== マウスコンピュータ LB-L561S ===== 
-{{:python:lb-l461s_cpu_gpu.png?1024|LB-L561S CPU GPU}}\\+{{python:lb-l461s_cpu_gpu.png?1024|LB-L561S CPU GPU}}\\
 **NVIDIA GeForce GT 640M**\\ **NVIDIA GeForce GT 640M**\\
 <code> <code>
行 215: 行 299:
 Shading Units: 384 Shading Units: 384
 </code> </code>
-{{:python:nvidia_geforce_gt_640m.png?200|NVIDIA GeForce GT 640M}}\\+{{python:nvidia_geforce_gt_640m.png?200|NVIDIA GeForce GT 640M}}\\
 \\ \\
 **Intel(R) HD Graphics 4000**\\ **Intel(R) HD Graphics 4000**\\
行 227: 行 311:
 </code> </code>
 \\ \\
-**Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz**\\+**Intel® Core() i7-3517U CPU @ 1.90GHz**\\
 <code> <code>
 TDP: 17W TDP: 17W
行 278: 行 362:
 Device compute units: 16 Device compute units: 16
 Execution time of test: 0.0007947200 s Execution time of test: 0.0007947200 s
 +Results OK
 +</code>
 +</WRAP>
 +
 +===== Google Colaboratory (略称: Colab) =====
 +**CPU: Intel® Xeon® CPU @ 2.30GHz**\\
 +**GPU: NVIDIA® Tesla® T4**\\
 +<code>
 +TDP: 70W
 +FLOPS: 8.141 TFLOPS
 +GPU Clock: 585 MHz
 +          1590 MHz(Boost)
 +Memory Clock: 1250 MHz
 +Shading Units: 2560
 +</code>
 +\\
 +<WRAP prewrap 100%>
 +<code>
 +Execution time of test without OpenCL:  5.938735008239746 s
 +===============================================================
 +Platform name: NVIDIA CUDA
 +Platform profile: FULL_PROFILE
 +Platform vendor: NVIDIA Corporation
 +Platform version: OpenCL 1.2 CUDA 10.1.152
 +---------------------------------------------------------------
 +Device name: Tesla P4
 +Device type: ALL | GPU
 +Device memory:  7611 MB
 +Device max clock speed: 1113 MHz
 +Device compute units: 20
 +Execution time of test: 0.0010557440 s
 Results OK Results OK
 </code> </code>
行 288: 行 403:
 > pip install pyopencl > pip install pyopencl
 </code> </code>
-<WRAP prewrap 100% #result>+<WRAP prewrap 100% #result_long>
 <code> <code>
 Collecting pyopencl Collecting pyopencl
行 431: 行 546:
 </code> </code>
 </WRAP> </WRAP>
 +
 +==== error: Microsoft Visual C++ 14.0 is required. が発生する ====
 +<code>
 +> pip install pyopencl
 +</code>
 +
 +<WRAP prewrap 100% #result_long>
 +<code>
 +Collecting pyopencl
 +  Using cached pyopencl-2020.2.1.tar.gz (352 kB)
 +Requirement already satisfied: numpy in c:\users\tomoyan\py38_opencl\lib\site-packages (from pyopencl) (1.19.1)
 +Requirement already satisfied: pytools>=2017.6 in c:\users\tomoyan\py38_opencl\lib\site-packages (from pyopencl) (2020.4)
 +Requirement already satisfied: decorator>=3.2.0 in c:\users\tomoyan\py38_opencl\lib\site-packages (from pyopencl) (4.4.2)
 +Requirement already satisfied: appdirs>=1.4.0 in c:\users\tomoyan\py38_opencl\lib\site-packages (from pyopencl) (1.4.4)
 +Requirement already satisfied: six>=1.9.0 in c:\users\tomoyan\py38_opencl\lib\site-packages (from pyopencl) (1.15.0)
 +Using legacy setup.py install for pyopencl, since package 'wheel' is not installed.
 +Installing collected packages: pyopencl
 +    Running setup.py install for pyopencl ... error
 +    ERROR: Command errored out with exit status 1:
 +     command: 'c:\users\tomoyan\py38_opencl\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tomoyan\\AppData\\Local\\Temp\\pip-install-kysbgjhb\\pyopencl\\setup.py'"'"'; __file__='"'"'C:\\Users\\tomoyan\\AppData\\Local\\Temp\\pip-install-kysbgjhb\\pyopencl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tomoyan\AppData\Local\Temp\pip-record-u_d5qgvn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\tomoyan\py38_opencl\include\site\python3.8\pyopencl'
 +         cwd: C:\Users\tomoyan\AppData\Local\Temp\pip-install-kysbgjhb\pyopencl\
 +    Complete output (70 lines):
 +    running install
 +    running build
 +    running build_py
 +    creating build
 +    creating build\lib.win-amd64-3.8
 +    creating build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\algorithm.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\array.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\bitonic_sort.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\bitonic_sort_templates.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\cache.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\capture_call.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\clmath.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\clrandom.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\cltypes.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\elementwise.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\invoker.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\ipython_ext.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\reduction.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\scan.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\tools.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\version.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\_buffers.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\_cluda.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\_mymako.py -> build\lib.win-amd64-3.8\pyopencl
 +    copying pyopencl\__init__.py -> build\lib.win-amd64-3.8\pyopencl
 +    creating build\lib.win-amd64-3.8\pyopencl\characterize
 +    copying pyopencl\characterize\performance.py -> build\lib.win-amd64-3.8\pyopencl\characterize
 +    copying pyopencl\characterize\__init__.py -> build\lib.win-amd64-3.8\pyopencl\characterize
 +    creating build\lib.win-amd64-3.8\pyopencl\compyte
 +    copying pyopencl\compyte\array.py -> build\lib.win-amd64-3.8\pyopencl\compyte
 +    copying pyopencl\compyte\dtypes.py -> build\lib.win-amd64-3.8\pyopencl\compyte
 +    copying pyopencl\compyte\__init__.py -> build\lib.win-amd64-3.8\pyopencl\compyte
 +    creating build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    copying pyopencl\compyte\ndarray\gen_elemwise.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    copying pyopencl\compyte\ndarray\gen_reduction.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    copying pyopencl\compyte\ndarray\setup_opencl.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    copying pyopencl\compyte\ndarray\test_gpu_elemwise.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    copying pyopencl\compyte\ndarray\test_gpu_ndarray.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    copying pyopencl\compyte\ndarray\__init__.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
 +    running egg_info
 +    writing pyopencl.egg-info\PKG-INFO
 +    writing dependency_links to pyopencl.egg-info\dependency_links.txt
 +    writing requirements to pyopencl.egg-info\requires.txt
 +    writing top-level names to pyopencl.egg-info\top_level.txt
 +    reading manifest file 'pyopencl.egg-info\SOURCES.txt'
 +    reading manifest template 'MANIFEST.in'
 +    warning: no files found matching '*.h'
 +    warning: no files found matching 'doc\_static\*.css'
 +    warning: no files found matching 'doc\_templates\*.html'
 +    warning: no files found matching '*.py.in'
 +    warning: no files found matching 'pyproject.toml'
 +    writing manifest file 'pyopencl.egg-info\SOURCES.txt'
 +    creating build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-airy.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-bessel-j-complex.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-bessel-j.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-bessel-y.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-complex.h -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-eval-tbl.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-hankel-complex.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    copying pyopencl\cl\pyopencl-ranluxcl.cl -> build\lib.win-amd64-3.8\pyopencl\cl
 +    creating build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
 +    copying pyopencl\cl\pyopencl-random123\array.h -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
 +    copying pyopencl\cl\pyopencl-random123\openclfeatures.h -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
 +    copying pyopencl\cl\pyopencl-random123\philox.cl -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
 +    copying pyopencl\cl\pyopencl-random123\threefry.cl -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
 +    running build_ext
 +    building 'pyopencl._cl' extension
 +    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
 +    ----------------------------------------
 +ERROR: Command errored out with exit status 1: 'c:\users\tomoyan\py38_opencl\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tomoyan\\AppData\\Local\\Temp\\pip-install-kysbgjhb\\pyopencl\\setup.py'"'"'; __file__='"'"'C:\\Users\\tomoyan\\AppData\\Local\\Temp\\pip-install-kysbgjhb\\pyopencl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tomoyan\AppData\Local\Temp\pip-record-u_d5qgvn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\tomoyan\py38_opencl\include\site\python3.8\pyopencl' Check the logs for full command output.
 +</code>
 +</WRAP>
 +手軽に済ませたい場合は [[windows:build_tools_for_visual_studio|Build Tools for Visual Studio]] をインストールする。\\
  
 ==== fatal error C1083: include ファイルを開けません。'CL/cl.h':No such file or directory が発生する ==== ==== fatal error C1083: include ファイルを開けません。'CL/cl.h':No such file or directory が発生する ====
行 436: 行 648:
 > pip install pyopencl > pip install pyopencl
 </code> </code>
-<WRAP prewrap 100% #result>+<WRAP prewrap 100% #result_long>
 <code> <code>
 Collecting pyopencl Collecting pyopencl
行 534: 行 746:
 [[https://ja.wikipedia.org/wiki/AMD_Phenom_II|AMD Phenom II - Wikipedia]]\\ [[https://ja.wikipedia.org/wiki/AMD_Phenom_II|AMD Phenom II - Wikipedia]]\\
 [[https://ja.wikipedia.org/wiki/Intel_HD_Graphics|Intel HD Graphics - Wikipedia]]\\ [[https://ja.wikipedia.org/wiki/Intel_HD_Graphics|Intel HD Graphics - Wikipedia]]\\
 +
 +[[https://www.techpowerup.com/gpu-specs/radeon-hd-5870.c253|ATI Radeon HD 5870 Specs | TechPowerUp GPU Database]]\\
 [[https://www.techpowerup.com/gpu-specs/hd-graphics-4000.c1266|Intel HD Graphics 4000 Specs | TechPowerUp GPU Database]]\\ [[https://www.techpowerup.com/gpu-specs/hd-graphics-4000.c1266|Intel HD Graphics 4000 Specs | TechPowerUp GPU Database]]\\
 +[[https://www.techpowerup.com/gpu-specs/tesla-t4.c3316|NVIDIA Tesla T4 Specs | TechPowerUp GPU Database]]\\
 +
 [[https://gflops.surge.sh/|GPU GFLOPS]]\\ [[https://gflops.surge.sh/|GPU GFLOPS]]\\
 [[https://ja.wikipedia.org/wiki/Intel_Core_i7|Intel Core i7 - Wikipedia]]\\ [[https://ja.wikipedia.org/wiki/Intel_Core_i7|Intel Core i7 - Wikipedia]]\\
 [[http://www.webmagazine.kakisiti.co.jp/?p=567|コア数も最高クロックもほとんど同じなのに Core i3 の方が Core i7 より演算性能が高いことがある? | かきしちカンパニー Web Magazine]]\\ [[http://www.webmagazine.kakisiti.co.jp/?p=567|コア数も最高クロックもほとんど同じなのに Core i3 の方が Core i7 より演算性能が高いことがある? | かきしちカンパニー Web Magazine]]\\
- 
  
  • python/pyopencl.txt
  • 最終更新: 2023/09/27 08:05
  • by ともやん