viewOp not getting functionalized for the LTC backend

Hi Rahul,

I think in terms of tracing math_groupnorm will give you a decomposition using batch_norm, which has consequences e.g. for the weight inputs among other things and it might be cleaner to add groupnorm to the natively supported ops in LTC by adding it to the ts_native_functions.yaml. My understanding is that this approach should also ensure it is functionalized correctly.

Regarding your other questions I recommend looking at Functionalization in PyTorch: Everything You Wanted To Know which provides a pretty good overview IMO.

Hope that helps.

David

PS: Something you could try if you just wanted to get past the problem with the view op is to use torch._enable_functionalization(reapply_views=True), which should turn it into an as_strided call, however, the other problems will still persist.