Move workspace related functions to separate file Test Plan: Existing tests Differential Revision: D40657708 Pull Request resolved: https://github.com/pytorch/pytorch/pull/87651 Approved by: https://github.com/malfet