![Page 1: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/1.jpg)
A GPU-Powered Real-time Analytics Engine
![Page 2: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/2.jpg)
Agenda
● Real-time analytics at Uber● Leveraging GPU for real-time analytics● AresDB Architecture and Features● Learnings From GPU Programming● Future Directions
2
![Page 3: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/3.jpg)
Real-time analytics at Uber
3
![Page 4: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/4.jpg)
Real-time Analytics Use Cases at Uber
4
Dynamic Pricing
Rider eyeballs
Open car information
![Page 5: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/5.jpg)
Real-time Analytics Use Cases CategorizationDashboards Decision Systems Ad hoc Queries
Dataset Subset Subset All data
Ingestion Latency Seconds to Minutes Seconds to Minutes Minutes
Query Pattern Well known Well known Arbitrary
Query QPS Medium High Low
Query Latency Sub seconds Sub seconds Minutes
Target Users City OPS, Executives Engineers (application developers)
Data Scientists, Analytics, City OPS
5
![Page 6: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/6.jpg)
Build a fast, reliable and scalable analytics platform solution to power
Uber’s Real-Time business intelligence
❏ sub-sec level query latency
❏ second to min level ingestion latency
❏ High availability (4 9s)❏ High data accuracy (3 9s) ❏ Uber scale and
beyond
Mission of AresDB
![Page 7: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/7.jpg)
7
Leveraging GPU for Real-Time Analytics
![Page 8: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/8.jpg)
AresDB: A GPU-Powered Real-time Analytics Engine
8
●
● High-efficiency storage● Low-latency ingestion● Sub-second query response time● Feature set for real-time analytics
![Page 9: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/9.jpg)
How is AresDB used at Uber
9
Ingestion (with upserts)< 1min
Databases
Uber Services
Message Queue
Streaming Processors
Query< 1 sec
![Page 10: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/10.jpg)
The Problem: Time-series Analytics
10
Computing measures by dimensions on time series data
request_at city_id fare
2017-04-13 10:25 1 15.3
2017-04-13 11:10 1 7.5
2017-04-14 10:35 1 20.1
2017-04-14 11:40 5 12.1
2017-04-14 15:45 5 5.6
day(request_at) city_id sum(fare)
2017-04-13 1 22.8
2017-04-14 1 20.1
2017-04-14 5 17.7
computes
![Page 11: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/11.jpg)
11
Why are GPUs well-suited ?
![Page 12: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/12.jpg)
GPU vs CPU
12
12 Threads
59GB/s
500 GFlOPS
Intel® Xeon® Processor E5-2620 v3
Tesla P100
3584 CUDA cores
549G/s
9.3 TFlOPS
![Page 13: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/13.jpg)
GPU vs CPU
13
![Page 14: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/14.jpg)
14
ALU
ALU
ALU
ALUControl
DRAM (12G)
Cache
DRAM (256G) PCIe
16GB/s549G/s
59GB/s
CPU GPU
Hardware Storage Choices
![Page 15: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/15.jpg)
15
Hardware Storage Choices
Capacity Bandwidth to GPUs Ingestion Method Comment
HDD 8TB 100MB/s File writing similar to traditional databases
Unable to feed data fast enough to fully utilize GPUsSSD 4TB 600MB/s
NVMe 2TB 3GB/s And also expensive
Host Memory
256GB 15GB/s per side;30GB/s two sides
Memory writing Limited by PCIe bandwidth
GPU Memory
12GBx8 500GB/s on the same GPU;15GB/s across GPUs
Sharding across multiple GPUs;Complex memory writing
Tight coupling of storage and computation; ingestion is challenging
![Page 16: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/16.jpg)
16
AresDB Architecture and Features
![Page 17: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/17.jpg)
AresDB Architecture: Single Instance
17
API
Memory Disk
GPU
MetaData
DiskStoreMemStore
MetaStore
Query
Ingestion
Schema
![Page 18: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/18.jpg)
Fact/Dimension Table
18
● Fact table○ Facts about a business process○ Each record associated with an event time (grows with time)○ E.g. trips, orders, ...
● Dimension table○ Descriptive attributes/dimensions○ E.g. product catalogs, cities, ...
![Page 19: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/19.jpg)
Star Schema
19
Facts
EventTime
Primary Key
Foreign Keys ...
...
Dimension 2
Primary Key
...
Dimension 1
Primary Key
...
Dimension 3
Primary Key
...
Dimension 4
Primary Key
...
![Page 20: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/20.jpg)
Feature Highlights
20
● In-Memory Columnar Storage● Real-time upserts● GPU powered query engine● Analytical Query Feature Set
○ Time zone, Time Filter, Time Bucketization○ Geospatial analytics ○ Fact/dimension table joins○ Hyperloglog
![Page 21: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/21.jpg)
Columnar Storage: uncompressed
21
12
5
0
12
1
1
1
0
1
1
Value Vector NULL Vector
2 Bytes
1 Byte
Los Angeles
New York City
NULL
Los Angeles
San Francisco
Paddings
city_id
![Page 22: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/22.jpg)
Columnar Storage: compressed
22
0
1
5
12
0
1
1
1
Value Vector Null Vector
city_id
0
1
4
6
8
Count Vector
0
0
1
0
0
1
1
1
Value Vector Null Vector
status
0
1
3
4
6
Count Vector
0 1
8
NULL x1
SF x3
NYC x2
LA x2
NULL x1
completed x2
canceled x1
completed x2
completed x2
One to Many
![Page 23: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/23.jpg)
Columnar Storage: fact table
Fact Table
Live Store(uncompressed)
Archive Store(compressed)
Archive Files(compressed)
Redo Logs
Most Recent DataMature Data
MemStore
DiskStore
RecoveryPreloading /On Demand Loading
Archive: sort, compress, merge
Ingestion
Backfill23
![Page 24: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/24.jpg)
Columnar Storage: dimension table
Dimension Table
Live Store(uncompressed)
Redo Logs
MemStore
DiskStore
RecoverySnapshot
Ingestion
24
Snapshots
Load
![Page 25: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/25.jpg)
Feature Highlights
25
● In-Memory Columnar Storage● Real-time upserts● GPU powered query engine● Analytical Query Feature Set
○ Time zone, Time Filter, Time Bucketization○ Geospatial analytics ○ Fact/dimension table joins○ Hyperloglog
![Page 26: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/26.jpg)
Real-time upserts: ingestion flow
26
Backfill Queue
Batch -100
Batch -99
Upsert Batch
Columnar Vector
Empty Space
Live Store
Redo Logs
Append Replay
Late records
Updates
New records
![Page 27: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/27.jpg)
Real-time upserts: deduplication
27
Batch -100
Batch -99
Primary Key Hash Index
123-45-6789 -99:12
012-34-5678 -100:30
789-56-1234 -100:0
Primary Key Value Bach ID:Index
Live Store
Columnar Vector
Empty Space
![Page 28: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/28.jpg)
Real-time upserts: archiving
28
Batch 175002017-11-30
Version[1512090000, 7]
Batch 175012017-12-01
Version[1512120000, 0]
Sorted And Compressed Columnar Vector
Archive Store Version 1512120000
Batch 175002017-11-30
Version[1512090000, 7]
Batch 175012017-12-01
Version[1512090000, 5]
Archive Store Version 1512090000
Patch From Live Store
From: 1512090000To: 1512120000
Archive Merge
Reuse Unaffected Batches
![Page 29: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/29.jpg)
Real-time upserts: event timeline
29
Now cut-off Event TimePast
Ingestion
Write to live storeWrite to backfill queue
![Page 30: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/30.jpg)
Real-time upserts: event timeline
30
Now cut-off Event TimePast
Query
Read from Live StoreRead from Archive Store
![Page 31: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/31.jpg)
Real-time upserts: event timeline
31
Now cut-off Event TimePast
Archiving
new cut-off
Records Being Archived
Records Already Archived
Archiving interval Archiving Delay
![Page 32: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/32.jpg)
Real-time upserts: event timeline
32
Now Event TimePast
Archiving
cut-off
Records Already Archived
![Page 33: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/33.jpg)
Feature Highlights
33
● In-Memory Columnar Storage● Real-time upserts with deduplication● GPU powered query engine● Analytical Query Feature Set
○ Time zone, Time Filter, Time Bucketization○ Geospatial analytics ○ Fact/dimension table joins○ Hyperloglog
![Page 34: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/34.jpg)
Query EngineHigh level architecture
Query Compiler
Schema
Query Context
Live Store
Archive Store
Data Feeder
Query Engine
Post Processing
Results
Archive Files
Prefilter
(Load)
On GPU
34
![Page 35: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/35.jpg)
Data Feeding
35
ALU
ALU
ALU
ALUControl
DRAM (12G)
Cache
DRAM (256G) PCIe
16GB/s549GB/s
59GB/s
CPU GPU
![Page 36: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/36.jpg)
Data FeedingPartitioned Data
2017-11-13 2017-11-12 2017-09-13
Archive Batches
36
Live Batches
![Page 37: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/37.jpg)
Data Feeding
37
0
1
5
12
city_id
0
0
1
0
status
0
One to Many
0
10
20
30
20
10
40
30
vvid
One to Many
0
1
1
1
1
1
1
1
fare
One to Many
Sort Columns
city_id = 1 status = 0 vvid >= 20
Matched Prefilters
Prefilter
![Page 38: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/38.jpg)
Data Feeding
38
Stream 0
Stream 1
Batch 0 Batch 0
Batch 1 Batch 1
Batch 2 Batch 2 Batch 4 Batch 4
Batch 3 Batch 3 Batch 5
Copy data from host to device
Query execution
Pipelining
![Page 39: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/39.jpg)
Query Execution
Execution Stages
FiltersEvaluation
Dimension Expressions Evaluation
Measure Expressions Evaluation
Sort Reduction
39
![Page 40: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/40.jpg)
Query Execution
40
● One operator per kernel on non-leaf nodes
● Each leaf node is one of○ column/constant
● Non-root, non-leaf node○ kernel launch○ output to intermediate
buffer● Root node
○ Kernel launch○ Write to output buffer
● E.g., request_at - request_at % 86400
request_atUint32
86400Uint32
%Uint32
request_atUint32
MinusUint32
Column
Column
constant
Intermediate buffer
output buffer
Kernel launch 1
Kernel launch 2
Expression Evaluation
![Page 41: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/41.jpg)
Query Execution
41
Unsorted
Expression Evaluation Output
Result from previous batches
DimensionVector
MeasureVector
Sort by dimensions
Reduce bydimensions
Final results
Aggregation (Sort and Reduction)
![Page 42: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/42.jpg)
Device Resource Management
Query 1
GPU1 GPU2 GPU3 GPU4
Query 2
Query 3
Query 4 Query 5
Query 6 Resource Estimation
Query 6
42
![Page 43: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/43.jpg)
Feature Highlights
43
● In-Memory Columnar Storage● Real-time upserts with deduplication● GPU powered query engine● Feature set for analytical queries
○ Time zone, Time Filter, Time Bucketization○ Fact/dimension table joins○ Geospatial analytics○ Hyperloglog
![Page 44: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/44.jpg)
{ "table": "driver_info", "measures": [ { "sqlExpression": "count(*)" } ], "dimensions": [ { "alias": "ts", "sqlExpression": "first_active_at", "timeBucketizer": "day" }, { "sqlExpression": "flow_type" } ], "timeFilter": { "column": "first_active_at", "from": "7 days ago" }, "timezone": "America/Los_Angeles"}
44
Timezone, Time Filter, Time BucketizationSELECT Count(*), Unix_timestamp(Convert_tz(Concat(Date_format(Convert_tz(From_unixtime(((driver_info .first_active_at) -(driver_info .first_active_at) % 900000) / 1000),'GMT', 'America/Los_Angeles' ),'%Y-%m-%d %H:'), Lpad(15*Floor(Minute(Convert_tz(From_unixtime(((driver_info.first_active_at) -(driver_info .first_active_at) %900000)/1000),'GMT','America/Los_Angeles' ))/15),2,'0')),'America/Los_Angeles' ,'UTC')) AS time_dimension , driver_info .flow_typeFROM driver_infoWHERE driver_info .first_active_at >= 1534810500000 AND driver_info .first_active_at < 1534813200000 GROUP BY 2,3
V.S.
![Page 45: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/45.jpg)
Analytical Query Features
45
● Fact/Dimension Table Join○ E.g. trips.city_id = cities.id
● Hyperloglog Cardinality Estimation○ countDistinctHLL(driver_id)○ Dedicated hll column
● Geospatial analytics○ GeoPoint, GeoShape○ GeoIntersect(point, shape)
![Page 46: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/46.jpg)
46
Learnings from GPU Programming
![Page 47: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/47.jpg)
Learnings from GPU Programming
● Maximize parallelism● Optimize memory access● Maximize arithmetic intensity● Reduce data transfer between GPU/CPU● Profile, profile, profile
47
![Page 48: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/48.jpg)
Maximize Parallelism
48
● Partition your computation to keep the GPU multiprocessors equally busy
○ Many threads, many thread blocks○ E.g. Inclusion test for a point and polygons
■ One shape per thread vs one edge per thread
● Keep resource usage low enough to maximize occupancy
○ Register, shared memory○ Careful design of data structure
■ Use less wide data type● Int64 -> uint32
■ Reuse memory space● Union
■ Passing offsets instead of pointers
![Page 49: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/49.jpg)
Optimize Memory Access
49
● Coalesced vs. non-coalesced = order of magnitude Global/Local device memory
● Shared memory● Constant memory
http://developer.download.nvidia.com/CUDA/training/NVIDIA_GPU_Computing_Webinars_CUDA_Optimization_April-2009.pdf retrived date: 01/10/2019
![Page 50: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/50.jpg)
Maximize Arithmetic Intensity
50
● GPU spends its transistors on ALUs, not memory● Sometimes it’s better to recompute than to cache● Do more computation on GPU instead of transferring back to CPU
![Page 51: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/51.jpg)
Minimize CPU/GPU Transfers
51
● Group transfers ● Overlapping data transfers and computation
○ Async and stream api○ Stream = sequence of operations that execute in order on GPU○ Pipeline execution
● Pinned memory vs. pageable memory
![Page 52: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/52.jpg)
Profiling GPU Program NVVP
52
● Nvidia visual profiler● Unified CPU/GPU timeline● Automated performance analysis● Guided application analysis
![Page 53: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/53.jpg)
NVVP cont’d
53[1]
![Page 54: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/54.jpg)
Future Directions
● Beyond single instance○ Sharding○ Replication
● Ease of adoption○ SQL interface○ Native Kafka support
● More query features (eg. fact to fact table joins)● Query engine optimizations (eg. GPU memory caching)● Grow AresDB together with the community
54
![Page 55: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/55.jpg)
Questions ?
Tech blog: https://eng.uber.com/aresdb/
Git repo: https://github.com/uber/aresdb
55
Questions: email [email protected] our Facebook page: www.facebook.com/uberopensource
![Page 56: A GPU-Powered Real-time Analytics Engine · A GPU-Powered Real-time Analytics Engine. Agenda ... Learnings From GPU Programming Future Directions 2. Real-time analytics at Uber 3](https://reader034.vdocuments.us/reader034/viewer/2022042219/5ec5cf7e4a29781b3c1abd80/html5/thumbnails/56.jpg)
Thank you
Proprietary © 2018 Uber Technologies, Inc. All rights reserved. No part of this document may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use of the individual or entity to whom it is addressed. All recipients of this document are notified that the information contained herein includes proprietary information of Uber, and recipient may not make use of, disseminate, or in any way disclose this document or any of the enclosed information to any person other than employees of addressee to the extent necessary for consultations with authorized personnel of Uber.
Questions: email [email protected]
Follow our Facebook page: www.facebook.com/uberopensource