Port `all` kernel to structured kernels. (#59371)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/59371
Tracking issue: #55070
Test Plan: Imported from OSS
Reviewed By: soulitzer
Differential Revision: D29104399
Pulled By: ezyang
fbshipit-source-id: 18bb747b7a19d873427d52c1145ef7cede333a0e