SlideShare a Scribd company logo
1 of 28
Download to read offline
Make AI ecosystem
more interoperable
Kazuaki Ishizaki
IBM Research - Tokyo
About Me – Kazuaki Ishizaki
▪ Researcher at IBM Research – Tokyo
https://ibm.biz/ishizaki
– Compiler optimization, language runtime, and parallel processing
▪ Apache Spark committer from 2018/9 (SQL module)
▪ Work for IBM Java (Open J9, now) from 1996
– Technical lead for Just-in-time compiler for PowerPC
▪ ACM Distinguished Member
▪ SNS
– @kiszk
– https://www.slideshare.net/ishizaki/
2 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Agenda
▪ Motivation
▪ What is an inhibitor of interoperability?
– Endianness on each machine
▪ What is endian?
▪ What happens in a program?
▪ How to find and fix issues?
▪ How to keep interoperability in AI ecosystem
3 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Very Impressive Performance Improvement on x86
▪ Improve performance of Spark with Python by over 100x
4 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Source: https://databricks.com/blog/2017/10/30/introducing-vectorized-udfs-for-pyspark.html
Apache Spark uses
Apache Arrow
A cross-language
development platform
for in-memory analytics
I Want to Do This on IBM Z
5 Make AI ecosystem more interoperable - Kazuaki Ishizaki
$ bin/pyspark
...
>>> df.show()
Oh!!!
6 Make AI ecosystem more interoperable - Kazuaki Ishizaki
$ bin/pyspark
...
>>> df.show()
...
java.lang.IllegalStateException: Arrow only runs on LittleEndian systems…
...
>>>
Apache Arrow supported only Little Endian
7 Make AI ecosystem more interoperable - Kazuaki Ishizaki
$ bin/pyspark
...
>>> df.show()
...
java.lang.IllegalStateException: Arrow only runs on LittleEndian systems…
...
>>>
One Pager for Current AI Ecosystem
▪ Data can be exchanged among little endian machines (i.e. x86, Arm,
PowerLinux, …)
8 Make AI ecosystem more interoperable - Kazuaki Ishizaki
PowerLinux
Arm Origin: https://www.dremio.com/webinars/apache-arrow-in-theory-practice/
One Pager for Expected AI Ecosystem
▪ Data can be exchanged among both endian machines (i.e. x86, Arm, s390x,
PowerLinux, …)
9 Make AI ecosystem more interoperable - Kazuaki Ishizaki
PowerLinux
Arm
s390x
Origin: https://www.dremio.com/webinars/apache-arrow-in-theory-practice/
What is Endian?
▪ Data layout on a memory
– Example of integer 32bit value
10 Make AI ecosystem more interoperable - Kazuaki Ishizaki
0x01020304
What is Endian?
▪ Data layout on a memory
– Example of integer 32bit value
11 Make AI ecosystem more interoperable - Kazuaki Ishizaki
04
memory layout
Little endian
03
0x01020304
02 01
10
addr 11 12 13
x86_64, ppc64le, …
What is Endian?
▪ Data layout on a memory
– Example of integer 32bit value
12 Make AI ecosystem more interoperable - Kazuaki Ishizaki
04
memory layout
Little endian Big endian
03
0x01020304
02 01 01 02 03 04
memory layout
10
addr 11 12 13 10
addr 11 12 13
x86_64, ppc64le, … s390x
Why Programs Usually Work Well?
▪ Programs work well without special cares if
– No explicit memory access of a subset of data and/or of a super-set of data
– A program is closed itself (no data exchange with other machines)
13 Make AI ecosystem more interoperable - Kazuaki Ishizaki
int32_t a, b;
int16_t d;
...
int32_t c = a + b;
int16_t d = static_cast<int16_t>(c) + 1;
int32_t e = static_cast<int32_t>(d);
...
How to Find Issues on Different Endians?
▪ Find bad smells in source code
14 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Does It Have Bad Smell?
▪ Get 32-bit data from int8 datum by reinterpret_cast
15 Make AI ecosystem more interoperable - Kazuaki Ishizaki
uint8_t *i8p = ...
i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 3;
int32_t i32 = *reinterpret_cast<int32_t *>(i8p);
printf(“%08x”, i32);
Results are Different on Different Endian Machines
16 Make AI ecosystem more interoperable - Kazuaki Ishizaki
uint8_t *i8p = ...
i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 3;
int32_t i32 = *reinterpret_cast<int32_t *>(i8p);
printf(“%08x”, i32);
Little endian Big endian
01020304 04030201
Why Problem Occurs?
▪ Different endian processors interpret the same memory sequence in
different ways
17 Make AI ecosystem more interoperable - Kazuaki Ishizaki
04 03 02 01
04 03 02 01
memory layout
memory layout
04030201
01020304
uint8_t *i8p = ...
i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 1;
int32_t i32 = *reinterpret_cast<int32_t *>(i8p);
printf(“%08x”, i32);
Little endian Big endian
i8p i8p
Support Both Endians
▪ Swap data for big endian
18 Make AI ecosystem more interoperable - Kazuaki Ishizaki
uint8_t *i8p = ...;
i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 1;
int32_t i32 = reinterpret_cast<int32_t *>(i8p);
#if !defined(__LITTLE_ENDIAN__)
i32 = __builtin_bswap32(i32);
#endif
printf(“%08x”, i32);
Little endian Big endian
01020304 01020304
Support Both Endians in Java
▪ Swap data for big endian
19 Make AI ecosystem more interoperable - Kazuaki Ishizaki
static final boolean LITTLE_ENDIAN =
ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;
int i32 = ... // get the value from a buffer
if (!LITTLE_ENDIAN) {
i32 = Integer.reverseBytes(i32);
}
Potential Bad Smell and Enhancements
▪ Intra-process (i.e. In-memory)
– Get data from the different data type
20 Make AI ecosystem more interoperable - Kazuaki Ishizaki
04 03 02 01
04 03 02 01
memory layout
memory layout
01020304
01020304 Swap
Potential Bad Smell and Enhancements
▪ Intra-process (i.e. In-memory)
– Get data from memory in different data type
▪ Inter-process (i.e. host – client)
– Exchange data with other machines
21 Make AI ecosystem more interoperable - Kazuaki Ishizaki
01 02 03 04
04 03 02 01
04 03 02 01
memory layout
memory layout
memory layout
04 03 02 01
memory layout
01020304
01020304
Swap
01020304
Swap
Can We Find All Issues?
▪ Find bad smells in source code
22 Make AI ecosystem more interoperable - Kazuaki Ishizaki
New code is coming everyday
Automatically Detect Issues
▪ Continuously run test cases on machines with different endians
23 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Run test cases
Automatically Detect Issues
▪ Continuously run test cases on machines with different endians
▪ Enhance code to support both endians if we find issues
24 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Run test cases Enhance code
CI Tools and Instances Help OSS Community
▪ TravisCI
▪ Jenkins
▪ Virtual machine instance
25 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Enhance code
Free Resources of Big Endian for OSS Community
▪ TravisCI
– https://docs.travis-ci.com/user/multi-cpu-architectures/
▪ Jenkins
– https://osuosl.org/services/ibm-z/
▪ Virtual machine instance
– https://developer.ibm.com/components/ibm-linuxone/gettingstarted/
26 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Apache Arrow Supports Both Endians
▪ Intra-process (from Apache Arrow 3.0)
– C and Java bindings
▪ Inter-process (from Apache Arrow 4.0)
– C bindings
27 Make AI ecosystem more interoperable - Kazuaki Ishizaki
CI on big ending is running for every PR update
Takeaway
▪ We know different endians on machines
– Little endian and big endian
▪ When do we take care of endians?
– Get a sub-set or super-set of data in memory
– Exchange data with other machines
▪ How to find potential issues and support both endians?
– Find bad smell
– Automatically run test cases
▪ How to keep interoperability in AI ecosystem?
– Easy and free to run CI on different types of machines
28 Make AI ecosystem more interoperable - Kazuaki Ishizaki
Visit https://www.slideshare.net/ishizaki if you are interested in this slide

