hls4ml.backends.fpga.passes package
Submodules
hls4ml.backends.fpga.passes.bn_quant module
- class hls4ml.backends.fpga.passes.bn_quant.BatchNormalizationQuantizedTanhConfigTemplate
Bases:
LayerConfigTemplate- format(node)
- class hls4ml.backends.fpga.passes.bn_quant.BatchNormalizationQuantizedTanhFunctionTemplate
Bases:
FunctionCallTemplate- format(node)
- class hls4ml.backends.fpga.passes.bn_quant.MergeBatchNormAndQuantizedTanh
Bases:
OptimizerPass- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.
- class hls4ml.backends.fpga.passes.bn_quant.QuantizeDenseOutput
Bases:
OptimizerPass- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.
- hls4ml.backends.fpga.passes.bn_quant.register_bn_quant(backend)
hls4ml.backends.fpga.passes.clone module
- class hls4ml.backends.fpga.passes.clone.Clone(model, name, attributes, inputs, outputs=None)
Bases:
LayerInserted after the layer whose output is used more than once.
- initialize()
- class hls4ml.backends.fpga.passes.clone.CloneFunctionTemplate
Bases:
FunctionCallTemplate- format(node)
- class hls4ml.backends.fpga.passes.clone.CloneOutput
Bases:
OptimizerPassClones streams that are used multiple times
- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.
- hls4ml.backends.fpga.passes.clone.register_clone(backend)
hls4ml.backends.fpga.passes.codegen module
- class hls4ml.backends.fpga.passes.codegen.GenerateConvIm2col
Bases:
OptimizerPassGenerates tcode for im2col step of 1D/2d convolution
- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.
hls4ml.backends.fpga.passes.embedding module
- class hls4ml.backends.fpga.passes.embedding.EmbeddingConfigTemplate
Bases:
LayerConfigTemplate- format(node)
- class hls4ml.backends.fpga.passes.embedding.EmbeddingFunctionTemplate
Bases:
FunctionCallTemplate- format(node)
hls4ml.backends.fpga.passes.final_reshape module
- class hls4ml.backends.fpga.passes.final_reshape.RemoveFinalReshape
Bases:
OptimizerPassRemove reshape if final layer
- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.
hls4ml.backends.fpga.passes.remove_softmax module
- class hls4ml.backends.fpga.passes.remove_softmax.SkipSoftmax
Bases:
OptimizerPass- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.