GPU strategies
for evolutionary machine learning
Master :
Dr. Ghaderi
Mohammad Amin Amjadi
Spring 2016
‫مقاالت‬
1. Large-scale experimental evaluation of GPU
strategies for evolutionary machine learning
María A. Franco, Jaume Bacardit
2016 Elsevier B.V. All rights reserved
2. Improving the scalability of rule-based
evolutionary learning
Jaume Bacardit, Edmund K. Burke, Natalio Krasnogor
2009
2
‫مطالب‬
1.Evolutionary Algorithm
2.Machine Learning
3.Problem
4.Goal
5.BioHEL Algorithm
6.GPUs and CUDA
7. CUDA-based fitness computation for
BioHEL
8. Coarse-grained parallel approach
9. fine-grained parallelization
10. Experimental design
11. Conclusions
12. Recommendation
3
Evolutionary Algorithm
•‫بررسی‬ ‫را‬ ‫حاالت‬ ‫از‬ ‫یکسری‬ ‫تصادفی‬ ‫بصورت‬
‫نمائیم‬‫می‬
•‫نتیجه‬ ‫بررسی‬ ‫و‬ ‫تصادفی‬ ‫انتخاب‬ ‫فرآیند‬
‫نمائیم‬‫می‬ ‫تکرار‬ ‫بار‬ ‫چندین‬ ‫را‬
•‫و‬ ‫انتخاب‬ ،‫جهش‬ ،‫همبری‬ ‫عملگرهای‬ ‫از‬...
‫نمائیم‬‫می‬ ‫استفاده‬ ‫مرحله‬ ‫هر‬ ‫در‬
•،‫ها‬‫الگوریتم‬ ‫از‬ ‫برخی‬
‫هستند‬ ‫بر‬‫زمان‬ ‫و‬ ‫پیچیده‬
•‫حاالت‬ ‫تمام‬ ‫خواهیم‬‫نمی‬
‫نمائیم‬ ‫بررسی‬ ‫را‬
•‫تقریب‬ ‫یک‬ ‫خواهیم‬‫می‬ ‫فقط‬
‫بزنیم‬
4
𝑓 𝑥, 𝑦, 𝑧 = reward = fitness
reward ≠ cost
Machine Learning
5
Problem
‫اگر‬ ‫شود‬‫می‬ ‫زیاد‬ ‫یادگیری‬ ‫زمان‬:
‫الف‬)dataset‫باشد‬ ‫بزرگ‬
‫ب‬)‫باشد‬ ‫پیچیده‬ ‫یادگیری‬ ‫مدل‬(‫و‬ ‫نظارت‬ ‫با‬ ‫یادگیری‬ ‫همانند‬)...
‫از‬ ‫استفاده‬ ‫ها‬‫روش‬ ‫ترین‬‫شایع‬ ‫از‬ ‫یکی‬ ‫امروزه‬gpu‫مقیاس‬ ‫بهبود‬ ‫برای‬ ‫خصوصا‬ ،‫است‬
‫داده‬ ‫های‬‫الگوریتم‬ ‫پذیری‬-‫کاوی‬
‫از‬ ،‫تکاملی‬ ‫های‬‫الگوریتم‬ ‫موازی‬ ‫طبیعت‬ ‫بدلیل‬gpu‫استفاده‬ ‫وری‬‫بهره‬ ‫بهبود‬ ‫برای‬
‫است‬ ‫شده‬
6
Goal
‫تکاملی‬ ‫یادگیری‬ ‫سیستم‬ ‫از‬ ‫استفاده‬BioHEL‫داده‬ ‫برای‬ ‫خاص‬ ‫بطور‬ ‫که‬-‫کاوی‬
dataset‫است‬ ‫شده‬ ‫طراحی‬ ‫بزرگ‬ ‫های‬
‫سیستم‬BioHEL‫کند‬‫می‬ ‫رقابت‬ ،‫ماشین‬ ‫یادگیری‬ ‫های‬‫الگوریتم‬ ‫سایر‬ ‫با‬
‫یک‬ ‫از‬ ‫شود‬‫می‬ ‫پیشنهاد‬gpu‫مناسب‬BioHEL(nvidia‫از‬ ‫که‬cuda‫نماید‬‫می‬ ‫پشتیبانی‬)،
‫شود‬ ‫استفاده‬
‫از‬ ‫بیش‬ ‫تسریع‬ ،‫بزرگ‬ ‫مسائل‬ ‫و‬ ‫آزمایشات‬ ‫در‬60‫است‬ ‫داشته‬ ‫برابر‬
‫حاضر‬ ‫حال‬ ‫در‬ ،‫وری‬ ‫بهره‬ ‫افزایش‬ ‫مکانیزهای‬ ‫ترکیب‬ ‫با‬BioHEL‫از‬ ‫بیش‬750‫برابر‬
‫است‬ ‫داشته‬ ‫تسریع‬
7
BioHEL
BioHEL،‫بزرگ‬ ‫مقیاس‬ ‫های‬‫داده‬ ‫مجموعه‬ ‫مدیریت‬ ‫هدف‬ ‫با‬ ،‫تکاملی‬ ‫یادگیری‬ ‫سیستم‬ ‫یک‬
‫باشد‬ ‫می‬
‫قانون‬ ‫یادگیری‬ ‫روش‬ ‫از‬ ‫پس‬ ،‫سیستم‬ ‫این‬(rule)‫های‬‫قانون‬ ‫مجموعه‬ ،‫تکرارشونده‬
‫کند‬‫می‬ ‫تولید‬ ‫را‬ ‫مراتبی‬ ‫سلسله‬
‫از‬ ،‫آوردیم‬ ‫دست‬ ‫به‬ ‫پی‬ ‫در‬ ‫پی‬ ‫که‬ ‫هایی‬‫قانون‬ ،‫قانون‬ ‫هر‬ ‫یادگیری‬ ‫برای‬ ‫روش‬ ‫این‬ ‫در‬
‫کند‬‫می‬ ‫استفاده‬ ‫استاندارد‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫یک‬
8
BioHEL
Procedure BioHEL general workflow
Input : TrainingSet
RuleSet = ∅
stop = false
Do
BestRule = null
For repetition=1 to NumRepetitionsRuleLearning
CandidateRule = RunGA(TrainingSet)
If CandidateRule is better than BestRule
BestRule = CandidateRule
EndIf
EndFor
Matched = Examples from TrainingSet matched by BestRule
If class of BestRule is the majority class in Matched
Remove Matched from TrainingSet
Add BestRule to RuleSet
Else
stop = true
EndIf
While stop is false
Output : RuleSet
9
BioHEL
Fitness = TL · W + EL
TL = 0.25 : theory length : ‫حل‬ ‫راه‬ ‫پیچیدگی‬
EL : exceptions length : ‫حل‬ ‫راه‬ ‫دقت‬
W = 0.9 : weight : TL‫و‬ EL‫بین‬ ‫رابطه‬ ‫تنظیم‬
𝑇𝐿 𝑅 =
𝑖=1
𝑖=𝑁𝐴
1 −
𝑠𝑖𝑧𝑒(𝑅𝑖)
𝑠𝑖𝑧𝑒(𝐷𝑖)
𝑁𝐴
R:‫قانون‬ ‫یک‬
NA:‫دامنه‬ ‫های‬‫ویژگی‬ ‫تعداد‬
Size(Ri):‫ویژگی‬ ‫با‬ ‫مرتبط‬ ‫فاصله‬ ‫طول‬i،‫ام‬R
Size(Di):‫ویژگی‬ ‫طول‬i‫دامنه‬ ،‫ام‬
10
BioHEL
EL(R) = 2 − ACC(R) − COV(R)
ACC R =
𝑐𝑜𝑟𝑟(𝑅)
𝑚𝑎𝑡𝑐ℎ𝑒𝑑(𝑅)
𝐶𝑂𝑉 𝑅 =
𝐶𝑅.
𝑅𝐶
𝐶𝐵
𝑖𝑓 𝑅𝐶 < 𝐶𝐵
𝐶𝑅 + 1 − 𝐶𝑅 .
𝑅𝐶 − 𝐶𝐵
1 − 𝑅𝐶
𝑖𝑓 𝑅𝐶 ≥ 𝐶𝐵
𝑅𝐶 =
𝑚𝑎𝑡𝑐ℎ𝑒𝑑(𝑅)
|𝑇| 11
BioHEL
BioHEL‫از‬ALKR‫کند‬‫می‬ ‫استفاده‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫در‬ ‫قانون‬ ‫رمزکردن‬ ‫برای‬(‫در‬ ‫جمعیت‬
‫ژنتیکی‬ ‫الگوریتم‬)
12
numAtt : ‫ویژگی‬ ‫تعداد‬
whichAtt : ‫ها‬‫ویژگی‬
predicates : ‫مقادیر‬
‫ها‬‫ویژگی‬
offsetPred : ‫حافظه‬ ‫مکان‬
‫ویژگی‬ ‫هر‬
class : ‫قانون‬ ‫کالس‬
BioHEL
BioHEL‫که‬ ‫ای‬‫پنجره‬ ‫مکانیزم‬ ‫از‬ ،‫وری‬ ‫بهره‬ ‫افزایش‬ ‫و‬ ‫اجرا‬ ‫زمان‬ ‫کاهش‬ ‫برای‬ILAS
‫کند‬‫می‬ ‫استفاده‬ ،‫شود‬‫می‬ ‫نامیده‬
Training set‫از‬ ‫قسمتی‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫هرمرحله‬ ‫در‬ ‫و‬ ،‫شود‬‫می‬ ‫تقسیم‬ ‫قسمت‬ ‫چندین‬ ‫به‬
‫شود‬‫می‬ ‫لحاظ‬ ‫آن‬
‫شود‬‫می‬ ‫داده‬ ‫نمایش‬ ‫صورت‬ ‫بدین‬ ‫قانون‬ ‫یک‬:
13
GPUs and CUDA
14
GPUs and CUDA
‫تخصیص‬‫حافظه‬‫زیاد‬‫در‬CUDA‫و‬‫انتقال‬،‫آن‬
‫هزینه‬‫زیادی‬‫دارد‬
‫استفاده‬‫از‬‫حافظه‬‫برای‬CUDA‫بحرانی‬‫است‬
‫که‬‫تواند‬‫می‬‫باعث‬‫افت‬‫کارایی‬‫شود‬
Coalescence‫بسیار‬‫مهم‬‫است‬
‫به‬‫زمانی‬‫برسیم‬‫که‬Thread‫های‬‫پشت‬‫سرهم‬‫در‬‫یک‬
block،‫به‬‫های‬‫مکان‬‫پشت‬‫سرهم‬‫حافظه‬‫دسترسی‬
‫داشته‬‫باشند‬
‫عدم‬Coalescence‫باعث‬‫افزایش‬‫زمان‬‫اجرای‬
Kernel‫شود‬‫می‬
‫استفاده‬‫مناسب‬‫از‬‫حافظه‬‫تواند‬‫می‬‫باعث‬
‫افزایش‬‫کارایی‬‫شود‬
15
Host Device
1. Host to Device
2. Launch Kernel
3. Device to Host
types of memory in CUDA
Device mem
Texture
mem
Shared mem ‫بین‬Thread‫یک‬ ‫های‬Block‫است‬ ‫مشترک‬
Constant
mem
‫توسط‬ ‫فقط‬Host‫است‬ ‫نوشتن‬ ‫قابل‬
Local thread
mem
‫هر‬ ‫مخصوص‬Thread
16
CUDA-based fitness computation for BioHEL
‫شایستگی‬ ‫محاسبه‬ ‫برای‬(Fitness)‫شود‬‫می‬ ‫شمارش‬ ‫معیار‬ ‫سه‬ ،‫قانون‬ ‫هر‬:‫تعداد‬
‫که‬ ‫هایی‬‫نمونه‬
.1‫با‬condition‫قانون‬match‫شوند‬‫می‬
.2‫با‬class‫قانون‬match‫شوند‬‫می‬
.3‫با‬ ‫همزمان‬class‫و‬condition‫قانون‬match‫شوند‬‫می‬
‫تابع‬ ‫از‬ ‫هدف‬CUDA fitness،‫است‬ ‫معیار‬ ‫سه‬ ‫محاسبه‬ ‫و‬ ‫تطبیق‬ ‫فرآیند‬ ‫موازی‬ ‫انجام‬ ،
‫شود‬‫می‬ ‫انجام‬ ‫گام‬ ‫دو‬ ‫در‬ ‫که‬:
.1‫ی‬‫همه‬ ‫بین‬ ‫تطبیق‬ ‫محاسبه‬classifier‫ها‬‫نمونه‬ ‫ی‬‫همه‬ ‫و‬ ‫ها‬
.2‫موازی‬ ‫بصورت‬ ،‫قانون‬ ‫هر‬ ‫برای‬ ‫معیار‬ ‫سه‬ ‫محاسبه‬
‫محاسبه‬fitness‫شود‬‫می‬ ‫عنوان‬ ‫مقاله‬ ‫این‬ ‫در‬ ‫روش‬ ‫دو‬ ‫به‬:
.1‫درشت‬ ‫موازی‬ ‫روش‬-‫دانه‬:coarse-grained parallelisation:‫مقاله‬ ‫اصلی‬ ‫روش‬
.2‫ریز‬ ‫موازی‬ ‫روش‬-‫دانه‬:fine-grained parallelisation:‫پیشنهادی‬ ‫روش‬
17
CUDA-based fitness computation for BioHEL
18
coarse-grained parallelisation
•‫است‬ ‫دوبعدی‬
•𝑇𝑖,𝑗
•‫نمونه‬ ‫تطبیق‬i‫قانون‬ ‫و‬ ‫ام‬j‫ام‬
fine-grained parallelisation
•‫است‬ ‫بعدی‬ ‫سه‬:‫تعداد‬ ‫به‬
‫مسئله‬ ‫های‬‫ویژگی‬
•𝑇𝑖,𝑗,𝑘
•‫ویژگی‬ ‫تطبیق‬k‫نمونه‬ ‫از‬ ‫ام‬i‫ام‬
‫قانون‬ ‫و‬j‫ام‬
Coarse-grained parallel approach
Kernel 1
•‫وهمه‬ ‫ها‬‫قانون‬ ‫همه‬ ‫تطبیق‬
‫ها‬‫نمونه‬
•‫هر‬Thread:
•1.‫یک‬ ‫و‬ ‫قانون‬ ‫یک‬ ‫تطبیق‬
‫نمونه‬
•2.‫معیار‬ ‫سه‬ ‫محاسبه‬(‫تطبیق‬
condition،class‫هردو‬ ‫و‬)
•3.‫در‬ ‫نتایج‬ ‫ذخیره‬shareMem
Kernel 2
•‫تطبیق‬ ‫عدم‬ ‫و‬ ‫تطبیق‬ ‫تعداد‬ ‫شمارش‬
‫قانون‬ ‫یک‬
19
Kernel 1
20
Kernel 2
21
fine-grained parallelisation
Kernel 1:‫تطبیق‬ ‫محاسبه‬Condition‫گسسته‬ ‫های‬‫ویژگی‬ ‫برای‬
Kernel 2:‫تطبیق‬ ‫محاسبه‬Condition‫پیوسته‬ ‫های‬‫ویژگی‬ ‫برای‬
Kernel 3:‫تطبیق‬ ‫محاسبه‬class
Kernel 4:‫محاسبه‬AND‫تطبیق‬Condition‫تطبیق‬ ‫و‬Class
‫تکرار‬ ‫هر‬ ‫در‬ ‫نتایج‬ ‫تعداد‬ ‫کاهش‬
22
Kernel 1,2
23
Experimental design
24
Name:‫نام‬Dataset
T:‫مجموعه‬ ‫سایز‬
Training
#Att:‫ها‬‫ویژگی‬ ‫تعداد‬
#Dis:‫های‬‫ویژگی‬ ‫تعداد‬
‫گسسته‬
#Con:‫های‬‫ویژگی‬ ‫تعداد‬
‫پیوسته‬
#Cl:‫تعداد‬Class‫ها‬
Experimental design
 Intel(R) Core(TM) i7 CPU
