[caffe2] Fix compilation with fmt 8.x (#71966)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71966
Fix a few issues that block migration to fmt 8.x:
1. Format strings must be known at compile time by default
2. `formatter` specialization must be visible when formatting an object
Test Plan: sandcastleit
Reviewed By: cbalioglu
Differential Revision: D33835157
fbshipit-source-id: 642d36ae7cd4a3894aff1a6ecc096f72348df864
(cherry picked from commit 970ad5bc010e48d8c3e8f5818e9ab05a3785968e)