[TVM] Adding New Relay Operation

Official Guide: https://tvm.apache.org/docs/dev/relay_add_op.html

While going through this, it is important to have more context.

Attrs and Type Relation

Attrs are used to provide interface for the final interface regarding various attributes of the operator.

Type Relations are dealt with using functions.

Defining Compute / Strategy of the Operation

It seems that the operator can be defined in various ways such as te.compute or tir.
I want to see how the weights are defined… I think this can be better observed in operations like Convolution or Matmul

Importantly, to lower Relay operators to the implementations defined in TOPI library, a compute and schedule function need to be registered to each relay operator. However, they are usually specialized for each target. It is important that we provide some schedule for that so that AutoTVM or AutoScheduler can optimize the operations.


refer to schedule_conv3d_winograd_weight_transform in python/tvm/topi/generic/nn.py#L209-243

Other things are about creating the Python Hooks and stuff, so lets ignore this

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.