def test_memory_sharing_disabled(strategy):
    """Test that the multiprocessing launcher disables memory sharing on model parameters and buffers to avoid race
    conditions on model updates."""
    tensor = torch.rand(4)
    model = SimpleModel()
    assert not tensor.is_shared()
    assert not model.layer.weight.is_shared()
    assert model.layer.weight.data_ptr() == model.tied_layer.weight.data_ptr()

    fabric = Fabric(accelerator="cpu", devices=2, strategy=strategy)
    fabric.launch(_test_memory_sharing_disabled, tensor, model)
Test that the multiprocessing launcher disables memory sharing on model parameters and buffers to avoid race
    conditions on model updates.
tests/tests_fabric/strategies/launchers/test_multiprocessing_integration.py