Exemplo n.º 1
0
 def gpus_metrics(self) -> Dict[str, float]:
     """
     .. deprecated:: v1.5
         Will be removed in v1.7.
     """
     if self.trainer._device_type == _AcceleratorType.GPU and self.log_gpu_memory:
         mem_map = memory.get_memory_profile(self.log_gpu_memory)
         self._gpus_metrics.update(mem_map)
     return self._gpus_metrics
Exemplo n.º 2
0
def test_multi_gpu_model_ddp_spawn(tmpdir):
    tutils.set_random_main_port()

    trainer_options = dict(
        default_root_dir=tmpdir,
        max_epochs=1,
        limit_train_batches=10,
        limit_val_batches=10,
        gpus=[0, 1],
        strategy="ddp_spawn",
        enable_progress_bar=False,
    )

    model = BoringModel()

    tpipes.run_model_test(trainer_options, model)

    # test memory helper functions
    memory.get_memory_profile("min_max")
Exemplo n.º 3
0
def test_multi_gpu_model_dp(tmpdir):
    tutils.set_random_master_port()

    trainer_options = dict(
        default_root_dir=tmpdir,
        max_epochs=1,
        limit_train_batches=10,
        limit_val_batches=10,
        gpus=[0, 1],
        accelerator="dp",
        progress_bar_refresh_rate=0,
    )

    model = BoringModel()

    tpipes.run_model_test(trainer_options, model)

    # test memory helper functions
    memory.get_memory_profile("min_max")
 def gpus_metrics(self) -> Dict[str, float]:
     """
     .. deprecated:: v1.5
         Will be removed in v1.7.
     """
     if isinstance(self.trainer.accelerator,
                   GPUAccelerator) and self.log_gpu_memory:
         mem_map = memory.get_memory_profile(self.log_gpu_memory)
         self._gpus_metrics.update(mem_map)
     return self._gpus_metrics
Exemplo n.º 5
0
 def gpus_metrics(self) -> Dict[str, float]:
     if self.trainer._device_type == DeviceType.GPU and self.log_gpu_memory:
         mem_map = memory.get_memory_profile(self.log_gpu_memory)
         self._gpus_metrics.update(mem_map)
     return self._gpus_metrics