Open
Description
Julia support early finalization insertion, JuliaLang/julia#45272, however that does not trigger here because CuArrays' finalizers taints the TLS effect. Keno suggested just untainting that using @assume_effects
, which we should explore.
If that doesn't work / In addition, @aviatesk suggested exploring integrating early finalization insertion with escape analysis, which may make this optimization even more potent.
Let's first start with the untainting and coming up with a couple of MWEs to look into.
cc @jpsamaroo