Diff Coverage

Diff: origin/master...HEAD, staged and unstaged changes

Source File Diff Coverage (%) Missing Lines
hyper_parallel/auto_parallel/sapp_nd/nd/common/_cost_model_variables.py 100%  
hyper_parallel/auto_parallel/sapp_nd/nd/run_nd.py 77.8% 39,43-44,46
hyper_parallel/auto_parallel/sapp_ppb/sapp/sapp_solver.py 100%  
hyper_parallel/auto_parallel/sapp_ppb/utils/config.py 100%  
hyper_parallel/auto_parallel/sapp_nd/nd/run_nd.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    config-adapter reader: the world size lives in ``context.device_num``,
    not in the AutoModels accelerator section.
    """
    if not path or not os.path.isfile(path):
        return None
    try:
        with open(path, "r", encoding="utf-8") as handle:
            raw = yaml.safe_load(handle)
    except (OSError, yaml.YAMLError):
        return None
    if not isinstance(raw, dict):
        return None
    context = raw.get("context")
    if not isinstance(context, dict) or context.get("device_num") is None:
        return None
    return int(context["device_num"])