More Related Content

What's hot

From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
Databricks
 

What's hot (20)

Deep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache SparkDeep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache Spark
 
Project Tungsten: Bringing Spark Closer to Bare Metal
Project Tungsten: Bringing Spark Closer to Bare MetalProject Tungsten: Bringing Spark Closer to Bare Metal
Project Tungsten: Bringing Spark Closer to Bare Metal
 
Getting The Best Performance With PySpark
Getting The Best Performance With PySparkGetting The Best Performance With PySpark
Getting The Best Performance With PySpark
 
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
 
Memory Management in Apache Spark
Memory Management in Apache SparkMemory Management in Apache Spark
Memory Management in Apache Spark
 
Intro to PySpark: Python Data Analysis at scale in the Cloud
Intro to PySpark: Python Data Analysis at scale in the CloudIntro to PySpark: Python Data Analysis at scale in the Cloud
Intro to PySpark: Python Data Analysis at scale in the Cloud
 
Apache Spark Core – Practical Optimization
Apache Spark Core – Practical OptimizationApache Spark Core – Practical Optimization
Apache Spark Core – Practical Optimization
 
London Spark Meetup Project Tungsten Oct 12 2015
London Spark Meetup Project Tungsten Oct 12 2015London Spark Meetup Project Tungsten Oct 12 2015
London Spark Meetup Project Tungsten Oct 12 2015
 
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran LonikarExploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
 
