tqchen commented on PR #649:
URL: https://github.com/apache/tvm-ffi/pull/649#issuecomment-5158074177
One thing that worth double click on is var remapping handling when callback
also presence. In an ideal case, the logic should be like follows:
- In MutateExpectedImpl and MaybeInplaceMutateExpectedImpl
- First run a quick check if value is free_var (through TypeInfo and var ,
two path:
- not a free var: apply the original old logic
- value is a free var, look up var remap
- if exist, return original value(not invoking callback)
- if missing, run callback + default, or default + callback, in
both case, after execution finish, need to override the final value to var
remap(since callback may further change the var remapped value)
- future invocations will hit the var remap and not recurse into
callback.
To keep things consistent with structural hash, we can turn on the remapping
for both
```
structural_eq_hash_kind == kTVMFFISEqHashKindDAGNode ||
structural_eq_hash_kind == kTVMFFISEqHashKindFreeVar
```
This allows node being declared as DAG node also being mapped once on first
occurance.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]