Internals

Contents

Index

Net

The Net datastructure is the main container used by the Latte compiler and runtime. When constructing a Net a user adds ensembles and applies connections between them. This implicitly constructs a task graph with connections as data dependencies and ensembles as groups of comptue tasks. The init(net::Net) routine is the main entry point for the Latte compiler. Inside this function, the Latte compiler consumes the implicit task graph, synthesizes functions to compute various tasks and optimizes these functions.

{docs}
init(net::Net)

init_buffer(net::Net, name::Symbol, shape; func=zeros)
set_buffer(net::Net, name::Symbol, arr::Array; _copy=true)
set_buffer(net::Net, name::Symbol, arr::Array, t::Int)
get_buffer(net::Net, ens::AbstractEnsemble, name::Symbol)

rand_values(net::Net)
clear_values(net::Net)
clear_(net::Net)

Connections

# Latte.check_one_to_oneMethod.


TODO: doc

# Latte.check_dimensions_fixedMethod.


TODO: doc

Synthesis and Optimization

# Latte.add_send_exprsMethod.


TODO: doc

# Latte.add_recv_exprMethod.


TODO: doc

# Latte.init_forwardMethod.


TODO: doc

TODO: doc

TODO: doc

# Latte.init_forwardMethod.


TODO: doc

# Latte.init_forwardMethod.


TODO: doc

# Latte.init_backwardMethod.


TODO: doc

TODO: doc

TODO: doc

# Latte.init_backwardMethod.


TODO: doc

# Latte.init_backwardMethod.


TODO: doc

# Latte.add_forward_data_tasksMethod.


TODO: doc

# Latte.add_forward_julia_tasksMethod.


TODO: doc

# Latte.push_compute_tasks!Method.


nothing # Latte.generate_c_functionMethod.


TODO: doc

# Latte.gen_neuron_backwardMethod.


TODO: doc

# Latte.gen_neuron_forwardMethod.


nothing # Latte.gen_copy_blockMethod.


Synthesize a loopnest to copy value or ∇ to the appropriate buffer

# Latte.get_src_idxMethod.


Extract the final expression of the mapping function to be used as an indexing expression. Handles cases where the final expression can be a Tuple or a single value.

Params

  • mapping – an ast for a mapping function

# Latte.optimizeMethod.


Optimize a function fn

Params

  • args – an ordered vector of arguments (buffers)
  • tile_fusion_factors – factors for tile fusions determined by connection structure
  • fn – the ast of the function to be optimized

# Latte.unpack_tiled_loopFunction.


Convert from an internal Latte tiled_loop to a normal Julia :for expression

# Latte.is_tiled_loopFunction.


Check if node is an internal Latte tiled_loop

# Latte.get_tile_fusion_factor_forwardFunction.


TODO: doc

# Latte.get_tile_fusion_factor_backwardFunction.


TODO: doc

# Latte.update_tile_varFunction.


Replace indexing expressions with tile_var with the proper tiled expression When inputs are not copied, the neuron transformer appends :NOTILE to the index expression to force Latte not to tile the expression.

# Latte.inner_loop_tilerFunction.


TODO: doc

# Latte.get_inner_loop_tilerFunction.


TODO: doc

# Latte.tile_size_inlinerFunction.


TODO: doc

# Latte.get_tile_loopsFunction.


Tile loop variables use _tile_idx loopvars.

Utility Datastructures

# Latte.TaskSetType.


A container for tasks for multiple Phases

Fields

  • tasks – a dictionary containing a Vector of tasks for each Phase

# Latte.JuliaTaskType.


A task that calls func with args...

# Latte.UpdateTaskType.


A task that updates parameter param_id

# Latte.BatchType.


Used in neuron definitions to mark a field to be unique per batch item