You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/08/25 17:00:24 UTC
[GitHub] [tvm] electriclilies edited a comment on pull request #8835: Change target string to Target object in the TE compiler and interpreter
electriclilies edited a comment on pull request #8835:
URL: https://github.com/apache/tvm/pull/8835#issuecomment-905711627
@mbs-octoml I was doing a bit of debugging yesterday and saw that behavior too-- there are some cases where we try to look up a target that is LLVM CPU in a map but we don't find it, even though if you print the map there is a target with the same target string as the target we're looking for.
I discussed a bit with @junrushao1994 and he said that Target's equality / hashing function is just based on pointer equality because Target equality is actually not well defined.
So I think that there are a few possibilities for what we can do regarding the issue with` Map<Target, IRModule>`:
1. Introduce equality and hashing functions for Targets based on string equality. This would replicate the current behavior at least and allow us to key into those maps.
The intention would be to remove the hashing and equality functions eventually -- but I am wary of doing this because once the functions are introduced, people may start using them and once uses are in the codebase, it could be difficult to actually remove the hash and equality functions..
2. Introduce a new type that is a Map<Target, IRModule>, and we pass in a hash function that uses string equality on the Target. This would allow us to replicate the current behavior (essentially keying by strings in the map) but wouldn't expose the hash and equality functions.
3. Wait until more of these maps are removed to do this change
My preference would be option 2, what do you all think?
--
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org