[FSDP] Added warning about unsupported double backwards (#120926)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/120926
Approved by: https://github.com/Skylion007
diff --git a/torch/distributed/fsdp/fully_sharded_data_parallel.py b/torch/distributed/fsdp/fully_sharded_data_parallel.py
index 0a997d7..8152438 100644
--- a/torch/distributed/fsdp/fully_sharded_data_parallel.py
+++ b/torch/distributed/fsdp/fully_sharded_data_parallel.py
@@ -247,6 +247,10 @@
         the all-reduce times over the replication process group for some
         cluster setups.
 
+    .. warning::
+        FSDP does not work with double backwards due to how it registers
+        backward hooks.
+
     Args:
         module (nn.Module):
             This is the module to be wrapped with FSDP.