调度与编译

如下代码所示,当定义完计算逻辑后,需要在算子接口实现函数中实现调度与编译。

通过调用auto_schedule接口,便可以自动生成相应的调度。配置信息包括算子内核名以及输入、输出张量。

with tvm.target.cce():
    schedule = dsl.auto_schedule(result)
config = {
    "name": kernel_name,
    "tensor_list": [input_data, result]
    "bool_storage_as_1bit":True
}
dsl.build(schedule, config)