using gpus to accelerate learning to rankon-demand.gputechconf.com/gtc/2014/...learning-rank... ·...

21

Upload: others

Post on 13-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise
Page 2: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

Using GPUs to Accelerate Learning to Rank Alexander Shchekalev Senior developer

Page 3: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

3

Contents

• Task of learning to rank • Common approaches in solving the task • Decision tree boosting • MatrixNet and its GPU implementation • Performance • Applications

Page 4: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

4

Yandex’s search engine

• Search engine provides answers to user’s queries

• Millions of documents match any search query • Ranking defines the order of search results to

provide a user with the most relevant ones

Page 5: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

5

Yandex’s search engine

• Millions of documents match any search query • Ranking defines the order of search results to

provide a user with the most relevant ones

Page 6: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

6

Yandex’s machine learning

• Prerequisites: – Set of search queries – Set of documents corresponding to each query – Relevance judgements for each query-document pair

• Each query-document pair is represented in the vector space of features (number of links, word matching etc.)

• Ranking quality is estimated by an evaluation measure (MAP, DCG etc.)

Q = q1,...,qn{ }q→ d1,d2,...{ }

lqd

Page 7: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

7

Solving learning to rank problem

• There are three common approaches: – Listwise – Pairwise – Pointwise

• Listwise approach optimizes the evaluation measure

• Pairwise approach uses a classification problem and optimizes the objective functions on the pairs of documents

Page 8: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

8

Pointwise approach (regression)

• Pointwise approach optimizes relevance predictions

• L(fr(q, d), rel(q, d)) – loss function, F – set of possible ranking functions

argminfr∈F

1n

L( fr(q,d), rel(q,d))(q,d )∑

Page 9: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

9

Boosting

• Ensemble method builds a strong learner as a linear combination of weak learners

• Trade-off between the quality of model and the time of the learning process

• Choice of decision trees as weak learners shows the best results for the learning-to-rank problem

Page 10: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

10

Decision trees

Page 11: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

11

MatrixNet

• Method is based on the gradient boosting of decision trees

• Each decision tree is binary and consists of 6 splits

• Sorted values of each feature are split into 32 equal size bins and bin min/max values are used as possible splits

Page 12: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

12

MatrixNet

• GPU based implementation calculates 32-bin histograms to evaluate each available split of one feature

• Histogram construction makes extensive use of very fast shared memory

• Gradient values are stored in registers and loaded from global memory only once for all splits of feature

Page 13: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

13

Histogram calculation

• Single thread block uses all available shared memory

• Block size equals 384 threads for Fermi and Kepler architectures

• Simple layout in case of single feature per block

tid + btid * 384!

Page 14: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

14

Histogram calculation

• Each warp builds partial histogram using 1024 elements with the following layout fk = (tid & 7 + k * 2) + (tid & 1) + (tid & 24) !

fk + btid * 32!

!

Page 15: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

15

Performance comparison

• Hardware –  CPU Intel Xeon E5-2650 –  GPU NVIDIA Tesla C2075

• Data –  Common data set used for

training production ranking models

–  Includes more than 700 features

• More than 20 times speed up

0  

5  

10  

15  

20  

25  

Rela%v

e  speedu

p  

Number  of  documents  

8  CPU   16  CPU   1  GPU  

Page 16: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

16

Application: ranking functions

• Pairwise target function is used to train production models

• CPU profile – Hardware: 50 double CPU machines – Time: 25 hours

• GPU profile – Hardware: 1 machine with 4 Tesla M2090 – Time: 8 hours

• Workload of 1000 models per month is handled by 12 machines

Page 17: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

17

Application: evaluating features • New ranking features help better understand

the user • Results of 250 pairs of models are compared

by cross validation • CPU profile

– Hardware: 500 CPU machines – Time: 1 hour

• GPU profile – Hardware: 6 machines with 4 GPUs – Time: 1 hour

• Almost 7000 evaluations are handled by the cluster with 40 machines

Page 18: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

18

Friendly Machine Learning

Page 19: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

19

Friendly Machine Learning

Page 20: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

20

Yandex Data Factory

• Public version of FML – Yandex Data Factory • Full cycle machine learning pipeline – from

research to production

Page 21: Using GPUs to Accelerate Learning to Rankon-demand.gputechconf.com/gtc/2014/...learning-rank... · Solving learning to rank problem • There are three common approaches: – Listwise

Alexander Shchekalev

Senior developer

[email protected]

Thank you!