[Profiler] Memory profiler part 2: Config validation (#86853)
Memory profiling requires `record_shapes`, `profile_memory`, and `with_stack`. This PR just adds a skeleton endpoint with a good error message if certain flags are missing.
Differential Revision: [D39920801](https://our.internmc.facebook.com/intern/diff/D39920801/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86853
Approved by: https://github.com/chaekit