phylanx
phylanx copied to clipboard
Execution primitives, Data primitives and operations
Execution primitives
- [ ] Provide a Phylanx 'context' in users create variables. This should make execution easier to manage for end users.
- [ ] Determine if contexts should be managed without user interaction (default behavior)
- Create a "stack-machine" for creating contexts and manipulating contexts
- Users push/pop contexts in a fashion similar to OpenGL or determine if contexts can be exposed to users without stack-machine interfaces
- Users create contexts and tell phylanx to execute them.
Data Primitives
- Scalar
- [x] bool
- [x] int
- [x] double
- [ ] float
- [ ] complex
- [ ] N-dimensional arrays (bool, int, double, float, complex)
- [x] N-dimensional array initialized by 0, 1, or a random value (Gaussian random should be fine)
- [ ] N-dimensional array layout by row and column
- [ ] N-dimensional array layout by space filling curves (Peano, z-order, Moore, Hilbert).
- Array tiles/blocks stored on a node are arranged in-memory using a space filling curve.
- Space-filling curves create a "cache oblivious" effect.
- Example: https://link.springer.com/chapter/10.1007/11752578_126
- [ ] N-dimensional array storage using 'resilient' (NoSQL/cloud) data structures
- [ ] Sparse N-dimensional array
Operation Primitives
- The 5 basic operations:
- [x]
map
(#307),parallel_map
(#371) - [x]
filter
(#308) - [x]
fold
(#309) - [ ]
scan
- [ ]
join_update
- [x]
- [x] N-dimensional array operation "get shape"
- [ ] N-dimensional indexing
- [ ] DAG node to represent numpy-style 'broadcast' for operations
- [x] Element-wise addition
- [x] Element-wise subtraction
- [x] Matrix multiplication (@hapoo, see #38)
- [x] Element-wise division (@hkaiser, see #49)
- [x] Element-wise power/square root (@parsa, see #100 )
- [x] Exponential function (@justwagle, see #45)
- [ ] Consider creating special nodes for HPX's linear algebra/BLAS wrapper
- [ ] SpMV (Sparse Matrix-Vector Multiply)
- [ ] SDDMM (Sampled Dense-Dense Matrix Product)
- [ ] MTTKRP (Matricized Tensor Times Kharti-Rao Product)
- [x] Matrix transposition
- [x] Matrix inversion
- [x] Matrix determinant
- [ ] Axis operations (
set
,swap
, ...) - [x] Slicing - returns a view
- [x] Joining (joins matrices) (see #170)
- [x] Diagonal slicing - Return an array or matrix (dense/sparse) slice
- [ ] Triangular indexing - Get the upper or lower triangle of an array
- [x] Project product operation (dot product)
- [x] Vector product operation (cross product) (@parsa, see #99)
- [ ] Checkpoint operation for a node
- [x] Scalar, nd-array, and matrix types should either have a method to create a 'randomize' node or there should be a function provided by phylanx that randomizes input primitives
- [ ] Support expressing linear algebra operations
- [ ] Retrieve the index set of an nd-array, vector, or matrix
- [ ] Use the index set of an nd-array, vector, or matrix for masks/logical assignment
- i.e.
A[ A.indices() % 2 == 0 ] = 1.0
- i.e.
I/O Primitives
- [x] Store operation to variable nodes (@hapoo)
- [x] Read and write results from/to disk (@hkaiser, see #27)
- [ ] Write results to Uri/url
- [x] Write results to standard output (@hkaiser, see #103)
Control Structure Primitives
- [x] Conditional operators (
==
,!=
,<
,>
,<=
,>=
) (@hkaiser, see #49) - [x] Boolean operations (
&&
,||
) (@hkaiser, see #49) - [x] Unary operations (
!
,-
) (@hkaiser, see #52) - [x]
if(cond, true_case, false_case)
(@aserio, see #74) - [x]
while(cond, body)
repeat evaluatingbody
untilcond
becomes false (@hkaiser, see #49) - [x]
block(...)
: sequentially evaluate all given arguments (@hkaiser, see #54) - [x]
parallel_block(...)
: concurrently evaluate all given arguments (@hkaiser, see #54)
Question about the dot product operation . Should operations like dot product be represented as a combination of DAG operations? Should operations like dot product be "special nodes" with custom or C++ optimized logic?
In the first step supporting 0, 1, and 2 dimensional data will be a good starting point to get the whole infrastructure in place.
@hkaiser @stevenrbrandt I've started implementing some algorithms in Python (matrix factorizations) in the unit testing directory. This should help demonstrate some end-user challenges that we'll have to sort out and help guide the front/back end implementations. Hopefully the examples clarify the use case(s) a bit.
exploratory data analysis enabling primitives:
- [x]
log
(#365) - [x]
floor
(#365) - [x]
ceil
(#365) - [x]
abs
(#365) - [x] min/max (#253, #706))
- [x] eye (#681)
- [x] tile (#694)
- [ ] repeat
- [x] reshape (#691)
- [x] mean (axis) (#297, #706)
- [ ] covariance matrix
- [ ] eig (eigenvalues + right eigenvalues of square matrices)
- [ ] lstsq
We have started to add 3D data structure support to some of the primitives (see #665).