Elasticsearch And Apache Lucene For Apache Spark And MLlib
Elasticsearch And Apache Lucene For Apache Spark And MLlibElasticsearch And Apache Lucene For Apache Spark And MLlib
Elasticsearch And Apache Lucene For Apache Spark And MLlib
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted Malaska
 
Scalable Machine Learning with PySpark
Scalable Machine Learning with PySparkScalable Machine Learning with PySpark
Scalable Machine Learning with PySpark
 
Advanced Apache Spark Meetup: How Spark Beat Hadoop @ 100 TB Daytona GraySor...
Advanced Apache Spark Meetup:  How Spark Beat Hadoop @ 100 TB Daytona GraySor...Advanced Apache Spark Meetup:  How Spark Beat Hadoop @ 100 TB Daytona GraySor...
Advanced Apache Spark Meetup: How Spark Beat Hadoop @ 100 TB Daytona GraySor...
 
Combining Machine Learning Frameworks with Apache Spark
Combining Machine Learning Frameworks with Apache SparkCombining Machine Learning Frameworks with Apache Spark
Combining Machine Learning Frameworks with Apache Spark
 
Data stax academy
Data stax academyData stax academy
Data stax academy
 
Structured Streaming for Columnar Data Warehouses with Jack Gudenkauf
Structured Streaming for Columnar Data Warehouses with Jack GudenkaufStructured Streaming for Columnar Data Warehouses with Jack Gudenkauf
Structured Streaming for Columnar Data Warehouses with Jack Gudenkauf
 
Frustration-Reduced PySpark: Data engineering with DataFrames
Frustration-Reduced PySpark: Data engineering with DataFramesFrustration-Reduced PySpark: Data engineering with DataFrames
Frustration-Reduced PySpark: Data engineering with DataFrames
 
Spark performance tuning - Maksud Ibrahimov
Spark performance tuning - Maksud IbrahimovSpark performance tuning - Maksud Ibrahimov
Spark performance tuning - Maksud Ibrahimov
 
PySpark in practice slides
PySpark in practice slidesPySpark in practice slides
PySpark in practice slides
 
Automated Spark Deployment With Declarative Infrastructure
Automated Spark Deployment With Declarative InfrastructureAutomated Spark Deployment With Declarative Infrastructure
Automated Spark Deployment With Declarative Infrastructure
 

Similar to Make AI ecosystem more interoperable

