Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task03 Лопатин Алексей HSE #117

Open
wants to merge 3 commits into
base: task03
Choose a base branch
from

Conversation

apat1n
Copy link

@apat1n apat1n commented Sep 29, 2024

mandelbrot

Локальный вывод

$ ./mandelbrot
OpenCL devices:
  Device #0: GPU. Apple M1 Pro. Total memory: 10922 Mb
Using device #0: GPU. Apple M1 Pro. Total memory: 10922 Mb
CPU: 4.0721+-0.00862937 s
CPU: 2.45573 GFlops
    Real iterations fraction: 56.2657%
GPU: 0.0074115+-0.000379725 s
GPU: 1349.25 GFlops
    Real iterations fraction: 56.2657%
GPU vs CPU average results difference: 0%

Вывод Github CI

OpenCL devices:
  Device #0: CPU. AMD EPYC 7763 64-Core Processor                . Intel(R) Corporation. Total memory: 15991 Mb
Using device #0: CPU. AMD EPYC 7763 64-Core Processor                . Intel(R) Corporation. Total memory: 15991 Mb
CPU: 0.604094+-0.00315337 s
CPU: 16.5537 GFlops
    Real iterations fraction: 56.2638%
GPU: 0.162827+-0.000825261 s
GPU: 61.4149 GFlops
    Real iterations fraction: 56.2657%
GPU vs CPU average results difference: 0.943129%

sum

Локальный вывод

$ ./sum
CPU:     0.159676+-0.000582382 s
CPU:     626.27 millions/s
CPU OMP: 0.222213+-0.00128164 s
CPU OMP: 450.019 millions/s
OpenCL devices:
  Device #0: GPU. Apple M1 Pro. Total memory: 10922 Mb
Using device #0: GPU. Apple M1 Pro. Total memory: 10922 Mb
GPU (atomic):     0.0612478+-0.00548793 s
GPU (atomic):     1632.71 millions/s
GPU (cycle):     0.0684128+-0.00697784 s
GPU (cycle):     1461.71 millions/s
GPU (cycle + coalesced):     0.054988+-0.0055918 s
GPU (cycle + coalesced):     1818.58 millions/s
GPU (local_mem):     0.0584202+-0.00608582 s
GPU (local_mem):     1711.74 millions/s
GPU (tree):     0.0545078+-0.00713746 s
GPU (tree):     1834.6 millions/s

Вывод Github CI

CPU:     0.033402+-0.000542667 s
CPU:     2993.83 millions/s
CPU OMP: 0.0177347+-6.52806e-05 s
CPU OMP: 5638.67 millions/s
OpenCL devices:
  Device #0: CPU. AMD EPYC 7763 64-Core Processor                . Intel(R) Corporation. Total memory: 15991 Mb
Using device #0: CPU. AMD EPYC 7763 64-Core Processor                . Intel(R) Corporation. Total memory: 15991 Mb
GPU (atomic):     1.7318+-0.019923 s
GPU (atomic):     57.7433 millions/s
GPU (cycle):     0.225465+-0.000543985 s
GPU (cycle):     443.527 millions/s
GPU (cycle + coalesced):     0.221016+-0.000397475 s
GPU (cycle + coalesced):     452.455 millions/s
GPU (local_mem):     0.232022+-0.00073159 s
GPU (local_mem):     430.993 millions/s
GPU (tree):     0.359483+-0.000781444 s
GPU (tree):     278.177 millions/s

К сожалению, не удалось завести OpenMP на macos и увидеть легкий прирост производительности и программа работала на одном ядре. Локально выиграл вариант с деревом, однако, при увеличении VALUES_PER_WORKITEM до 128 выигрывает cycle + coalesced вариант, что связано с размером кэш линии на моем процессоре. Что интересно, даже atomic вариант локально приносит до 3х-кратного прироста производительности, вероятно из-за оптимизаций вроде локального кэша, как говорилось на лекции


{
timer t;
for (int iter = 0; iter < benchmarkingIters; ++iter) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь и далее измерение производительности GPU версий имеет не очень много смысла, потому что замеры включают в себя мажорирующее время на перекидывание массивов по шине

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(а еще и компиляцию кернела)

@@ -6,6 +6,8 @@
#ifdef __unix__
// X11-based
#define cimg_display 1
# elif __APPLE__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В итоге отображение у вас заработало?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants