SlideShare a Scribd company logo
1 of 54
Download to read offline
A Pattern System forA Pattern System for
Enumeration ProcessingEnumeration Processing
Expression and ParallelisationExpression and Parallelisation
Jean-Lin Pacherie
ContentsContents
• Introduction
• Conclusion
• Design Model for Processing
• Pattern System
• Impact of the Data Driven Distribution (DDD)
• Services for Data Parallelism
IntroductionIntroduction
Motivations
Pattern and Parallelism
Ideas and Thesis
IntroductionIntroduction
Design Model for Processing
Pattern System
Impact of the DDD
Fundamental Services for Data Parallelism
Conclusion
MotivationsMotivations
Parallel Programming, Why?
Decrease computation duration
Increase data size
Deriving sequential applications (DDD)
MotivationsMotivations
Parallel Programming, Why?
Parallel Programming, How?
Direct parallel programming
MotivationsMotivations
Parallel Programming, Why?
The solution should conforms
with usual programming
environment
Constraints for the solution
Standard compilation tools
No language extensions
Parallel Programming, How?
MotivationsMotivations
Parallel Programming, Why?
Constraints for the solution
Parallel Programming, How?
Available tools
Abstraction
Encapsulation
Polymorphism
Software architecture with Patterns
MotivationsMotivations
Parallel Programming, Why?
Constraints for the solution
Parallel Programming, How?
Available tools
Evolution
Encapsulating parallelism in a sequential OOL [ Jézéquel 91 ]
Method & Framework PALADIN [ Guidec 95 ]
Reusable expression of methods [ Pacherie 97 ]
RequirementsRequirements
Experts and Reusability
Beyond the software component reusability : Pattern
Where is expressed the knowledge in an application?
What kind of tools for reusability?
Library
OO Library
Component
Design
Framework
Framework
Method
Pattern
Pattern Language
Architecture
Knowledge and ReusabilityKnowledge and Reusability
Evolution
Reusability level
RequirementsRequirements
Knowledge and Reusability
Beyond the software components reusability
Pattern
[ Gamma 94 ]
Express architecture to parallelize
Express common architecture involved
in parallel mechanism
RequirementRequirement
Knowledge and Reusability
Data Parallelism
Context : Data collection processing
1) Cut-out
From iteration start until iteration end loop
action ( current item )
next iteration
end
Collection :
Aggregation of
homogeneous items
RequirementsRequirements
Knowledge and Reusability
Data Parallelism
Increasing Data
size
Decreasing computation
duration
1) Cut out
2) Layout
3) // Processing
RequirementsRequirements
Knowledge and Reusability
Data Parallelism
Data Driven Distribution
Parallel Code
Collection
Sequential Code
?
Code Proc 2Code Proc 2
Code Proc 1Code Proc 1
Code Proc 3Code Proc 3
Data Layout
Owner Compute rule
Remote Data Refreshing
SPMD
Principles
ThesisThesis
Design patterns for data parallelism
programming
Identify and organize the design pattern dedicated
to data collection processing
Apply the DDD mechanism to these patterns:
Parallelization at the software architecture level
Use the design patterns of serialUse the design patterns of serial
applications to introduce parallelismapplications to introduce parallelism
Design Model for EnumerationDesign Model for Enumeration
ProcessingProcessing
Operator Design Pattern
Consequences
Introduction
Design Model for ProcessingDesign Model for Processing
Pattern System
Impact of the DDD
Fundamental Services for Data Parallelism
Conclusion
Towards a pattern...Towards a pattern...
Description of behavior
Behavior vs.. Implementation
Instaciation delegation trough the Factory Method pattern
AbstractClient
FactoryMethod : AbstractProduct
AnOperation
AbstractProduct
Service
…
product := FactoryMethod
product.service
...
ConcreteClient
FactoryMethod :
ConcreteProduct
ConcreteProduct
Servic
e
!ConcreteProduct!Result
AbstractSolver
make_matrix : Matrix
solve
Matrix
Item
ConcreteSolver
make_matrix : SparseMatrix
SparseMatrix
Item
Towards a pattern...Towards a pattern...
Description of behavior
Behavior vs. Implementation
Instaciation delegation trough the Factory Method pattern
Factory Pattern
Extracting iteration domain through the Iterator pattern
ArrayIteratorArray
ConcreteClient
Independence from data structures
AbstractClient
Collection Iterator
collection := make_collection
iteration := collection.make_iterator
from iteration.start until iteration.exhausted loop
…
iteration.next
end
Towards a pattern...Towards a pattern...
Description of behavior
AbstractClient
Collection Iterator
ArrayIteratorArray
ConcreteClient
Extracting iteration domain through the Iterator pattern
Independence from data structures
Towards a pattern...Towards a pattern...
Description of behavior
Factory Pattern
Extracting control structure
AbstractClient
Collection Operator
collection := make_collection
iteration := collection.make_iterator
from iteration.start until iteration.exhausted loop
…
iteration.next
end
Iterator
Extracting iteration domain through the Iterator pattern
Towards a pattern...Towards a pattern...
Description of behavior
AbstractClient
Collection Operator
collection := make_collection
iteration := collection.make_iterator
operator.attach(iteration)
operator.run
Iterator Operator
Extracting control structure
Extracting iteration domain through the Iterator pattern
Towards a pattern...Towards a pattern...
Description of behavior
ConsequencesConsequences
Separation of the responsibilities
Collection, Iterator and Operators
The modularity encourage reusability [Meyer 97]
Redefining implementation
Using the factory method pattern
Data Collections
Processing operators
Iteration domains
Client Product
Application Collection
Operator
IteratorCollection
Application
ConsequencesConsequences
Separation of the responsibilities
Processing ???!!
ProcessingProcessing
StructuralStructural OperatorOperator
CommandCommand RequestRequest
EnumerativeEnumerative AtomicAtomic
Collections Enumerations
No results With results
List of items One item
Redefining implementation
ConsequencesConsequences
Separation of the responsibilities
Operators ?
Enumeration Free Monoïd [ A* , ( ) , . ]
Operator Morphism toward [ P , e , + ]
••••[A*, ( ) , . ]
••••[P*, ( ) , . ]
+ + + +[ P , e , + ]
R
Valuation +Valuation +
List of A
List of P
. +
f : A P
Redefining implementation
ConsequencesConsequences
Separation of the responsibilities
Operators !
MAPMAP
A,B
CROSSCROSS
A,B,C
FILTERFILTER
A
REDUCEREDUCE
A
FORALLFORALL
A
BMFBMF
Eval_MorphismEval_Morphism
A,P
IteratorIterator
A
MorphismMorphism
A,P
HomomorphismHomomorphism
A,B
Operator_COperator_C
A,B
Command & RequestCommand & Request
IteratorIterator
B MorphismMorphism
A,P
Operator_NCOperator_NC
A,P
Redefining implementation
ConsequencesConsequences
Separation of the responsibilities
Pattern SystemPattern System
Designing collections and iterators
Expressing Operators
Using Enumerations
Introduction
Design Model for Processing
Pattern SystemPattern System
Impact of the DDD
Fundamental Services for Data Parallelism
Conclusion
MethodMethod
Identification of significant characteristics
Accessor
Capacity
Indexed
Hashed
LinearIndexed
Dictionary Bounded
Dynamic
FIFO
FILO
Classification with families
Relations between characteristics
Specification of abstractions (Collections & Iterators)
A
B
C
a
b
c
Abstraction
MethodMethod
Identification of significant characteristics
Classification with families
Relations between characteristics
Application to collectionsApplication to collections
deferred class ACCESSOR
feature
General definitions
end
deferred class ACCESSOR
feature
General definitions
end
FamilyFamily
Families:
Abstract classes
Characteristic
deferred class INDEXED [ITEM,INDEX]
inherit
ACCESSOR
feature
read ( i : INDEX ) : ITEM is
deferred end
write ( i : INDEX ; e : ITEM ) is
deferred end
end
deferred class INDEXED [ITEM,INDEX]
inherit
ACCESSOR
feature
read ( i : INDEX ) : ITEM is
deferred end
write ( i : INDEX ; e : ITEM ) is
deferred end
end
Characteristics:
Progressive specialization
deferred class COLLECTION [ ITEM ]
inherit
ACCESSOR
CAPACITY
../.. -- Other families
feature ../..
end
deferred class COLLECTION [ ITEM ]
inherit
ACCESSOR
CAPACITY
../.. -- Other families
feature ../..
end
collection
AccesseurAccesseur
capacitycapacity
Collections:
Abstract classes using
families and specialization
using characteristics
Mix-inMix-in
Indexed
Indexed_Iterator
Writable_Iterator
2Way_Iterator
Indexe
d
Indexe
d
Writabl
e
Writabl
e
Two_Wa
y
Two_Wa
y
CharacteristicsCharacteristics
accessors
Iterator
FamiliesFamilies
Application to iteratorsApplication to iterators
• Similar approach
• Characteristics:
from the collections,
Iterator’s own
• Designed with multiple
inheritance
The type constraints are
expressed using characteristics
combination and not using
collection types
Remark :
Collection
Building an OperatorBuilding an Operator
Operator properties
• Items type
• First order function
• Second order function
• Type of enumeration
Implementation • Generic type
• Virtual method (deferred)
• Classification (BMF, etc.)
• Iterator type
Pattern for IteratorsPattern for Iterators
Composable operator and Iterator
Compositions
Factorization
static
dynamic
Multiplexer Demultiplexer
Impact of the DDDImpact of the DDD
Deriving the operator pattern
Equivalence Constraint
Introduction
Design Model for Processing
Pattern System
Impact of the DDDImpact of the DDD
Fundamental Services for Data Parallelism
Conclusion
Deriving the Operator patternDeriving the Operator pattern
Reminder : Operator structure
Redefinition of collections : data distribution
Parallelisation of processing
AbstractClient
AbstractCollection OperatorIterator
collection := make_collection
iteration := collection.make_iterator
operator.attach(iteration)
operator.run
ConcreteOperator
ParaOperator
ConcreteIterator
SpreadIterator
SpreadCollection
Enumeration of
local data
Enumeration of
remote data
Conformity constraints
Spread collections and Local collections
Sequential and Parallel Operators
Sequential and Parallel execution
Deriving the Operator patternDeriving the Operator pattern
Reminder : Operator structure
Derivation
Factory method : select distributed services
Invocation : local computations
ParaOperator
Spread_Collection
ParaClient
make_collection : Spread_Collection
make_operation : ParaOperator
SeqClient
make_collection : ACollection
AnOperation
make_operation : AnOperator
ConcreteOperator
Collection
collection := make_collection
operator := make_operator(collection)
operator.run
make_operation ( collection) : AnOperator is
do
!!Result
Result.attach(Collection.items)
end
make_operation ( collection) : ParaOperator is
do
!!Result
Result.attach(Collection.local_items)
end
Deriving the Operator patternDeriving the Operator pattern
Reminder : Operator structure
Conformity constraints
Parallel Evaluation SchemeParallel Evaluation Scheme
[A*, () , . ]
[ P , e , + ]
F
[ A**, () , . ][ A**, () , . ]
DistDist
[ P*, () , . ]
F*
Aggregation
• Morphism (f,e,+)
• Distribution
Data :
Intermediate :
• Computation of the
local contributions
Result :
• Aggregation of the
local contributions
Equivalence ConstraintEquivalence Constraint
Is there a problem???
Equivalence Constraint
Aggregation order of local contributions
Particular situations
Propriety of morphisms
Commutative operator
Morphism
+F ( ) F ( )
+{F ( ) F ( )} F ( )+
F ( ) F ( ) F ( )// Evaluation
Aggregation
Order of aggregation = initial order
Is there a problem???
Equivalence ConstraintEquivalence Constraint
F ( ) F ( ) F ( )//Evaluation
Inner composition rule is commutative
& : Commutative
&F ( ) F ( )
&{F ( ) F ( )} F ( )&
Aggregation
Order of aggregation =/= initial order
&F ( ) F ( )=?=
Particular situations
Propriety of morphisms
Is there a problem???
Equivalence ConstraintEquivalence Constraint
General situation
An operator defines a partial order
The distribution layout implements this order
Warning : collaboration between operator and layout manager
Particular situations
Is there a problem???
Equivalence ConstraintEquivalence Constraint
Fundamental Services for DataFundamental Services for Data
ParallelismParallelism
Spreading of the Collections:
Spread Layout
Model of Memory and Communication
Introduction
Design Model for Processing
Pattern System
Impact of the DDD
Fundamental Services for Data ParallelismFundamental Services for Data Parallelism
Conclusion
Spreading of the CollectionsSpreading of the Collections
Proc
Collection
P1
P0 P2
Instance
P1
Instance
P2
Instance
P0
Conformity
Ubiquity of spreaded collections - Local Collection
Conformity
Separation of concerns
Spread model
Invocation
Id
Key
Owner
Layout
Proc 1 Proc 2
Layout
Dynamic DistributionDynamic DistributionLocal SharingLocal Sharing
Spreading of the CollectionsSpreading of the Collections
Memory model
Shared Memory
Local Storage
Shared Collections
Conformity
Separation of concerns
Spreading of the CollectionsSpreading of the Collections
Spread model
Local memoryLocal memory
Local memory
Local memory
Local copy Original
Distributed Collection
Memory model
Conformity
Separation of concerns
Spreading of the CollectionsSpreading of the Collections
Spread model
Redefinition of the accessors
Granularity
Fundamental
Behavior
• read
• write
Use case
• sequential (SPMD)
• parallel
Interpretation
• local
• remote (distributed, shared, etc.)
• atomic
• enumerative
Conformity
Separation of concerns
Spreading of the CollectionsSpreading of the Collections
Structure
DIST_MEMORYDIST_MEMORY
SHD_MEMORYSHD_MEMORY
SHD_COLLECTIO
N
SHD_COLLECTIO
N
DIST_COLLECTIO
N
DIST_COLLECTIO
N
MEMORY_MODELMEMORY_MODELSPREAD_COLLECTIONSPREAD_COLLECTION
SVM_LIBSVM_LIB
POMPOM PVMPVM MPIMPI
MP_APIMP_API
SHD_APISHD_API
Redefinition of the accessors
Conformity
Separation of concerns
Spreading of the CollectionsSpreading of the Collections
ConclusionConclusion
Experimentation
Assessment
Perspectives
Introduction
Design Model for Processing
Pattern System
Impact of the DDD
Fundamental Services for Data Parallelism
ConclusionConclusion
ExperimentationExperimentation
Linear Algebra
Genome
Forest Simulation
Contract Intel SSD
Collaboration D. Lavenier
Collaboration M.-A. Moravie
Laboratory of Biometrics Lyon
N-Body Application derivation
Shared Memory API User, GC extensions
Paragon, Origin2000,
PowerChallenge
Origin2000, Clusters
Paragon
Clusters (Myrinet, ATM),
Origin2000
Distributed Memory API User (POM) Origin2000, Myrinet, etc.
Theme Context Plate form
NoW
AssessmentAssessment
Pattern system for enumeration processing
Application of the patterns for data parallelism
Patterns dedicated to data parallelism
Method to design collections, iterators and operators
PerspectivesPerspectives
Research :
Industry :
Integration of research in the area of functional programming
Validation and conformity of parallel code
Dealing with data dependencies
A pattern system for data collection processing
Library for data collection processing (C++ & STL, Java & JGL, etc.)
Toward an automatic production of the code for parallel patterns