Alto Desempenho com Java
Alto Desempenho com JavaAlto Desempenho com Java
Alto Desempenho com Java
codebits
 

Similar to Make AI ecosystem more interoperable (20)

Exadata architecture and internals presentation
Exadata architecture and internals presentationExadata architecture and internals presentation
Exadata architecture and internals presentation
 
digitaldesign-s20-lecture3b-fpga-afterlecture.pdf
digitaldesign-s20-lecture3b-fpga-afterlecture.pdfdigitaldesign-s20-lecture3b-fpga-afterlecture.pdf
digitaldesign-s20-lecture3b-fpga-afterlecture.pdf
 
Blades for HPTC
Blades for HPTCBlades for HPTC
Blades for HPTC
 
“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core
 
Azure Kubernetes Service - benefits and challenges
Azure Kubernetes Service - benefits and challengesAzure Kubernetes Service - benefits and challenges
Azure Kubernetes Service - benefits and challenges
 
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...
 
Data Engineer's Lunch 90: Migrating SQL Data with Arcion
Data Engineer's Lunch 90: Migrating SQL Data with ArcionData Engineer's Lunch 90: Migrating SQL Data with Arcion
Data Engineer's Lunch 90: Migrating SQL Data with Arcion
 
Transparent GPU Exploitation for Java
Transparent GPU Exploitation for JavaTransparent GPU Exploitation for Java
Transparent GPU Exploitation for Java
 
Big Data and OpenStack, a Love Story: Michael Still, Rackspace
Big Data and OpenStack, a Love Story: Michael Still, RackspaceBig Data and OpenStack, a Love Story: Michael Still, Rackspace
Big Data and OpenStack, a Love Story: Michael Still, Rackspace
 
Alto Desempenho com Java
Alto Desempenho com JavaAlto Desempenho com Java
Alto Desempenho com Java
 
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache SparkAn Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
 
MySQL Performance Tuning 101 (Bahasa)
MySQL Performance Tuning 101 (Bahasa)MySQL Performance Tuning 101 (Bahasa)
MySQL Performance Tuning 101 (Bahasa)
 
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
 
Design for X: Exploring Product Design with Apache Spark and GraphLab
Design for X: Exploring Product Design with Apache Spark and GraphLabDesign for X: Exploring Product Design with Apache Spark and GraphLab
Design for X: Exploring Product Design with Apache Spark and GraphLab
 
Resilience: the key requirement of a [big] [data] architecture - StampedeCon...
Resilience: the key requirement of a [big] [data] architecture  - StampedeCon...Resilience: the key requirement of a [big] [data] architecture  - StampedeCon...
Resilience: the key requirement of a [big] [data] architecture - StampedeCon...
 
Streaming solutions for real time problems
Streaming solutions for real time problems Streaming solutions for real time problems
Streaming solutions for real time problems
 
How to deploy & optimize eZ Publish
How to deploy & optimize eZ PublishHow to deploy & optimize eZ Publish
How to deploy & optimize eZ Publish
 
20190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev220190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev2
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teams
 
How to Optimize Hortonworks Apache Spark ML Workloads on Modern Processors
How to Optimize Hortonworks Apache Spark ML Workloads on Modern Processors How to Optimize Hortonworks Apache Spark ML Workloads on Modern Processors
How to Optimize Hortonworks Apache Spark ML Workloads on Modern Processors
 

More from Kazuaki Ishizaki

20141224 titech lecture_ishizaki_public
20141224 titech lecture_ishizaki_public20141224 titech lecture_ishizaki_public
20141224 titech lecture_ishizaki_public
Kazuaki Ishizaki
 

More from Kazuaki Ishizaki (17)

20230105_TITECH_lecture_ishizaki_public.pdf
20230105_TITECH_lecture_ishizaki_public.pdf20230105_TITECH_lecture_ishizaki_public.pdf
20230105_TITECH_lecture_ishizaki_public.pdf
 
