[MPS] Reduce the number of command_buf created and improve performance (#81338)
The PR improves performance and reduces the CPU overhead by reducing the number of command buffers created. It uses commit and continue feature in MPS.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81338
Approved by: https://github.com/razarmehr