Repository: pytorch
Issue: Dynamo test_vmap failures on Python-3.8
Labels: triaged,oncall: pt2,module: functorch,module: dynamo,module: pt2-dispatcher

### 🐛 Describe the bug

While migrating test jobs away from bionic (in https://github.com/pytorch/pytorch/pull/105260 ) I've noticed that following jobs began to fail (though may be they were disabled already):
- `test_arithmetic_add_dunder` segfaults:
```
Process 5225 stopped
* thread #1, name = 'python', stop reason = signal SIGABRT
    frame #0: 0x00007ffff7c8b00b libc.so.6`__GI_raise(sig=2) at raise.c:51:1
(lldb) bt
* thread #1, name = 'python', stop reason = signal SIGABRT
  * frame #0: 0x00007ffff7c8b00b libc.so.6`__GI_raise(sig=2) at raise.c:51:1
    frame #1: 0x00007ffff7c6a859 libc.so.6`__GI_abort at abort.c:79:7
    frame #2: 0x00007ffff6b7a35a libstdc++.so.6`__cxxabiv1::__terminate(void (*)()) + 10
    frame #3: 0x00007ffff6b7a3c5 libstdc++.so.6`std::terminate() + 21
    frame #4: 0x00007fffdf67eeab libtorch_cpu.so`__clang_call_terminate + 11
    frame #5: 0x00007fffdf92094c libtorch_cpu.so`at::functorch::WithoutTop::~WithoutTop() + 252
    frame #6: 0x00007fffdf92108c libtorch_cpu.so`at::functorch::dynamicLayerBack(c10::OperatorHandle const&, std::vector<c10::IValue, std::allocator<c10::IValue> >*, bool) + 316
    frame #7: 0x00007fffe0565aff libtorch_cpu.so`c10::impl::BoxedKernelWrapper<at::Tensor (at::Tensor const&, at::Tensor const&, c10::Scalar const&), void>::call(c10::BoxedKernel const&, c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, c10::Scalar const&) + 63
    frame #8: 0x00007fffe07cb883 libtorch_cpu.so`at::_ops::add_Tensor::call(at::Tensor const&, at::Tensor const&, c10::Scalar const&) + 387
    frame #9: 0x00007fffdf7e543f libtorch_cpu.so`std::tuple<at::Tensor, c10::optional<long> > at::functorch::_binary_pointwise_batch_rule<at::Tensor (*)(at::Tensor const&, at::Tensor const&, c10::Scalar const&), &(at::_ops::add_Tensor::call(at::Tensor const&, at::Tensor const&, c10::Scalar const&)), c10::Scalar const&>(at::Tensor const&, c10::optional<long>, at::Tensor const&, c10::optional<long>, c10::Scalar const&) + 111
    frame #10: 0x00007fffdf7c5db7 libtorch_cpu.so`at::Tensor at::functorch::add_Tensor_generated_plumbing<std::tuple<at::Tensor, c10::optional<long> > (*)(at::Tensor const&, c10::optional<long>, at::Tensor const&, c10::optional<long>, c10::Scalar const&), &(at::functorch::BinaryPointwiseBatchRuleHelper<at::Tensor (*)(at::Tensor const&, at::Tensor const&, c10::Scalar const&), &(at::_ops::add_Tensor::call(at::Tensor const&, at::Tensor const&, c10::Scalar const&)), c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, c10::Scalar const&> >::apply(at::Tensor const&, c10::optional<long>, at::Tensor const&, c10::optional<long>, c10::Scalar const&))>(at::Tensor const&, at::Tensor const&, c10::Scalar const&) + 695
    frame #11: 0x00007fffdf6e4be2 libtorch_cpu.so`std::decay<c10::guts::infer_function_traits<c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<at::Tensor (*)(at::Tensor const&, at::Tensor const&, c10::Scalar const&), at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, c10::Scalar const&> > >::type::return_type>::type c10::impl::call_functor_with_args_from_stack_<c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<at::Tensor (*)(at::Tensor const&, at::Tensor const&, c10::Scalar const&), at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, c10::Scalar const&> >, false, 0ul, 1ul, 2ul, at::Tensor const&, at::Tensor const&, c10::Scalar const&>(c10::OperatorKernel*, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<std::vector> >*, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, c10::Scalar const&>*) + 82
    frame #12: 0x00007fffdf6e4ab8 libtorch_cpu.so`c10::impl::make_boxed_from_unboxed_functor<c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<at::Tensor (*)(at::Tensor const&, at::Tensor const&, c10::Scalar const&), at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, c10::Scalar const&> >, false>::call(c10::OperatorKernel*, c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) + 24
    frame #13: 0x00007fffdf6a962a libtorch_cpu.so`c10::Dispatcher::callBoxed(c10::OperatorHandle const&, std::vector<c10::IValue, std::allocator<c10::IValue> >*) const + 106
    frame #14: 0x00007fffdf924dcd libtorch_cpu.so`at::functorch::Interpreter::process(c10::OperatorHandle const&, std::vector<c10::IValue, std::allocator<c10::IValue> >*) + 45
    frame #15: 0x00007fffdf920c69 libtorch_cpu.so`void c10::BoxedKernel::make_boxed_function<&(at::functorch::dynamicLayerFrontFallback(c10::OperatorHandle const&, std::vector<c10::IValue, std::allocator<c10::IValue> >*))>(c10::OperatorKernel*, c10::OperatorHandle const&, c10::DispatchKeySet, std::vector<c10::IValue, std::allocator<c10::IValue> >*) + 345
    frame #16: 0x00007fffe0565aff libtorch_cpu.so`c10::impl::BoxedKernelWrapper<at::Tensor (at::Tensor const&, at::Tensor const&, c10::Scalar const&), void>::call(c10::BoxedKernel const&, c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, c10::Scalar const&) + 63
    frame #17: 0x00007fffe07cb883 libtorch_cpu.so`at::_ops::add_Tensor::call(at::Tensor const&, at::Tensor const&, c10::Scalar const&) + 387
    frame #18: 0x00007fffed0dbbe6 libtorch_python.so`torch::autograd::THPVariable_add(_object*, _object*, _object*) + 630
    frame #19: 0x00007fffed0be616 libtorch_python.so`_object* torch::autograd::TypeError_to_NotImplemented_<&(torch::autograd::THPVariable_add(_object*, _object*, _object*))>(_object*, _o
```
- `test_fails_with_autograd_function` passes for `grad` and `vmap`

Skipped those in CI, but filing this one to debug further

### Versions

CI

cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @zou3519 @Chillee @samdow @kshitij12345 @janeyx99 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng @Xia-Weiwen @ipiszy