Commit bbfdc182 authored by Fei Sun's avatar Fei Sun Committed by Facebook GitHub Bot
Browse files

Optimization integration to d2go

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/595

Integrate the Genie optimization module to d2go. Currently only GC is added. Once the integration is successful, more optimizations may be added.

Reviewed By: XiaoliangDai

Differential Revision: D47502855

fbshipit-source-id: ec4bf60bb047463a2c310c7510d66620d801dd29
parent 461b6a80
...@@ -8,6 +8,7 @@ from d2go.config.config import ( ...@@ -8,6 +8,7 @@ from d2go.config.config import (
CfgNode, CfgNode,
CONFIG_CUSTOM_PARSE_REGISTRY, CONFIG_CUSTOM_PARSE_REGISTRY,
CONFIG_SCALING_METHOD_REGISTRY, CONFIG_SCALING_METHOD_REGISTRY,
convert_cfg_to_dict,
load_full_config_from_file, load_full_config_from_file,
temp_defrost, temp_defrost,
temp_new_allowed, temp_new_allowed,
...@@ -20,6 +21,7 @@ __all__ = [ ...@@ -20,6 +21,7 @@ __all__ = [
"CONFIG_SCALING_METHOD_REGISTRY", "CONFIG_SCALING_METHOD_REGISTRY",
"CfgNode", "CfgNode",
"auto_scale_world_size", "auto_scale_world_size",
"convert_cfg_to_dict",
"load_full_config_from_file", "load_full_config_from_file",
"reroute_config_path", "reroute_config_path",
"temp_defrost", "temp_defrost",
......
...@@ -190,3 +190,13 @@ def load_full_config_from_file(filename: str) -> CfgNode: ...@@ -190,3 +190,13 @@ def load_full_config_from_file(filename: str) -> CfgNode:
cfg = loaded_cfg.get_default_cfg() cfg = loaded_cfg.get_default_cfg()
cfg.merge_from_other_cfg(loaded_cfg) cfg.merge_from_other_cfg(loaded_cfg)
return cfg return cfg
def convert_cfg_to_dict(cfg):
if not isinstance(cfg, CfgNode):
return cfg
else:
cfg_dict = dict(cfg)
for k, v in cfg_dict.items():
cfg_dict[k] = convert_cfg_to_dict(v)
return cfg_dict
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment