Refactor to allow reuse of SchedulerNode.allocate (#93328)
Paves the way for ExternKernelSchedulerNode to also be able to
use the buffer inplace logic, needed for Collective ops.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/93328
Approved by: https://github.com/jansel