code: def test_empty_init_speed():
      """Test that `_EmptyInit()` is faster than regular initialization."""
      t0 = time.perf_counter()
      with _EmptyInit(enabled=False):
          torch.nn.Linear(10000, 10000, device="cuda")
      torch.cuda.synchronize()
      normal_init_time = time.perf_counter() - t0
  
      t0 = time.perf_counter()
      with _EmptyInit(enabled=True):
          torch.nn.Linear(10000, 10000, device="cuda")
      torch.cuda.synchronize()
      empty_init_time = time.perf_counter() - t0
  
      assert normal_init_time > 2 * empty_init_time
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_init.py
imports: import time
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  import torch.nn
  from lightning.fabric.utilities.init import _EmptyInit, _materialize_meta_tensors
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 3 for calling a global function with example usage: test_empty_init_speed() without return types