Mousius commented on PR #14010:
URL: https://github.com/apache/tvm/pull/14010#issuecomment-1437134175
> Adreno currently share `OpenCL` target, we probably should consider
defining an exclusive `Target` for Adreno to support customizations.
>
> I like the idea of tvmc directly supporting `--mixed-precision` kind of
options for these target independent preprocess. The target dependents
definitely can go to target options. Current requirement of `mixed-precision`
can definitely be used across all targets.
>
> Not sure about `tvmc` accommodating preprocessing needs that arise from
vendors in future which are not critical for Targets but developer friendly.
The advice I'd give here is that is that we don't always need a generic
solution to a specific problem, the `--mixed-precision` parameter provides
benefits to other `Target`s and doesn't require us creating a new plugin system
within `tvmc` - we have similar functionality in the `--alter-layout` parameter.
> Coming to post build hooks, the intension here is to accommodate altering
the compiled library module. One of the use case being importing additional
modules before export/save. Any thoughts here ?
What is the use-case for this? I can't think of a use-case for generically
bundling things into the eventual output unless I'm missing something, specific
`Target`s would likely benefit from it, and they'd better understand the shape
of their own dependencies which indicates it should be done in some `Target`
hook? (Thinking of the example with CMSIS-NN where-in we may use this kind of
hook to bundle the CMSIS kernels or API descriptions)
> @Mousius
>
> Another thought here, How about using packed functions instead of
inventory of hooks ?
>
> Hook is defined in user application or the respective contrib as
>
> ```
> @tvm.register_func("adreno.mixed_precision_fp16")
> def mixed_precision_fp16(mod, params, args):
> . . . . . .
>
> return mod
> ```
>
> Invoked as `--pre-build-hooks "adreno.mixed_precision_fp16"` and tvmc
looks for this packed function and invokes it.
>
> This can be good starting point where `tvmc` can be out of vendor specific
hooks and going forward when we see any API's used across many targets we could
bring them into `tvmc` infra.
Sounds a bit dangerous to me, generically calling a packed function against
a module also means you have access to a plethora of other registered functions
- do we want to expose them all to the audience of `tvmc`? I'd also still push
for things that are more specific to a given `Target` to be attached to the
`Target` itself, so the scripting API and CLI remain aligned.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]