More Related Content

What's hot

Optimization
OptimizationOptimization
OptimizationManas Das
 
Optimization toolbox presentation
Optimization toolbox presentationOptimization toolbox presentation
Optimization toolbox presentationRavi Kannappan
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLABAshish Meshram
 
CIS110 Computer Programming Design Chapter (6)
CIS110 Computer Programming Design Chapter  (6)CIS110 Computer Programming Design Chapter  (6)
CIS110 Computer Programming Design Chapter (6)Dr. Ahmed Al Zaidy
 
ICAPS-2020 Industry Session
ICAPS-2020 Industry SessionICAPS-2020 Industry Session
ICAPS-2020 Industry SessionPhilippe Laborie
 
Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...Philippe Laborie
 

What's hot (8)

Optimization
OptimizationOptimization
Optimization
 
Optimization toolbox presentation
Optimization toolbox presentationOptimization toolbox presentation
Optimization toolbox presentation
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
CIS110 Computer Programming Design Chapter (6)
CIS110 Computer Programming Design Chapter  (6)CIS110 Computer Programming Design Chapter  (6)
CIS110 Computer Programming Design Chapter (6)
 
Fundamentals of matlab
Fundamentals of matlabFundamentals of matlab
Fundamentals of matlab
 
ICAPS-2020 Industry Session
ICAPS-2020 Industry SessionICAPS-2020 Industry Session
ICAPS-2020 Industry Session
 
Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...
 
