Interface | Description |
---|---|
SessionMemMgr |
SessionMemMgr - aka "Session Memory Manager" is responsible for allocating, managing, and deallocating memory used
during SameDiff execution.
This interface allows different memory management strategies to be used, abstracted away from the actual graph execution logic |
Class | Description |
---|---|
AbstractDependencyTracker<T,D> |
Object dependency tracker.
|
AbstractSession<T,O> |
AbstractSession is a SameDiff graph execution class that inference and training it built upon
It walks through the graph, dynamically executing operations that can be executed next, but (again, dynamically) only
executing the subset of the graph that is actually required to get the requested outputs.
None of what AbstractSession implements is NDArray-specific. Note that most of the implementation complexity comes from dynamic graphs - i.e., nested loops, control ops, etc |
AbstractSession.ExecStep |
ExecStep represents a single execution step, for a single op (or variable/constant etc) at a specific frame/iteration
|
AbstractSession.FrameIter |
FrameIter: Identifies a frame + iteration (but not a specific op or variable).
Note that frames can be nested - which generally represents nested loop situations. |
AbstractSession.VarId |
VarId: identifies the value of a variable in a specific frame and frame iteration
Note that frames can be nested - which generally represents nested loop situations. Used for 2 places: (a) to identify variables that are available for execution (b) to store results |
DependencyList<T,D> |
A list of dependencies, used in
AbstractDependencyTracker |
DependencyTracker<T,D> |
Dependenci tracker.
|
IdentityDependencyTracker<T,D> |
Object dependency tracker, using object identity (not object equality) for the Ys (of type T)
See AbstractDependencyTracker for more details |
InferenceSession |
InferenceSession: Performs inference (forward pass) on a SameDiff instance to get the outputs of the requested nodes.
Dynamically (in AbstractSession) calculates the required subgraph to execute to get the required outputs. Note that while AbstractSession handles the graph structure component, InferenceSession handles only op execution and memory management For INDArray memory management - i.e., tracking and releasing memory manually, as soon as possible, to minimize memory use - this is implemented using a SessionMemMgr instance (for allocations/deallocations) and
also IdentityDependencyTracker to track where arrays are actually used. |
InferenceSession.ConstantDep | |
InferenceSession.Dep | |
InferenceSession.ExecDoneDep | |
InferenceSession.OpDep | |
InferenceSession.PlaceholderDep | |
InferenceSession.ReqOutputDep | |
InferenceSession.VariableDep | |
SameDiffOp | |
TrainingSession |
TrainingSession extends InferenceSession, to add training-specific functionality:
- Application of regularization (L1, L2, weight decay etc) - Inline updating of variables, using updater/optimizer (Adam, Nesterov, SGD, etc) - Calculation of regularization scores (Score for L1, L2, etc) |
Variable |
Enum | Description |
---|---|
AbstractSession.ExecType |
ExecType: Execution type, as used in ExecStep
OP: Operation execution VARIABLE: Variable "execution", mainly used to trigger ops that depend on the variable CONSTANT: As per variable PLACEHOLDER: As per variable SWITCH_L and SWITCH_R: This is a bit of a hack to account for the fact that only one of the switch branches (left or right) will ever be available; without this, once the switch op is executed, we'll (incorrectly) conclude that *both* branches can be executed EXEC_START: Start of execution CONTROL_DEP: Control dependency for op. |
Copyright © 2019. All rights reserved.