[SPMD] Add a dump_graphs_to_files utils to facilitate graph transformation debug (#98284)
Throughout the compilation, there are multiple graphs that will be generated. This PR add an utils to dump the result graphs to a folder.
Differential Revision: [D44661599](https://our.internmc.facebook.com/intern/diff/D44661599/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98284
Approved by: https://github.com/mrshenli