Matlab-fundamentals of matlab-1
Matlab-fundamentals of matlab-1Matlab-fundamentals of matlab-1
Matlab-fundamentals of matlab-1
 

Similar to 1998 - Thesis JL Pacherie Parallel perators

How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...Robert Grossman
 
Oracle Demantra Training
 Oracle Demantra Training Oracle Demantra Training
Oracle Demantra Trainingwilliamflender
 
Machine learning on streams of data
Machine learning on streams of dataMachine learning on streams of data
Machine learning on streams of dataTomasz Sosiński
 
What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?Matei Zaharia
 
Android classes-in-pune-syllabus
Android classes-in-pune-syllabusAndroid classes-in-pune-syllabus
Android classes-in-pune-syllabuscncandrwebworld
 
Android training in Nagpur
Android training in Nagpur Android training in Nagpur
Android training in Nagpur letsleadsand
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnIntroduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnBenjamin Bengfort
 
Sharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph QueriesSharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph QueriesGábor Szárnyas
 
Modeling Search Computing Applications
Modeling Search Computing ApplicationsModeling Search Computing Applications
Modeling Search Computing ApplicationsMarco Brambilla
 
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...PAPIs.io
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017Manish Pandey
 
Recommending refactoring operations in large software systems
Recommending refactoring operations in large software systemsRecommending refactoring operations in large software systems
Recommending refactoring operations in large software systemsCarlos Eduardo
 