20221226_TITECH_lecture_ishizaki_public.pdf
20221226_TITECH_lecture_ishizaki_public.pdf20221226_TITECH_lecture_ishizaki_public.pdf
20221226_TITECH_lecture_ishizaki_public.pdf
 
Introduction new features in Spark 3.0
Introduction new features in Spark 3.0Introduction new features in Spark 3.0
Introduction new features in Spark 3.0
 
SparkTokyo2019NovIshizaki
SparkTokyo2019NovIshizakiSparkTokyo2019NovIshizaki
SparkTokyo2019NovIshizaki
 
hscj2019_ishizaki_public
hscj2019_ishizaki_publichscj2019_ishizaki_public
hscj2019_ishizaki_public
 
20180109 titech lecture_ishizaki_public
20180109 titech lecture_ishizaki_public20180109 titech lecture_ishizaki_public
20180109 titech lecture_ishizaki_public
 
20171212 titech lecture_ishizaki_public
20171212 titech lecture_ishizaki_public20171212 titech lecture_ishizaki_public
20171212 titech lecture_ishizaki_public
 
Demystifying DataFrame and Dataset
Demystifying DataFrame and DatasetDemystifying DataFrame and Dataset
Demystifying DataFrame and Dataset
 
Making Hardware Accelerator Easier to Use
Making Hardware Accelerator Easier to UseMaking Hardware Accelerator Easier to Use
Making Hardware Accelerator Easier to Use
 
20160906 pplss ishizaki public
20160906 pplss ishizaki public20160906 pplss ishizaki public
20160906 pplss ishizaki public
 
Exploiting GPUs in Spark
Exploiting GPUs in SparkExploiting GPUs in Spark
Exploiting GPUs in Spark
 
Easy and High Performance GPU Programming for Java Programmers
Easy and High Performance GPU Programming for Java ProgrammersEasy and High Performance GPU Programming for Java Programmers
Easy and High Performance GPU Programming for Java Programmers
 
Exploiting GPUs in Spark
Exploiting GPUs in SparkExploiting GPUs in Spark
Exploiting GPUs in Spark
 
20151112 kutech lecture_ishizaki_public
20151112 kutech lecture_ishizaki_public20151112 kutech lecture_ishizaki_public
20151112 kutech lecture_ishizaki_public
 
20141224 titech lecture_ishizaki_public
20141224 titech lecture_ishizaki_public20141224 titech lecture_ishizaki_public
20141224 titech lecture_ishizaki_public
 
Java Just-In-Timeコンパイラ
Java Just-In-TimeコンパイラJava Just-In-Timeコンパイラ
Java Just-In-Timeコンパイラ
 
静的型付き言語用Just-In-Timeコンパイラの再利用による、動的型付き言語用コンパイラの実装と最適化
静的型付き言語用Just-In-Timeコンパイラの再利用による、動的型付き言語用コンパイラの実装と最適化静的型付き言語用Just-In-Timeコンパイラの再利用による、動的型付き言語用コンパイラの実装と最適化
静的型付き言語用Just-In-Timeコンパイラの再利用による、動的型付き言語用コンパイラの実装と最適化
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 

