Mousius commented on pull request #8835:
URL: https://github.com/apache/tvm/pull/8835#issuecomment-905352332
Hmm, something weird is occurring here, unsure why those tests didn't run
for me locally - but debugging `test_any.py` a bit I ran
`tvm::Dump(per_target_module_)` and got (removed function body for brevity):
```
{
llvm -keys=cpu -link-params=0: IRModule({GlobalVar(intrp_fused_add):
PrimFunc([placeholder, placeholder, T_add]) attrs={"from_legacy_te_schedule":
(bool)1, "global_symbol": "intrp_fused_add", "tir.noalias": (bool)1} {}
}),
llvm -keys=cpu -link-params=0: IRModule({GlobalVar(shape_func_add):
PrimFunc([placeholder, placeholder, _broadcast_shape_func])
attrs={"from_legacy_te_schedule": (bool)1, "global_symbol": "shape_func_add",
"tir.noalias": (bool)1} {}
})}
```
This should be gated in `GetLoweredFunctions`, with these lines (these are
ran twice, once for normal cache and once for shape cache):
```
if (!lowered_functions.count(target)) {
lowered_functions.Set(target, IRModule(Map<GlobalVar,
BaseFunc>({})));
}
lowered_functions[target]->Update(lowered_func->cached_func->funcs);
```
And only create a single `IRModule` per `target`, this indicates the `Map`
is instead creating many keys even for the single `Target` it was passed in
LowerTE (i.e. same `Target` object, I assume copied), unsure why this isn't
breaking more.
This also means I was wrong about the `Target("ext_dev")` comparison, my
apologies :crying_cat_face:. I believe this is due to `ObjectHash` used by
`Map` only being able to do `String` or `ObjectPtr` comparisons?
@jroesch / @junrushao1994 any ideas? It would appear `Map` is behaving a
little bit weirdly?
--
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]