Use general ATen dispatch mechanism #38975
Labels
module: internals
Related to internal abstractions in c10 and ATen
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
🚀 Feature
Use general ATen dispatch mechanism in some case, like
at::lstm
.Motivation
When implementing a new out-of-source ATen backend extension for PyTorch, we find it is no chance to hook whole lstm cell based on existing
at::lstm
dispatch strategy. Our backend gets bad performance here.In detail, backends of
at::lstm
are bypassed at runtime.VariableType::lstm
callsTypeDefaultType::lstm
directly, bypassesc10::dispatcher
. Except for two backends, cudnn and mimopen, which are dispatched by hard-code “if-else”, others backends fall down to component operators, likeat::matmul
,at::sigmoid
,at::tanh
...We also find same issue in
at::_embedding_bag_backward
.Pitch
at::convolution_overrideable
,at::native_batch_norm
andat::native_layer_norm
are good examples in similar case.The text was updated successfully, but these errors were encountered: