To elaborate on C2, while it is desirable and recommended to have consolidated 
runtime, executor choice when possible. Naturally there are cases that would 
requires a bit of generalization. The multi-machine case is one example. 

There are also other examples that can appear on a single SoC. Consider the 
following scenario, where there is an accelerator that comes with a CPU-like 
co-processor as controller.

```bash
- host: arm
- runtime: vm
- vdevice0: accelerator-with-coprocessor
    - host: risc-v
    - runtime: graph
    - device: my-accelerator
```

In this case, the host is a ARM chip that drives the overall computation(say 
through VM). The co-processor, however, also comes with its own controller, 
that is able to execute a sub-graph of computation, which in turn dispatches to 
my-accelerator. As a result, we will need to compile a tvm runtime(that may be 
different from the host) one, and use that to drive the graph computation on 
the co-processor. 

Back to the compilation path. I agree that it is important to build a standard 
pipeline. I would also like to note that we need to design to be compatible of 
emerging needs. Allowing target specification to be recursive, while validating 
them, would help the ecosystem to develop these capabilities. Additionally, 
some of the needs can appear now, for example, we could see a need to have a 
more flexible VM runtime that drives GPU computation, while offloading subgraph 
to cuda-graph(more efficient and less flexible).


Finally to build on @Mousius 's point. Allowing target to be recursive does not 
preclude structure or naming. Targets have kinds and schemas that attached to 
each kind. Further validation can also be done throughout the process. So 
instead of

```
(CompilationConfig)
-> (Target-CUDA), (Target-X86)
-> (Executor)
-> (Runtime)
```
We would get
```
(Target-Kind=Hetro-Exec)
-> (Target-Kind=CUDA), (Target-Kind=X86)
-> (Executor)
-> (Runtime)
```

>From the UX's pov, we do not need to force user to pass in such compositional 
>ones(that is complicated) if they only care about single device execution (and 
>canonicalize internally).

Even better you will be able to leverage the tagging features at different 
level, so user can just pass in
```python
build(mod, target="my-hetro-exec-platform0")
```





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/pre-rfc-compilation-configuration-representation/11372/14)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/fdd5931911f5cde301da2e3daa5b83320acc2535fac0b7dd57f607389f78e971).

Reply via email to