MetadataCreation
#include <poplar/MetadataCreation.hpp>
-
namespace poplar
Poplar classes and functions.
Functions
-
poplar::Tensor createConstantMetadataTensor(poplar::Graph &graph, poplar::QuarterMetadata::Format fp8Format, int fp8Scale, const DebugContext &debugContext = {})
Create a poplar::QUARTER_METADATA tensor for use with tensors with data type = poplar::QUARTER.
- Parameters
graph – The graph that the tensor will be added to.
fp8Format – The format (poplar::QuarterMetadata::Format::F143 or poplar::QuarterMetadata::Format::F152) to write to the output poplar::QUARTER_METADATA tensor.
fp8Scale – The value of the scale which will be written to the output poplar::QUARTER_METADATA tensor. The value of
fp8Scale
must be within the range -31 to +31.debugContext – Optional debug information.
- Returns
A constant tensor of type poplar::QUARTER_METADATA initialised with the format and scale provided.
-
poplar::Tensor createVariableMetadataTensor(poplar::Graph &graph, poplar::QuarterMetadata::Format fp8Format, int fp8Scale, const DebugContext &debugContext = {})
Create a poplar::QUARTER_METADATA tensor for use with tensors with data type = poplar::QUARTER.
- Parameters
graph – The graph that the tensor will be added to.
fp8Format – The format (poplar::QuarterMetadata::Format::F143 or poplar::QuarterMetadata::Format::F152) to write to the output poplar::QUARTER_METADATA tensor.
fp8Scale – The value of the scale which will be written to the output poplar::QUARTER_METADATA tensor. The value of
fp8Scale
must be within the range -31 to +31.debugContext – Optional debug information.
- Returns
A variable tensor of type QUARTER_METADATA initialised with the format and scale provided.
-
poplar::Tensor createVariableMetadataTensor(poplar::Graph &graph, poplar::QuarterMetadata::Format fp8Format, const poplar::Tensor &fp8Scale, poplar::program::Sequence &prog, const DebugContext &debugContext = {})
Create a poplar::QUARTER_METADATA tensor for use with tensors with data type = poplar::QUARTER.
- Parameters
graph – The graph that the tensor will be added to.
fp8Format – The format (poplar::QuarterMetadata::Format::F143 or poplar::QuarterMetadata::Format::F152) to write to the output poplar::QUARTER_METADATA tensor.
fp8Scale – A scale tensor of signed integral type which will provide the scale of the output poplar::QUARTER_METADATA tensor. The value of
fp8Scale
must be within the range -31 to +31.prog – The program that will execute the runtime initialisation of the output tensor.
debugContext – Optional debug information.
- Returns
A variable tensor of type QUARTER_METADATA initialised with the format and scale provided.
-
void setMetadataTensor(poplar::Graph &graph, poplar::QuarterMetadata::Format fp8Format, const poplar::Tensor &fp8Scale, const poplar::Tensor &metadataOut, poplar::program::Sequence &prog, const DebugContext &debugContext = {})
Write to an existing poplar::QUARTER_METADATA tensor, for use with tensors with data type = poplar::QUARTER.
- Parameters
graph – The graph that the tensor will be added to.
fp8Format – The format (poplar::QuarterMetadata::Format::F143 or poplar::QuarterMetadata::Format::F152) to write to the output poplar::QUARTER_METADATA tensor.
fp8Scale – A scale tensor of signed integral type which will provide the scale of the output poplar::QUARTER_METADATA tensor. The value of
fp8Scale
must be within the range -31 to +31.metadataOut – The destination metadata tensor to write to.
prog – The program that will execute the runtime initialisation of the metadata tensor provided.
debugContext – Optional debug information.
-
poplar::Tensor createConstantMetadataTensor(poplar::Graph &graph, poplar::QuarterMetadata::Format fp8Format, int fp8Scale, const DebugContext &debugContext = {})