Thesis, Image Registration Methods
Thesis, Image Registration MethodsThesis, Image Registration Methods
Thesis, Image Registration Methodsbalanou
 
Amazon SageMaker 內建機器學習演算法 (Level 400)
Amazon SageMaker 內建機器學習演算法 (Level 400)Amazon SageMaker 內建機器學習演算法 (Level 400)
Amazon SageMaker 內建機器學習演算法 (Level 400)Amazon Web Services
 
Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...
Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...
Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...Simplilearn
 
apsis - Automatic Hyperparameter Optimization Framework for Machine Learning
apsis - Automatic Hyperparameter Optimization Framework for Machine Learningapsis - Automatic Hyperparameter Optimization Framework for Machine Learning
apsis - Automatic Hyperparameter Optimization Framework for Machine Learningandi1400
 
LIFT: A Legacy InFormation retrieval Tool
LIFT: A Legacy InFormation retrieval ToolLIFT: A Legacy InFormation retrieval Tool
LIFT: A Legacy InFormation retrieval ToolKellyton Brito
 
Lessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at NetflixLessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at NetflixJustin Basilico
 
What’s New with Databricks Machine Learning
What’s New with Databricks Machine LearningWhat’s New with Databricks Machine Learning
What’s New with Databricks Machine LearningDatabricks
 