8 cores
3.07 GHz
12 GB of RAM
 Tesla C2070
6 GB of internal memory
448 CUDA cores
14 multiprocessors x 32 CUDA Cores/MP
25
Experimental design
 the serial experiments are run in Intel Xeon E5472 processors at 3.0 GHz
26
Experimental design
 Pentium 4
3.6 GHz
hyper-threading
2 GB of RAM
 Tesla C1060
4 GB of global memory
30 multiprocessors
27
Synthetic datasets Result
28
Run-time of the two GPU strategies on
synthetic problems
#Windows=1 and population size=500
Log scale is used for both axis
disc = discrete attributes
real = continuous attributes
Synthetic datasets Result
29
Run-time per instance of the two GPU strategies on synthetic problems
#Attributes=300, #Windows=1 and population size=500
Log scale in x axis
disc = discrete attributes
real = continuous attributes
Synthetic datasets Result
30
Run-time per attribute of the two GPU strategies on synthetic problems
#Instances=1 M, #Windows=1 and population size=500
Log scale in x axis
disc = discrete attributes
real = continuous attributes
Synthetic datasets Result
31
Run-time per individual of the two GPU strategies on synthetic problems
#Instances=1 M, #Attributes = 300 and #Windows=1
disc = discrete attributes
real = continuous attributes
Synthetic datasets Result
32
Run-time per individual of the two GPU strategies on synthetic problems
#Instances=1 M, #Attributes = 300 and #Windows=1
disc = discrete attributes
real = continuous attributes
Synthetic datasets Result
33
Execution time in seconds of the evaluation process of the serial version and
both CUDA fitness functions with windowing disabled
Experiments on real-world datasets
34
Speedup against the serial algorithm without using
windowing of the different parallelisation
approaches ran on different architectures
Experiments on real-world datasets
35
Independent evaluation process, coarse-grained
strategy on the C1060 GPU Card
Problems:
black = continuous
red = mixed
blue = discrete
(For interpretation of the references to colour in this
figure legend, the reader is referred to the web
version of this article)
Experiments on real-world datasets
36
Independent evaluation process, coarse-grained
strategy on the C2070 GPU Card
Problems:
black = continuous
red = mixed
blue = discrete
(For interpretation of the references to colour in this
figure legend, the reader is referred to the web
version of this article)
Experiments on real-world datasets
37
Independent evaluation process, fine-grained
strategy on the C2070 GPU Card
Problems:
black = continuous
red = mixed
blue = discrete
(For interpretation of the references to colour in this
figure legend, the reader is referred to the web
version of this article)
Conclusions
.1‫برای‬ ‫تکاملی‬ ‫ماشین‬ ‫یادگیری‬ ‫استراتژی‬ ‫دو‬gpu‫شد‬ ‫سازی‬ ‫پیاده‬
.2‫درشت‬ ‫روش‬-‫ریز‬ ‫روش‬ ‫و‬ ،‫بوده‬ ‫تر‬ ‫کارانه‬ ‫محافظه‬ ،‫دانه‬-‫بیشتری‬ ‫سازی‬ ‫موازی‬ ‫دانه‬
‫داشته‬
.3Kernel‫ریز‬ ،-‫در‬ ،‫بوده‬ ‫تر‬‫سریع‬ ‫دانه‬Dataset‫با‬10‫الی‬15،‫موارد‬ ‫سایر‬ ‫در‬ ‫و‬ ‫ویژگی‬
‫درشت‬-‫بوده‬ ‫تر‬ ‫سریع‬ ‫دانه‬
.4‫از‬ ‫استفاده‬ ،‫کوچک‬ ‫مسائل‬ ‫در‬gpu‫است‬ ‫داشته‬ ‫بدتری‬ ‫نتایج‬
.5‫کار‬‫حجم‬ ‫و‬ ‫سازی‬ ‫موازی‬ ‫بین‬ ‫تعادل‬Thread‫داشت‬ ‫خواهد‬ ‫مناسبی‬ ‫نتایج‬ ‫ها‬
.6‫درشت‬ ‫اینکه‬-‫سازی‬ ‫موازی‬ ‫عمومی‬ ‫درک‬ ‫با‬ ‫متضاد‬ ،‫اند‬‫داشته‬ ‫بهتری‬ ‫نتایج‬ ‫ها‬‫دانه‬
‫است‬ ‫تسریع‬ ‫و‬ ‫بیشتر‬
.7‫را‬ ‫پارامترها‬ ‫بدرستی‬ ‫توان‬‫می‬ ‫بررسی‬ ‫و‬ ‫دقت‬ ‫با‬Tune‫نمود‬
.8Gpu‫بین‬ ‫سریع‬ ‫ارتباطات‬ ‫امکان‬ ‫که‬ ،‫دارند‬ ‫افزاری‬ ‫سخت‬ ‫پیشرفته‬ ‫امکانات‬ ‫جدید‬ ‫های‬
Wrap‫کنند‬‫می‬ ‫فراهم‬ ‫را‬ ‫ها‬(‫مثل‬wrap،vote‫و‬shuffle)‫شوند‬ ‫باعث‬ ‫توانند‬‫می‬ ‫که‬
Kernel‫ریز‬ ‫های‬-‫شوند‬ ‫تر‬ ‫سریع‬ ‫دانه‬
38
Recommendation
.1‫پارامترها‬ ‫مناسب‬ ‫انتخاب‬
.2‫تالش‬ ‫آن‬ ‫بهبود‬ ‫برای‬ ‫توان‬‫می‬ ‫که‬ ،‫است‬ ‫نشده‬ ‫بحثی‬ ‫هیچ‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫مورد‬ ‫در‬
‫نمود‬
.3‫ترین‬‫مناسب‬ ‫شرایط‬ ‫به‬ ‫بسته‬ ‫امکان‬ ‫صورت‬ ‫در‬ ‫که‬ ،‫گیرنده‬ ‫تصمیم‬ ‫تابع‬ ‫یک‬ ‫توسعه‬
‫نماید‬ ‫لحاظ‬ ‫را‬ ‫پارامترها‬ ‫و‬ ‫الگوریتم‬
.4‫از‬ ‫استفاده‬co-processor‫سازی‬ ‫بهینه‬ ‫و‬gpu‫های‬‫الگوریتم‬ ‫و‬ ‫ماشین‬ ‫یادگیری‬ ‫برای‬
‫تکاملی‬
39
Question ?
☻Thanks☻
40

