[tune][minor] gpu warning (#5948)

* gpu

* formaat

* defaults

* format_and_check

* better registration

* fix

* fix

* trial

* foramt

* tune
This commit is contained in:
Richard Liaw
2019-10-19 17:09:48 -07:00
committed by GitHub
parent d23696de17
commit 91acecc9f9
6 changed files with 63 additions and 23 deletions
+6 -1
View File
@@ -93,7 +93,7 @@ class RayTrialExecutor(TrialExecutor):
memory=trial.resources.memory,
object_store_memory=trial.resources.object_store_memory,
resources=trial.resources.custom_resources)(
trial._get_trainable_cls())
trial.get_trainable_cls())
trial.init_logger()
# We checkpoint metadata here to try mitigating logdir duplication
@@ -622,6 +622,11 @@ class RayTrialExecutor(TrialExecutor):
trial.runner.export_model.remote(trial.export_formats))
return {}
def has_gpus(self):
if self._resources_initialized:
self._update_avail_resources()
return self._avail_resources.gpu > 0
def _to_gb(n_bytes):
return round(n_bytes / (1024**3), 2)