Similar to 1998 - Thesis JL Pacherie Parallel perators (20)

How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
 
Oracle Demantra Training
 Oracle Demantra Training Oracle Demantra Training
Oracle Demantra Training
 
Machine learning on streams of data
Machine learning on streams of dataMachine learning on streams of data
Machine learning on streams of data
 
What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?
 
Android classes-in-pune-syllabus
Android classes-in-pune-syllabusAndroid classes-in-pune-syllabus
Android classes-in-pune-syllabus
 
Android training in Nagpur
Android training in Nagpur Android training in Nagpur
Android training in Nagpur
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnIntroduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
 
Sharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph QueriesSharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph Queries
 
Modeling Search Computing Applications
Modeling Search Computing ApplicationsModeling Search Computing Applications
Modeling Search Computing Applications
 
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
 
Oracle demantra online training
Oracle demantra online trainingOracle demantra online training
Oracle demantra online training
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
 
Recommending refactoring operations in large software systems
Recommending refactoring operations in large software systemsRecommending refactoring operations in large software systems
Recommending refactoring operations in large software systems
 
Thesis, Image Registration Methods
Thesis, Image Registration MethodsThesis, Image Registration Methods
Thesis, Image Registration Methods
 
Amazon SageMaker 內建機器學習演算法 (Level 400)
Amazon SageMaker 內建機器學習演算法 (Level 400)Amazon SageMaker 內建機器學習演算法 (Level 400)
Amazon SageMaker 內建機器學習演算法 (Level 400)
 
Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...
Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...
Machine Learning Engineer Salary, Roles And Responsibilities, Skills and Resu...
 
apsis - Automatic Hyperparameter Optimization Framework for Machine Learning
apsis - Automatic Hyperparameter Optimization Framework for Machine Learningapsis - Automatic Hyperparameter Optimization Framework for Machine Learning
apsis - Automatic Hyperparameter Optimization Framework for Machine Learning
 
LIFT: A Legacy InFormation retrieval Tool
LIFT: A Legacy InFormation retrieval ToolLIFT: A Legacy InFormation retrieval Tool
LIFT: A Legacy InFormation retrieval Tool
 
Lessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at NetflixLessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at Netflix
 
What’s New with Databricks Machine Learning
What’s New with Databricks Machine LearningWhat’s New with Databricks Machine Learning
What’s New with Databricks Machine Learning
 