Make AI ecosystem more interoperable

  • 1. Make AI ecosystem more interoperable Kazuaki Ishizaki IBM Research - Tokyo
  • 2. About Me – Kazuaki Ishizaki ▪ Researcher at IBM Research – Tokyo https://ibm.biz/ishizaki – Compiler optimization, language runtime, and parallel processing ▪ Apache Spark committer from 2018/9 (SQL module) ▪ Work for IBM Java (Open J9, now) from 1996 – Technical lead for Just-in-time compiler for PowerPC ▪ ACM Distinguished Member ▪ SNS – @kiszk – https://www.slideshare.net/ishizaki/ 2 Make AI ecosystem more interoperable - Kazuaki Ishizaki
  • 3. Agenda ▪ Motivation ▪ What is an inhibitor of interoperability? – Endianness on each machine ▪ What is endian? ▪ What happens in a program? ▪ How to find and fix issues? ▪ How to keep interoperability in AI ecosystem 3 Make AI ecosystem more interoperable - Kazuaki Ishizaki
  • 4. Very Impressive Performance Improvement on x86 ▪ Improve performance of Spark with Python by over 100x 4 Make AI ecosystem more interoperable - Kazuaki Ishizaki Source: https://databricks.com/blog/2017/10/30/introducing-vectorized-udfs-for-pyspark.html Apache Spark uses Apache Arrow A cross-language development platform for in-memory analytics
  • 5. I Want to Do This on IBM Z 5 Make AI ecosystem more interoperable - Kazuaki Ishizaki $ bin/pyspark ... >>> df.show()
  • 6. Oh!!! 6 Make AI ecosystem more interoperable - Kazuaki Ishizaki $ bin/pyspark ... >>> df.show() ... java.lang.IllegalStateException: Arrow only runs on LittleEndian systems… ... >>>
  • 7. Apache Arrow supported only Little Endian 7 Make AI ecosystem more interoperable - Kazuaki Ishizaki $ bin/pyspark ... >>> df.show() ... java.lang.IllegalStateException: Arrow only runs on LittleEndian systems… ... >>>
  • 8. One Pager for Current AI Ecosystem ▪ Data can be exchanged among little endian machines (i.e. x86, Arm, PowerLinux, …) 8 Make AI ecosystem more interoperable - Kazuaki Ishizaki PowerLinux Arm Origin: https://www.dremio.com/webinars/apache-arrow-in-theory-practice/
  • 9. One Pager for Expected AI Ecosystem ▪ Data can be exchanged among both endian machines (i.e. x86, Arm, s390x, PowerLinux, …) 9 Make AI ecosystem more interoperable - Kazuaki Ishizaki PowerLinux Arm s390x Origin: https://www.dremio.com/webinars/apache-arrow-in-theory-practice/
  • 10. What is Endian? ▪ Data layout on a memory – Example of integer 32bit value 10 Make AI ecosystem more interoperable - Kazuaki Ishizaki 0x01020304
  • 11. What is Endian? ▪ Data layout on a memory – Example of integer 32bit value 11 Make AI ecosystem more interoperable - Kazuaki Ishizaki 04 memory layout Little endian 03 0x01020304 02 01 10 addr 11 12 13 x86_64, ppc64le, …
  • 12. What is Endian? ▪ Data layout on a memory – Example of integer 32bit value 12 Make AI ecosystem more interoperable - Kazuaki Ishizaki 04 memory layout Little endian Big endian 03 0x01020304 02 01 01 02 03 04 memory layout 10 addr 11 12 13 10 addr 11 12 13 x86_64, ppc64le, … s390x
  • 13. Why Programs Usually Work Well? ▪ Programs work well without special cares if – No explicit memory access of a subset of data and/or of a super-set of data – A program is closed itself (no data exchange with other machines) 13 Make AI ecosystem more interoperable - Kazuaki Ishizaki int32_t a, b; int16_t d; ... int32_t c = a + b; int16_t d = static_cast<int16_t>(c) + 1; int32_t e = static_cast<int32_t>(d); ...
  • 14. How to Find Issues on Different Endians? ▪ Find bad smells in source code 14 Make AI ecosystem more interoperable - Kazuaki Ishizaki
  • 15. Does It Have Bad Smell? ▪ Get 32-bit data from int8 datum by reinterpret_cast 15 Make AI ecosystem more interoperable - Kazuaki Ishizaki uint8_t *i8p = ... i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 3; int32_t i32 = *reinterpret_cast<int32_t *>(i8p); printf(“%08x”, i32);
  • 16. Results are Different on Different Endian Machines 16 Make AI ecosystem more interoperable - Kazuaki Ishizaki uint8_t *i8p = ... i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 3; int32_t i32 = *reinterpret_cast<int32_t *>(i8p); printf(“%08x”, i32); Little endian Big endian 01020304 04030201
  • 17. Why Problem Occurs? ▪ Different endian processors interpret the same memory sequence in different ways 17 Make AI ecosystem more interoperable - Kazuaki Ishizaki 04 03 02 01 04 03 02 01 memory layout memory layout 04030201 01020304 uint8_t *i8p = ... i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 1; int32_t i32 = *reinterpret_cast<int32_t *>(i8p); printf(“%08x”, i32); Little endian Big endian i8p i8p
  • 18. Support Both Endians ▪ Swap data for big endian 18 Make AI ecosystem more interoperable - Kazuaki Ishizaki uint8_t *i8p = ...; i8p[0] = 4; i8p[1] = 3; i8p[2] = 2; i8p[3] = 1; int32_t i32 = reinterpret_cast<int32_t *>(i8p); #if !defined(__LITTLE_ENDIAN__) i32 = __builtin_bswap32(i32); #endif printf(“%08x”, i32); Little endian Big endian 01020304 01020304
  • 19. Support Both Endians in Java ▪ Swap data for big endian 19 Make AI ecosystem more interoperable - Kazuaki Ishizaki static final boolean LITTLE_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN; int i32 = ... // get the value from a buffer if (!LITTLE_ENDIAN) { i32 = Integer.reverseBytes(i32); }
  • 20. Potential Bad Smell and Enhancements ▪ Intra-process (i.e. In-memory) – Get data from the different data type 20 Make AI ecosystem more interoperable - Kazuaki Ishizaki 04 03 02 01 04 03 02 01 memory layout memory layout 01020304 01020304 Swap
  • 21. Potential Bad Smell and Enhancements ▪ Intra-process (i.e. In-memory) – Get data from memory in different data type ▪ Inter-process (i.e. host – client) – Exchange data with other machines 21 Make AI ecosystem more interoperable - Kazuaki Ishizaki 01 02 03 04 04 03 02 01 04 03 02 01 memory layout memory layout memory layout 04 03 02 01 memory layout 01020304 01020304 Swap 01020304 Swap
  • 22. Can We Find All Issues? ▪ Find bad smells in source code 22 Make AI ecosystem more interoperable - Kazuaki Ishizaki New code is coming everyday
  • 23. Automatically Detect Issues ▪ Continuously run test cases on machines with different endians 23 Make AI ecosystem more interoperable - Kazuaki Ishizaki Run test cases
  • 24. Automatically Detect Issues ▪ Continuously run test cases on machines with different endians ▪ Enhance code to support both endians if we find issues 24 Make AI ecosystem more interoperable - Kazuaki Ishizaki Run test cases Enhance code
  • 25. CI Tools and Instances Help OSS Community ▪ TravisCI ▪ Jenkins ▪ Virtual machine instance 25 Make AI ecosystem more interoperable - Kazuaki Ishizaki Enhance code
  • 26. Free Resources of Big Endian for OSS Community ▪ TravisCI – https://docs.travis-ci.com/user/multi-cpu-architectures/ ▪ Jenkins – https://osuosl.org/services/ibm-z/ ▪ Virtual machine instance – https://developer.ibm.com/components/ibm-linuxone/gettingstarted/ 26 Make AI ecosystem more interoperable - Kazuaki Ishizaki
  • 27. Apache Arrow Supports Both Endians ▪ Intra-process (from Apache Arrow 3.0) – C and Java bindings ▪ Inter-process (from Apache Arrow 4.0) – C bindings 27 Make AI ecosystem more interoperable - Kazuaki Ishizaki CI on big ending is running for every PR update
  • 28. Takeaway ▪ We know different endians on machines – Little endian and big endian ▪ When do we take care of endians? – Get a sub-set or super-set of data in memory – Exchange data with other machines ▪ How to find potential issues and support both endians? – Find bad smell – Automatically run test cases ▪ How to keep interoperability in AI ecosystem? – Easy and free to run CI on different types of machines 28 Make AI ecosystem more interoperable - Kazuaki Ishizaki Visit https://www.slideshare.net/ishizaki if you are interested in this slide