Declaration of Converter
class.
- MAXIMUM_TLU_BIT_WIDTH
Converter class, to convert a computation graph to MLIR.
__init__(configuration: Configuration)
add(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
array(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
assign_static(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
bitwise_and(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
bitwise_or(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
bitwise_xor(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
broadcast_to(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
concatenate(ctx: Context, node: Node, preds: List[Conversion])
constant(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
conv1d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
conv2d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
conv3d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
convert(
graph: Graph,
mlir_context: <locals>Context,
name: str = 'main'
) → Module
Convert a computation graph to MLIR.
Args: graph (Graph): graph to convert
mlir_context (MlirContext): MLIR Context to use for module generation
name (str): name of the function to convert
Return: MlirModule: In-memory MLIR module corresponding to the graph
convert_many(graphs: Dict[str, Graph], mlir_context: <locals>Context) → Module
Convert multiple computation graphs to an MLIR module.
Args: graphs (Dict[str, Graph]): graphs to convert
mlir_context (MlirContext): MLIR Context to use for module generation
Return: MlirModule: In-memory MLIR module corresponding to the graph
copy(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
dot(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
dynamic_tlu(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
expand_dims(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
extract_bit_pattern(
ctx: Context,
node: Node,
preds: List[Conversion]
) → Conversion
greater(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
greater_equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
identity(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
index_static(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
left_shift(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
less(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
less_equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
matmul(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
maximum(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
maxpool1d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
maxpool2d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
maxpool3d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
minimum(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
multiply(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
negative(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
node(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
Convert a computation graph node into MLIR.
Args: ctx (Context): conversion context
node (Node): node to convert
preds (List[Conversion]): conversions of ordered predecessors of the node
Return: Conversion: conversion object corresponding to node
not_equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
ones(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
process(graphs: Dict[str, Graph])
Process a computation graph for MLIR conversion.
Args: graphs (Dict[str, Graph]): graphs to process
relu(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
reshape(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
right_shift(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
round_bit_pattern(
ctx: Context,
node: Node,
preds: List[Conversion]
) → Conversion
simplify_tag(configuration: Configuration, tag: str) → str
Keep only n
higher tag parts.
squeeze(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
stdout_with_ansi_support() → bool
Detect if ansi characters can be used (e.g. not the case in notebooks).
subtract(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
sum(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
tlu(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
tlu_adjust(table, variable_input, target_bit_width, clipping, reduce_precision)
trace_progress(
configuration: Configuration,
progress_index: int,
nodes: List[Node]
)
Add a trace_message for progress.
Args: configuration: configuration for title, tags options
progress_index: index of the next node to process
nodes: all nodes
transpose(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
truncate_bit_pattern(
ctx: Context,
node: Node,
preds: List[Conversion]
) → Conversion
where(ctx: Context, node: Node, preds: List[Conversion]) → Conversion
zeros(ctx: Context, node: Node, preds: List[Conversion]) → Conversion