# **Summary**

Thanks everyone for valuable discussions. Here is a summary to conclude all the 
comments, and we will follow it to file PRs.

- We will create a separate composite target macro as follows:

```c
TVM_REGISTER_TARGET_KIND("composite")
   .add_attr_option<Target>("target_host")
   .add_attr_option<Array<Target>>("devices") // Accelerator targets in order.
```

- Accordingly, here are the steps of creating a new composite target with a 
backend that can only execute a Relay subgraph:

1. Create a new target for the backend.

```c
// Note that this macro indicates that the codegen/runtime of this target
// can only handle a part of Relay graph and must be used in composite targets.
TVM_REGISTER_ACCEL_TARGET_KIND("arm_acl")
  .add_attr_option<...>... // arm_acl specific attributes.
```

2. Create a target alias. Note that the name `alias` and the API are tentative.

```python
'acl': {
  'kind': 'composite',
  'target_host': 'llvm',
  'devices': [{'kind': 'arm_acl'}]
}
```

# **Remaining Issues**

Ideally, we expect to have a composite target like the following

```python
'hetero-target': {
  'kind': 'composite',
  'target_host': 'llvm',
  'devices': [{'kind': 'ethosn'}, {'kind': 'opencl'}]
}
```

The above composite target indicates that we want to offload the Relay graph as 
many as we can to Ethos-N for the best performance. For the part that cannot be 
offloaded to Ethos-N, we want to put it to the OpenCL flow so that it can be 
executed on ARM GPU, for example.

The issue is that currently we have two partition mechanisms:

1. Manual annotated partition for heterogeneous execution (e.g., CPU/GPU).
2. BYOC partition (e.g., Ethos-N, ARM ACL, DNNL, Vitis-AI, CoreML, etc).

Since the two mechanisms work independently at this moment, we need to unify 
them to achieve the above goal. We will first work on the composite target in 
this RFC and leave an error message to the above case.





---
[Visit Topic](https://discuss.tvm.ai/t/rfc-composite-target/7744/10) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/20f278ee361b9c176dbfd3ce78003b47b6d8dc1abc37d224357bc51d6852a6e6).

Reply via email to