Revert "[air] remove unnecessary logs + improve repr for result (#26906)" (#26932)

This commit is contained in:
Jiao 2022-07-23 12:12:26 -07:00 committed by GitHub
parent 55a0f7bb2d
commit 3dc4189d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 28 deletions

View file

@ -48,7 +48,7 @@ class RuntimeEnvPluginSchemaManager:
for f in files:
if f.endswith(RAY_RUNTIME_ENV_PLUGIN_SCHEMA_SUFFIX):
schema_json_files.append(os.path.join(root, f))
logger.debug(
logger.info(
f"Loading the default runtime env schemas: {schema_json_files}."
)
cls._load_schemas(schema_json_files)

View file

@ -42,11 +42,6 @@ class Result:
log_dir: Optional[Path]
metrics_dataframe: Optional[pd.DataFrame]
best_checkpoints: Optional[List[Tuple[Checkpoint, Dict[str, Any]]]]
_items_to_repr = ["metrics", "error", "log_dir"]
from ray.tune.result import AUTO_RESULT_KEYS
_metrics_to_hide = AUTO_RESULT_KEYS
@property
def config(self) -> Optional[Dict[str, Any]]:
@ -54,12 +49,3 @@ class Result:
if not self.metrics:
return None
return self.metrics.get("config", None)
def __repr__(self):
shown_attributes = {k: self.__dict__[k] for k in self._items_to_repr}
if self._metrics_to_hide and self.metrics:
shown_attributes["metrics"] = {
k: v for k, v in self.metrics.items() if k not in self._metrics_to_hide
}
kws = [f"{key}={value!r}" for key, value in shown_attributes.items()]
return "{}({})".format(type(self).__name__, ", ".join(kws))

View file

@ -18,8 +18,6 @@ if TYPE_CHECKING:
from ray.data.preprocessor import Preprocessor
_WARN_REPARTITION_THRESHOLD = 10 * 1024 ** 3
def _convert_scaling_config_to_ray_params(
scaling_config: ScalingConfig,
@ -168,17 +166,13 @@ class GBDTTrainer(BaseTrainer):
# TODO: Move this logic to the respective libraries
for dataset_key, dataset in self.datasets.items():
if dataset.num_blocks() < self._ray_params.num_actors:
if dataset.size_bytes() > _WARN_REPARTITION_THRESHOLD:
warnings.warn(
f"Dataset '{dataset_key}' has {dataset.num_blocks()} blocks, "
f"which is less than the `num_workers` "
f"{self._ray_params.num_actors}. "
f"This dataset will be automatically repartitioned to "
f"{self._ray_params.num_actors} blocks. You can disable "
"this error message by partitioning the dataset "
"to have blocks >= number of workers via "
"`dataset.repartition(num_workers)`."
)
warnings.warn(
f"Dataset '{dataset_key}' has {dataset.num_blocks()} blocks, "
f"which is less than the `num_workers` "
f"{self._ray_params.num_actors}. "
f"This dataset will be automatically repartitioned to "
f"{self._ray_params.num_actors} blocks."
)
self.datasets[dataset_key] = dataset.repartition(
self._ray_params.num_actors
)