1998 - Thesis JL Pacherie Parallel perators

  • 1. A Pattern System forA Pattern System for Enumeration ProcessingEnumeration Processing Expression and ParallelisationExpression and Parallelisation Jean-Lin Pacherie
  • 2. ContentsContents • Introduction • Conclusion • Design Model for Processing • Pattern System • Impact of the Data Driven Distribution (DDD) • Services for Data Parallelism
  • 3. IntroductionIntroduction Motivations Pattern and Parallelism Ideas and Thesis IntroductionIntroduction Design Model for Processing Pattern System Impact of the DDD Fundamental Services for Data Parallelism Conclusion
  • 4. MotivationsMotivations Parallel Programming, Why? Decrease computation duration Increase data size
  • 5. Deriving sequential applications (DDD) MotivationsMotivations Parallel Programming, Why? Parallel Programming, How? Direct parallel programming
  • 6. MotivationsMotivations Parallel Programming, Why? The solution should conforms with usual programming environment Constraints for the solution Standard compilation tools No language extensions Parallel Programming, How?
  • 7. MotivationsMotivations Parallel Programming, Why? Constraints for the solution Parallel Programming, How? Available tools Abstraction Encapsulation Polymorphism Software architecture with Patterns
  • 8. MotivationsMotivations Parallel Programming, Why? Constraints for the solution Parallel Programming, How? Available tools Evolution Encapsulating parallelism in a sequential OOL [ Jézéquel 91 ] Method & Framework PALADIN [ Guidec 95 ] Reusable expression of methods [ Pacherie 97 ]
  • 9. RequirementsRequirements Experts and Reusability Beyond the software component reusability : Pattern Where is expressed the knowledge in an application? What kind of tools for reusability?
  • 11. RequirementsRequirements Knowledge and Reusability Beyond the software components reusability Pattern [ Gamma 94 ] Express architecture to parallelize Express common architecture involved in parallel mechanism
  • 12. RequirementRequirement Knowledge and Reusability Data Parallelism Context : Data collection processing 1) Cut-out From iteration start until iteration end loop action ( current item ) next iteration end Collection : Aggregation of homogeneous items
  • 13. RequirementsRequirements Knowledge and Reusability Data Parallelism Increasing Data size Decreasing computation duration 1) Cut out 2) Layout 3) // Processing
  • 14. RequirementsRequirements Knowledge and Reusability Data Parallelism Data Driven Distribution Parallel Code Collection Sequential Code ? Code Proc 2Code Proc 2 Code Proc 1Code Proc 1 Code Proc 3Code Proc 3 Data Layout Owner Compute rule Remote Data Refreshing SPMD Principles
  • 15. ThesisThesis Design patterns for data parallelism programming Identify and organize the design pattern dedicated to data collection processing Apply the DDD mechanism to these patterns: Parallelization at the software architecture level Use the design patterns of serialUse the design patterns of serial applications to introduce parallelismapplications to introduce parallelism
  • 16. Design Model for EnumerationDesign Model for Enumeration ProcessingProcessing Operator Design Pattern Consequences Introduction Design Model for ProcessingDesign Model for Processing Pattern System Impact of the DDD Fundamental Services for Data Parallelism Conclusion
  • 17. Towards a pattern...Towards a pattern... Description of behavior Behavior vs.. Implementation Instaciation delegation trough the Factory Method pattern AbstractClient FactoryMethod : AbstractProduct AnOperation AbstractProduct Service … product := FactoryMethod product.service ... ConcreteClient FactoryMethod : ConcreteProduct ConcreteProduct Servic e !ConcreteProduct!Result
  • 18. AbstractSolver make_matrix : Matrix solve Matrix Item ConcreteSolver make_matrix : SparseMatrix SparseMatrix Item Towards a pattern...Towards a pattern... Description of behavior Behavior vs. Implementation Instaciation delegation trough the Factory Method pattern
  • 19. Factory Pattern Extracting iteration domain through the Iterator pattern ArrayIteratorArray ConcreteClient Independence from data structures AbstractClient Collection Iterator collection := make_collection iteration := collection.make_iterator from iteration.start until iteration.exhausted loop … iteration.next end Towards a pattern...Towards a pattern... Description of behavior
  • 20. AbstractClient Collection Iterator ArrayIteratorArray ConcreteClient Extracting iteration domain through the Iterator pattern Independence from data structures Towards a pattern...Towards a pattern... Description of behavior Factory Pattern
  • 21. Extracting control structure AbstractClient Collection Operator collection := make_collection iteration := collection.make_iterator from iteration.start until iteration.exhausted loop … iteration.next end Iterator Extracting iteration domain through the Iterator pattern Towards a pattern...Towards a pattern... Description of behavior
  • 22. AbstractClient Collection Operator collection := make_collection iteration := collection.make_iterator operator.attach(iteration) operator.run Iterator Operator Extracting control structure Extracting iteration domain through the Iterator pattern Towards a pattern...Towards a pattern... Description of behavior
  • 23. ConsequencesConsequences Separation of the responsibilities Collection, Iterator and Operators The modularity encourage reusability [Meyer 97]
  • 24. Redefining implementation Using the factory method pattern Data Collections Processing operators Iteration domains Client Product Application Collection Operator IteratorCollection Application ConsequencesConsequences Separation of the responsibilities
  • 25. Processing ???!! ProcessingProcessing StructuralStructural OperatorOperator CommandCommand RequestRequest EnumerativeEnumerative AtomicAtomic Collections Enumerations No results With results List of items One item Redefining implementation ConsequencesConsequences Separation of the responsibilities
  • 26. Operators ? Enumeration Free Monoïd [ A* , ( ) , . ] Operator Morphism toward [ P , e , + ] ••••[A*, ( ) , . ] ••••[P*, ( ) , . ] + + + +[ P , e , + ] R Valuation +Valuation + List of A List of P . + f : A P Redefining implementation ConsequencesConsequences Separation of the responsibilities
  • 27. Operators ! MAPMAP A,B CROSSCROSS A,B,C FILTERFILTER A REDUCEREDUCE A FORALLFORALL A BMFBMF Eval_MorphismEval_Morphism A,P IteratorIterator A MorphismMorphism A,P HomomorphismHomomorphism A,B Operator_COperator_C A,B Command & RequestCommand & Request IteratorIterator B MorphismMorphism A,P Operator_NCOperator_NC A,P Redefining implementation ConsequencesConsequences Separation of the responsibilities
  • 28. Pattern SystemPattern System Designing collections and iterators Expressing Operators Using Enumerations Introduction Design Model for Processing Pattern SystemPattern System Impact of the DDD Fundamental Services for Data Parallelism Conclusion
  • 29. MethodMethod Identification of significant characteristics Accessor Capacity Indexed Hashed LinearIndexed Dictionary Bounded Dynamic FIFO FILO Classification with families Relations between characteristics
  • 30. Specification of abstractions (Collections & Iterators) A B C a b c Abstraction MethodMethod Identification of significant characteristics Classification with families Relations between characteristics
  • 31. Application to collectionsApplication to collections deferred class ACCESSOR feature General definitions end deferred class ACCESSOR feature General definitions end FamilyFamily Families: Abstract classes Characteristic deferred class INDEXED [ITEM,INDEX] inherit ACCESSOR feature read ( i : INDEX ) : ITEM is deferred end write ( i : INDEX ; e : ITEM ) is deferred end end deferred class INDEXED [ITEM,INDEX] inherit ACCESSOR feature read ( i : INDEX ) : ITEM is deferred end write ( i : INDEX ; e : ITEM ) is deferred end end Characteristics: Progressive specialization deferred class COLLECTION [ ITEM ] inherit ACCESSOR CAPACITY ../.. -- Other families feature ../.. end deferred class COLLECTION [ ITEM ] inherit ACCESSOR CAPACITY ../.. -- Other families feature ../.. end collection AccesseurAccesseur capacitycapacity Collections: Abstract classes using families and specialization using characteristics
  • 32. Mix-inMix-in Indexed Indexed_Iterator Writable_Iterator 2Way_Iterator Indexe d Indexe d Writabl e Writabl e Two_Wa y Two_Wa y CharacteristicsCharacteristics accessors Iterator FamiliesFamilies Application to iteratorsApplication to iterators • Similar approach • Characteristics: from the collections, Iterator’s own • Designed with multiple inheritance The type constraints are expressed using characteristics combination and not using collection types Remark : Collection
  • 33. Building an OperatorBuilding an Operator Operator properties • Items type • First order function • Second order function • Type of enumeration Implementation • Generic type • Virtual method (deferred) • Classification (BMF, etc.) • Iterator type
  • 34. Pattern for IteratorsPattern for Iterators Composable operator and Iterator Compositions Factorization static dynamic Multiplexer Demultiplexer
  • 35. Impact of the DDDImpact of the DDD Deriving the operator pattern Equivalence Constraint Introduction Design Model for Processing Pattern System Impact of the DDDImpact of the DDD Fundamental Services for Data Parallelism Conclusion
  • 36. Deriving the Operator patternDeriving the Operator pattern Reminder : Operator structure Redefinition of collections : data distribution Parallelisation of processing AbstractClient AbstractCollection OperatorIterator collection := make_collection iteration := collection.make_iterator operator.attach(iteration) operator.run ConcreteOperator ParaOperator ConcreteIterator SpreadIterator SpreadCollection Enumeration of local data Enumeration of remote data
  • 37. Conformity constraints Spread collections and Local collections Sequential and Parallel Operators Sequential and Parallel execution Deriving the Operator patternDeriving the Operator pattern Reminder : Operator structure
  • 38. Derivation Factory method : select distributed services Invocation : local computations ParaOperator Spread_Collection ParaClient make_collection : Spread_Collection make_operation : ParaOperator SeqClient make_collection : ACollection AnOperation make_operation : AnOperator ConcreteOperator Collection collection := make_collection operator := make_operator(collection) operator.run make_operation ( collection) : AnOperator is do !!Result Result.attach(Collection.items) end make_operation ( collection) : ParaOperator is do !!Result Result.attach(Collection.local_items) end Deriving the Operator patternDeriving the Operator pattern Reminder : Operator structure Conformity constraints
  • 39. Parallel Evaluation SchemeParallel Evaluation Scheme [A*, () , . ] [ P , e , + ] F [ A**, () , . ][ A**, () , . ] DistDist [ P*, () , . ] F* Aggregation • Morphism (f,e,+) • Distribution Data : Intermediate : • Computation of the local contributions Result : • Aggregation of the local contributions
  • 40. Equivalence ConstraintEquivalence Constraint Is there a problem??? Equivalence Constraint Aggregation order of local contributions
  • 41. Particular situations Propriety of morphisms Commutative operator Morphism +F ( ) F ( ) +{F ( ) F ( )} F ( )+ F ( ) F ( ) F ( )// Evaluation Aggregation Order of aggregation = initial order Is there a problem??? Equivalence ConstraintEquivalence Constraint
  • 42. F ( ) F ( ) F ( )//Evaluation Inner composition rule is commutative & : Commutative &F ( ) F ( ) &{F ( ) F ( )} F ( )& Aggregation Order of aggregation =/= initial order &F ( ) F ( )=?= Particular situations Propriety of morphisms Is there a problem??? Equivalence ConstraintEquivalence Constraint
  • 43. General situation An operator defines a partial order The distribution layout implements this order Warning : collaboration between operator and layout manager Particular situations Is there a problem??? Equivalence ConstraintEquivalence Constraint
  • 44. Fundamental Services for DataFundamental Services for Data ParallelismParallelism Spreading of the Collections: Spread Layout Model of Memory and Communication Introduction Design Model for Processing Pattern System Impact of the DDD Fundamental Services for Data ParallelismFundamental Services for Data Parallelism Conclusion
  • 45. Spreading of the CollectionsSpreading of the Collections Proc Collection P1 P0 P2 Instance P1 Instance P2 Instance P0 Conformity Ubiquity of spreaded collections - Local Collection
  • 46. Conformity Separation of concerns Spread model Invocation Id Key Owner Layout Proc 1 Proc 2 Layout Dynamic DistributionDynamic DistributionLocal SharingLocal Sharing Spreading of the CollectionsSpreading of the Collections
  • 47. Memory model Shared Memory Local Storage Shared Collections Conformity Separation of concerns Spreading of the CollectionsSpreading of the Collections Spread model
  • 48. Local memoryLocal memory Local memory Local memory Local copy Original Distributed Collection Memory model Conformity Separation of concerns Spreading of the CollectionsSpreading of the Collections Spread model
  • 49. Redefinition of the accessors Granularity Fundamental Behavior • read • write Use case • sequential (SPMD) • parallel Interpretation • local • remote (distributed, shared, etc.) • atomic • enumerative Conformity Separation of concerns Spreading of the CollectionsSpreading of the Collections
  • 51. ConclusionConclusion Experimentation Assessment Perspectives Introduction Design Model for Processing Pattern System Impact of the DDD Fundamental Services for Data Parallelism ConclusionConclusion
  • 52. ExperimentationExperimentation Linear Algebra Genome Forest Simulation Contract Intel SSD Collaboration D. Lavenier Collaboration M.-A. Moravie Laboratory of Biometrics Lyon N-Body Application derivation Shared Memory API User, GC extensions Paragon, Origin2000, PowerChallenge Origin2000, Clusters Paragon Clusters (Myrinet, ATM), Origin2000 Distributed Memory API User (POM) Origin2000, Myrinet, etc. Theme Context Plate form NoW
  • 53. AssessmentAssessment Pattern system for enumeration processing Application of the patterns for data parallelism Patterns dedicated to data parallelism Method to design collections, iterators and operators
  • 54. PerspectivesPerspectives Research : Industry : Integration of research in the area of functional programming Validation and conformity of parallel code Dealing with data dependencies A pattern system for data collection processing Library for data collection processing (C++ & STL, Java & JGL, etc.) Toward an automatic production of the code for parallel patterns