Seminar-Parallel Processing

  • 1.
    GPU strategies for evolutionarymachine learning Master : Dr. Ghaderi Mohammad Amin Amjadi Spring 2016
  • 2.
    ‫مقاالت‬ 1. Large-scale experimentalevaluation of GPU strategies for evolutionary machine learning María A. Franco, Jaume Bacardit 2016 Elsevier B.V. All rights reserved 2. Improving the scalability of rule-based evolutionary learning Jaume Bacardit, Edmund K. Burke, Natalio Krasnogor 2009 2
  • 3.
    ‫مطالب‬ 1.Evolutionary Algorithm 2.Machine Learning 3.Problem 4.Goal 5.BioHELAlgorithm 6.GPUs and CUDA 7. CUDA-based fitness computation for BioHEL 8. Coarse-grained parallel approach 9. fine-grained parallelization 10. Experimental design 11. Conclusions 12. Recommendation 3
  • 4.
    Evolutionary Algorithm •‫بررسی‬ ‫را‬‫حاالت‬ ‫از‬ ‫یکسری‬ ‫تصادفی‬ ‫بصورت‬ ‫نمائیم‬‫می‬ •‫نتیجه‬ ‫بررسی‬ ‫و‬ ‫تصادفی‬ ‫انتخاب‬ ‫فرآیند‬ ‫نمائیم‬‫می‬ ‫تکرار‬ ‫بار‬ ‫چندین‬ ‫را‬ •‫و‬ ‫انتخاب‬ ،‫جهش‬ ،‫همبری‬ ‫عملگرهای‬ ‫از‬... ‫نمائیم‬‫می‬ ‫استفاده‬ ‫مرحله‬ ‫هر‬ ‫در‬ •،‫ها‬‫الگوریتم‬ ‫از‬ ‫برخی‬ ‫هستند‬ ‫بر‬‫زمان‬ ‫و‬ ‫پیچیده‬ •‫حاالت‬ ‫تمام‬ ‫خواهیم‬‫نمی‬ ‫نمائیم‬ ‫بررسی‬ ‫را‬ •‫تقریب‬ ‫یک‬ ‫خواهیم‬‫می‬ ‫فقط‬ ‫بزنیم‬ 4 𝑓 𝑥, 𝑦, 𝑧 = reward = fitness reward ≠ cost
  • 5.
  • 6.
    Problem ‫اگر‬ ‫شود‬‫می‬ ‫زیاد‬‫یادگیری‬ ‫زمان‬: ‫الف‬)dataset‫باشد‬ ‫بزرگ‬ ‫ب‬)‫باشد‬ ‫پیچیده‬ ‫یادگیری‬ ‫مدل‬(‫و‬ ‫نظارت‬ ‫با‬ ‫یادگیری‬ ‫همانند‬)... ‫از‬ ‫استفاده‬ ‫ها‬‫روش‬ ‫ترین‬‫شایع‬ ‫از‬ ‫یکی‬ ‫امروزه‬gpu‫مقیاس‬ ‫بهبود‬ ‫برای‬ ‫خصوصا‬ ،‫است‬ ‫داده‬ ‫های‬‫الگوریتم‬ ‫پذیری‬-‫کاوی‬ ‫از‬ ،‫تکاملی‬ ‫های‬‫الگوریتم‬ ‫موازی‬ ‫طبیعت‬ ‫بدلیل‬gpu‫استفاده‬ ‫وری‬‫بهره‬ ‫بهبود‬ ‫برای‬ ‫است‬ ‫شده‬ 6
  • 7.
    Goal ‫تکاملی‬ ‫یادگیری‬ ‫سیستم‬‫از‬ ‫استفاده‬BioHEL‫داده‬ ‫برای‬ ‫خاص‬ ‫بطور‬ ‫که‬-‫کاوی‬ dataset‫است‬ ‫شده‬ ‫طراحی‬ ‫بزرگ‬ ‫های‬ ‫سیستم‬BioHEL‫کند‬‫می‬ ‫رقابت‬ ،‫ماشین‬ ‫یادگیری‬ ‫های‬‫الگوریتم‬ ‫سایر‬ ‫با‬ ‫یک‬ ‫از‬ ‫شود‬‫می‬ ‫پیشنهاد‬gpu‫مناسب‬BioHEL(nvidia‫از‬ ‫که‬cuda‫نماید‬‫می‬ ‫پشتیبانی‬)، ‫شود‬ ‫استفاده‬ ‫از‬ ‫بیش‬ ‫تسریع‬ ،‫بزرگ‬ ‫مسائل‬ ‫و‬ ‫آزمایشات‬ ‫در‬60‫است‬ ‫داشته‬ ‫برابر‬ ‫حاضر‬ ‫حال‬ ‫در‬ ،‫وری‬ ‫بهره‬ ‫افزایش‬ ‫مکانیزهای‬ ‫ترکیب‬ ‫با‬BioHEL‫از‬ ‫بیش‬750‫برابر‬ ‫است‬ ‫داشته‬ ‫تسریع‬ 7
  • 8.
    BioHEL BioHEL،‫بزرگ‬ ‫مقیاس‬ ‫های‬‫داده‬‫مجموعه‬ ‫مدیریت‬ ‫هدف‬ ‫با‬ ،‫تکاملی‬ ‫یادگیری‬ ‫سیستم‬ ‫یک‬ ‫باشد‬ ‫می‬ ‫قانون‬ ‫یادگیری‬ ‫روش‬ ‫از‬ ‫پس‬ ،‫سیستم‬ ‫این‬(rule)‫های‬‫قانون‬ ‫مجموعه‬ ،‫تکرارشونده‬ ‫کند‬‫می‬ ‫تولید‬ ‫را‬ ‫مراتبی‬ ‫سلسله‬ ‫از‬ ،‫آوردیم‬ ‫دست‬ ‫به‬ ‫پی‬ ‫در‬ ‫پی‬ ‫که‬ ‫هایی‬‫قانون‬ ،‫قانون‬ ‫هر‬ ‫یادگیری‬ ‫برای‬ ‫روش‬ ‫این‬ ‫در‬ ‫کند‬‫می‬ ‫استفاده‬ ‫استاندارد‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫یک‬ 8
  • 9.
    BioHEL Procedure BioHEL generalworkflow Input : TrainingSet RuleSet = ∅ stop = false Do BestRule = null For repetition=1 to NumRepetitionsRuleLearning CandidateRule = RunGA(TrainingSet) If CandidateRule is better than BestRule BestRule = CandidateRule EndIf EndFor Matched = Examples from TrainingSet matched by BestRule If class of BestRule is the majority class in Matched Remove Matched from TrainingSet Add BestRule to RuleSet Else stop = true EndIf While stop is false Output : RuleSet 9
  • 10.
    BioHEL Fitness = TL· W + EL TL = 0.25 : theory length : ‫حل‬ ‫راه‬ ‫پیچیدگی‬ EL : exceptions length : ‫حل‬ ‫راه‬ ‫دقت‬ W = 0.9 : weight : TL‫و‬ EL‫بین‬ ‫رابطه‬ ‫تنظیم‬ 𝑇𝐿 𝑅 = 𝑖=1 𝑖=𝑁𝐴 1 − 𝑠𝑖𝑧𝑒(𝑅𝑖) 𝑠𝑖𝑧𝑒(𝐷𝑖) 𝑁𝐴 R:‫قانون‬ ‫یک‬ NA:‫دامنه‬ ‫های‬‫ویژگی‬ ‫تعداد‬ Size(Ri):‫ویژگی‬ ‫با‬ ‫مرتبط‬ ‫فاصله‬ ‫طول‬i،‫ام‬R Size(Di):‫ویژگی‬ ‫طول‬i‫دامنه‬ ،‫ام‬ 10
  • 11.
    BioHEL EL(R) = 2− ACC(R) − COV(R) ACC R = 𝑐𝑜𝑟𝑟(𝑅) 𝑚𝑎𝑡𝑐ℎ𝑒𝑑(𝑅) 𝐶𝑂𝑉 𝑅 = 𝐶𝑅. 𝑅𝐶 𝐶𝐵 𝑖𝑓 𝑅𝐶 < 𝐶𝐵 𝐶𝑅 + 1 − 𝐶𝑅 . 𝑅𝐶 − 𝐶𝐵 1 − 𝑅𝐶 𝑖𝑓 𝑅𝐶 ≥ 𝐶𝐵 𝑅𝐶 = 𝑚𝑎𝑡𝑐ℎ𝑒𝑑(𝑅) |𝑇| 11
  • 12.
    BioHEL BioHEL‫از‬ALKR‫کند‬‫می‬ ‫استفاده‬ ‫ژنتیکی‬‫الگوریتم‬ ‫در‬ ‫قانون‬ ‫رمزکردن‬ ‫برای‬(‫در‬ ‫جمعیت‬ ‫ژنتیکی‬ ‫الگوریتم‬) 12 numAtt : ‫ویژگی‬ ‫تعداد‬ whichAtt : ‫ها‬‫ویژگی‬ predicates : ‫مقادیر‬ ‫ها‬‫ویژگی‬ offsetPred : ‫حافظه‬ ‫مکان‬ ‫ویژگی‬ ‫هر‬ class : ‫قانون‬ ‫کالس‬
  • 13.
    BioHEL BioHEL‫که‬ ‫ای‬‫پنجره‬ ‫مکانیزم‬‫از‬ ،‫وری‬ ‫بهره‬ ‫افزایش‬ ‫و‬ ‫اجرا‬ ‫زمان‬ ‫کاهش‬ ‫برای‬ILAS ‫کند‬‫می‬ ‫استفاده‬ ،‫شود‬‫می‬ ‫نامیده‬ Training set‫از‬ ‫قسمتی‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫هرمرحله‬ ‫در‬ ‫و‬ ،‫شود‬‫می‬ ‫تقسیم‬ ‫قسمت‬ ‫چندین‬ ‫به‬ ‫شود‬‫می‬ ‫لحاظ‬ ‫آن‬ ‫شود‬‫می‬ ‫داده‬ ‫نمایش‬ ‫صورت‬ ‫بدین‬ ‫قانون‬ ‫یک‬: 13
  • 14.
  • 15.
    GPUs and CUDA ‫تخصیص‬‫حافظه‬‫زیاد‬‫در‬CUDA‫و‬‫انتقال‬،‫آن‬ ‫هزینه‬‫زیادی‬‫دارد‬ ‫استفاده‬‫از‬‫حافظه‬‫برای‬CUDA‫بحرانی‬‫است‬ ‫که‬‫تواند‬‫می‬‫باعث‬‫افت‬‫کارایی‬‫شود‬ Coalescence‫بسیار‬‫مهم‬‫است‬ ‫به‬‫زمانی‬‫برسیم‬‫که‬Thread‫های‬‫پشت‬‫سرهم‬‫در‬‫یک‬ block،‫به‬‫های‬‫مکان‬‫پشت‬‫سرهم‬‫حافظه‬‫دسترسی‬ ‫داشته‬‫باشند‬ ‫عدم‬Coalescence‫باعث‬‫افزایش‬‫زمان‬‫اجرای‬ Kernel‫شود‬‫می‬ ‫استفاده‬‫مناسب‬‫از‬‫حافظه‬‫تواند‬‫می‬‫باعث‬ ‫افزایش‬‫کارایی‬‫شود‬ 15 HostDevice 1. Host to Device 2. Launch Kernel 3. Device to Host
  • 16.
    types of memoryin CUDA Device mem Texture mem Shared mem ‫بین‬Thread‫یک‬ ‫های‬Block‫است‬ ‫مشترک‬ Constant mem ‫توسط‬ ‫فقط‬Host‫است‬ ‫نوشتن‬ ‫قابل‬ Local thread mem ‫هر‬ ‫مخصوص‬Thread 16
  • 17.
    CUDA-based fitness computationfor BioHEL ‫شایستگی‬ ‫محاسبه‬ ‫برای‬(Fitness)‫شود‬‫می‬ ‫شمارش‬ ‫معیار‬ ‫سه‬ ،‫قانون‬ ‫هر‬:‫تعداد‬ ‫که‬ ‫هایی‬‫نمونه‬ .1‫با‬condition‫قانون‬match‫شوند‬‫می‬ .2‫با‬class‫قانون‬match‫شوند‬‫می‬ .3‫با‬ ‫همزمان‬class‫و‬condition‫قانون‬match‫شوند‬‫می‬ ‫تابع‬ ‫از‬ ‫هدف‬CUDA fitness،‫است‬ ‫معیار‬ ‫سه‬ ‫محاسبه‬ ‫و‬ ‫تطبیق‬ ‫فرآیند‬ ‫موازی‬ ‫انجام‬ ، ‫شود‬‫می‬ ‫انجام‬ ‫گام‬ ‫دو‬ ‫در‬ ‫که‬: .1‫ی‬‫همه‬ ‫بین‬ ‫تطبیق‬ ‫محاسبه‬classifier‫ها‬‫نمونه‬ ‫ی‬‫همه‬ ‫و‬ ‫ها‬ .2‫موازی‬ ‫بصورت‬ ،‫قانون‬ ‫هر‬ ‫برای‬ ‫معیار‬ ‫سه‬ ‫محاسبه‬ ‫محاسبه‬fitness‫شود‬‫می‬ ‫عنوان‬ ‫مقاله‬ ‫این‬ ‫در‬ ‫روش‬ ‫دو‬ ‫به‬: .1‫درشت‬ ‫موازی‬ ‫روش‬-‫دانه‬:coarse-grained parallelisation:‫مقاله‬ ‫اصلی‬ ‫روش‬ .2‫ریز‬ ‫موازی‬ ‫روش‬-‫دانه‬:fine-grained parallelisation:‫پیشنهادی‬ ‫روش‬ 17
  • 18.
    CUDA-based fitness computationfor BioHEL 18 coarse-grained parallelisation •‫است‬ ‫دوبعدی‬ •𝑇𝑖,𝑗 •‫نمونه‬ ‫تطبیق‬i‫قانون‬ ‫و‬ ‫ام‬j‫ام‬ fine-grained parallelisation •‫است‬ ‫بعدی‬ ‫سه‬:‫تعداد‬ ‫به‬ ‫مسئله‬ ‫های‬‫ویژگی‬ •𝑇𝑖,𝑗,𝑘 •‫ویژگی‬ ‫تطبیق‬k‫نمونه‬ ‫از‬ ‫ام‬i‫ام‬ ‫قانون‬ ‫و‬j‫ام‬
  • 19.
    Coarse-grained parallel approach Kernel1 •‫وهمه‬ ‫ها‬‫قانون‬ ‫همه‬ ‫تطبیق‬ ‫ها‬‫نمونه‬ •‫هر‬Thread: •1.‫یک‬ ‫و‬ ‫قانون‬ ‫یک‬ ‫تطبیق‬ ‫نمونه‬ •2.‫معیار‬ ‫سه‬ ‫محاسبه‬(‫تطبیق‬ condition،class‫هردو‬ ‫و‬) •3.‫در‬ ‫نتایج‬ ‫ذخیره‬shareMem Kernel 2 •‫تطبیق‬ ‫عدم‬ ‫و‬ ‫تطبیق‬ ‫تعداد‬ ‫شمارش‬ ‫قانون‬ ‫یک‬ 19
  • 20.
  • 21.
  • 22.
    fine-grained parallelisation Kernel 1:‫تطبیق‬‫محاسبه‬Condition‫گسسته‬ ‫های‬‫ویژگی‬ ‫برای‬ Kernel 2:‫تطبیق‬ ‫محاسبه‬Condition‫پیوسته‬ ‫های‬‫ویژگی‬ ‫برای‬ Kernel 3:‫تطبیق‬ ‫محاسبه‬class Kernel 4:‫محاسبه‬AND‫تطبیق‬Condition‫تطبیق‬ ‫و‬Class ‫تکرار‬ ‫هر‬ ‫در‬ ‫نتایج‬ ‫تعداد‬ ‫کاهش‬ 22
  • 23.
  • 24.
    Experimental design 24 Name:‫نام‬Dataset T:‫مجموعه‬ ‫سایز‬ Training #Att:‫ها‬‫ویژگی‬‫تعداد‬ #Dis:‫های‬‫ویژگی‬ ‫تعداد‬ ‫گسسته‬ #Con:‫های‬‫ویژگی‬ ‫تعداد‬ ‫پیوسته‬ #Cl:‫تعداد‬Class‫ها‬
  • 25.
    Experimental design  Intel(R)Core(TM) i7 CPU 8 cores 3.07 GHz 12 GB of RAM  Tesla C2070 6 GB of internal memory 448 CUDA cores 14 multiprocessors x 32 CUDA Cores/MP 25
  • 26.
    Experimental design  theserial experiments are run in Intel Xeon E5472 processors at 3.0 GHz 26
  • 27.
    Experimental design  Pentium4 3.6 GHz hyper-threading 2 GB of RAM  Tesla C1060 4 GB of global memory 30 multiprocessors 27
  • 28.
    Synthetic datasets Result 28 Run-timeof the two GPU strategies on synthetic problems #Windows=1 and population size=500 Log scale is used for both axis disc = discrete attributes real = continuous attributes
  • 29.
    Synthetic datasets Result 29 Run-timeper instance of the two GPU strategies on synthetic problems #Attributes=300, #Windows=1 and population size=500 Log scale in x axis disc = discrete attributes real = continuous attributes
  • 30.
    Synthetic datasets Result 30 Run-timeper attribute of the two GPU strategies on synthetic problems #Instances=1 M, #Windows=1 and population size=500 Log scale in x axis disc = discrete attributes real = continuous attributes
  • 31.
    Synthetic datasets Result 31 Run-timeper individual of the two GPU strategies on synthetic problems #Instances=1 M, #Attributes = 300 and #Windows=1 disc = discrete attributes real = continuous attributes
  • 32.
    Synthetic datasets Result 32 Run-timeper individual of the two GPU strategies on synthetic problems #Instances=1 M, #Attributes = 300 and #Windows=1 disc = discrete attributes real = continuous attributes
  • 33.
    Synthetic datasets Result 33 Executiontime in seconds of the evaluation process of the serial version and both CUDA fitness functions with windowing disabled
  • 34.
    Experiments on real-worlddatasets 34 Speedup against the serial algorithm without using windowing of the different parallelisation approaches ran on different architectures
  • 35.
    Experiments on real-worlddatasets 35 Independent evaluation process, coarse-grained strategy on the C1060 GPU Card Problems: black = continuous red = mixed blue = discrete (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article)
  • 36.
    Experiments on real-worlddatasets 36 Independent evaluation process, coarse-grained strategy on the C2070 GPU Card Problems: black = continuous red = mixed blue = discrete (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article)
  • 37.
    Experiments on real-worlddatasets 37 Independent evaluation process, fine-grained strategy on the C2070 GPU Card Problems: black = continuous red = mixed blue = discrete (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article)
  • 38.
    Conclusions .1‫برای‬ ‫تکاملی‬ ‫ماشین‬‫یادگیری‬ ‫استراتژی‬ ‫دو‬gpu‫شد‬ ‫سازی‬ ‫پیاده‬ .2‫درشت‬ ‫روش‬-‫ریز‬ ‫روش‬ ‫و‬ ،‫بوده‬ ‫تر‬ ‫کارانه‬ ‫محافظه‬ ،‫دانه‬-‫بیشتری‬ ‫سازی‬ ‫موازی‬ ‫دانه‬ ‫داشته‬ .3Kernel‫ریز‬ ،-‫در‬ ،‫بوده‬ ‫تر‬‫سریع‬ ‫دانه‬Dataset‫با‬10‫الی‬15،‫موارد‬ ‫سایر‬ ‫در‬ ‫و‬ ‫ویژگی‬ ‫درشت‬-‫بوده‬ ‫تر‬ ‫سریع‬ ‫دانه‬ .4‫از‬ ‫استفاده‬ ،‫کوچک‬ ‫مسائل‬ ‫در‬gpu‫است‬ ‫داشته‬ ‫بدتری‬ ‫نتایج‬ .5‫کار‬‫حجم‬ ‫و‬ ‫سازی‬ ‫موازی‬ ‫بین‬ ‫تعادل‬Thread‫داشت‬ ‫خواهد‬ ‫مناسبی‬ ‫نتایج‬ ‫ها‬ .6‫درشت‬ ‫اینکه‬-‫سازی‬ ‫موازی‬ ‫عمومی‬ ‫درک‬ ‫با‬ ‫متضاد‬ ،‫اند‬‫داشته‬ ‫بهتری‬ ‫نتایج‬ ‫ها‬‫دانه‬ ‫است‬ ‫تسریع‬ ‫و‬ ‫بیشتر‬ .7‫را‬ ‫پارامترها‬ ‫بدرستی‬ ‫توان‬‫می‬ ‫بررسی‬ ‫و‬ ‫دقت‬ ‫با‬Tune‫نمود‬ .8Gpu‫بین‬ ‫سریع‬ ‫ارتباطات‬ ‫امکان‬ ‫که‬ ،‫دارند‬ ‫افزاری‬ ‫سخت‬ ‫پیشرفته‬ ‫امکانات‬ ‫جدید‬ ‫های‬ Wrap‫کنند‬‫می‬ ‫فراهم‬ ‫را‬ ‫ها‬(‫مثل‬wrap،vote‫و‬shuffle)‫شوند‬ ‫باعث‬ ‫توانند‬‫می‬ ‫که‬ Kernel‫ریز‬ ‫های‬-‫شوند‬ ‫تر‬ ‫سریع‬ ‫دانه‬ 38
  • 39.
    Recommendation .1‫پارامترها‬ ‫مناسب‬ ‫انتخاب‬ .2‫تالش‬‫آن‬ ‫بهبود‬ ‫برای‬ ‫توان‬‫می‬ ‫که‬ ،‫است‬ ‫نشده‬ ‫بحثی‬ ‫هیچ‬ ‫ژنتیکی‬ ‫الگوریتم‬ ‫مورد‬ ‫در‬ ‫نمود‬ .3‫ترین‬‫مناسب‬ ‫شرایط‬ ‫به‬ ‫بسته‬ ‫امکان‬ ‫صورت‬ ‫در‬ ‫که‬ ،‫گیرنده‬ ‫تصمیم‬ ‫تابع‬ ‫یک‬ ‫توسعه‬ ‫نماید‬ ‫لحاظ‬ ‫را‬ ‫پارامترها‬ ‫و‬ ‫الگوریتم‬ .4‫از‬ ‫استفاده‬co-processor‫سازی‬ ‫بهینه‬ ‫و‬gpu‫های‬‫الگوریتم‬ ‫و‬ ‫ماشین‬ ‫یادگیری‬ ‫برای‬ ‫تکاملی‬ 39
  • 40.