class_docstr: Test the Regnet FSDP model in comparison with the DDP Regnet
  to verify that both converge to the same losses
class_docstr_tok: ["Test","the","Regnet","FSDP","model","in","comparison","with","the","DDP","Regnet","to","verify","that","both","converge","to","the","same","losses"]
code: def test_fsdp_integration_mixed_precision(self) -> None:
      ddp_losses = self.run_pretraining(
          with_fsdp=False,
          with_activation_checkpointing=False,
          with_mixed_precision=True,
      )
      fsdp_losses = self.run_pretraining(
          with_fsdp=True,
          with_activation_checkpointing=False,
          with_mixed_precision=True,
      )
  
      # TODO (Quentin) - understand why we do not get full convergence here
      # self.assertEqual(ddp_losses, fsdp_losses)
  
      self.assertEqual(len(ddp_losses), len(fsdp_losses))
      for i, (ddp_loss, fsdp_loss) in enumerate(
          zip(ddp_losses, fsdp_losses)
      ):
          self.assertAlmostEqual(
              ddp_loss, fsdp_loss, places=1, msg=f"Mismatch at loss {i}"
          )
  
      print(ddp_losses)
      print(fsdp_losses)
  
imports: import os
  import unittest
  import numpy
  import torch
  from vissl.utils.checkpoint import CheckpointFormatConverter
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.test_utils import gpu_test, in_temporary_directory, run_integration_test
label_desc: Use image node_id 10 for calling the TestRegnetFSDPIntegration obj's underlying member method code with example usage: obj.test_fsdp_integration_mixed_precision() without return types