Diff Coverage

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

Source File Diff Coverage (%) Missing Lines
hyper_parallel/compile/__init__.py 100%  
hyper_parallel/compile/compiler.py 100%  
hyper_parallel/compile/examples/automodel_tp/train.py 0.0% 277-278
hyper_parallel/compile/graph_parallel_plan.py 94.1% 187,193,234,283-284
hyper_parallel/compile/passes/parallel/fsdp_pass.py 100%  
hyper_parallel/compile/passes/parallel/pp_pass.py 100%  
hyper_parallel/compile/passes/pipeline.py 83.3% 85
hyper_parallel/compile/trainer.py 100%  
hyper_parallel/compile/examples/automodel_tp/train.py
273
274
275
276
277
278
279
280
281
282
            "attention, no patch needed"
        )

    # 4. FSDP plan for the graph-mode FSDPPass (mark everything).
    fsdp_plan = GraphParallelPlan()
    fsdp_plan.fsdp_mark_pattern("*")

    # 5. GraphTrainer reuses the automodel mesh (tp group already created);
    #    it registers the dp sub-mesh as "fsdp" and back-fills fsdp_degree.
    tcfg = cfg["train"]
hyper_parallel/compile/graph_parallel_plan.py
183
184
185
186
187
188
189
190
191
        raise ValueError("Must provide either config_path or model_name")

    if config_path is None:
        if not model_name or not isinstance(model_name, str):
            raise ValueError("model_name must be a non-empty string")
        if ".." in model_name or "/" in model_name or "\\" in model_name:
            raise ValueError(
                f"Invalid model_name '{model_name}': must not contain path "
                "separators or parent directory references"
189
190
191
192
193
194
195
196
197
            raise ValueError(
                f"Invalid model_name '{model_name}': must not contain path "
                "separators or parent directory references"
            )
        config_path = DEFAULT_CONFIG_DIR / model_name / "config.yaml"
    else:
        config_path = Path(config_path)

    if not config_path.exists():
230
231
232
233
234
235
236
237
238
    section = config.get(key) or {}
    if not isinstance(section, dict):
        # A present-but-empty section parses to None and is normalized to {}
        # above, so anything landing here is a real scalar/sequence typo.
        raise ValueError(
            f"YAML '{key}' section must be a mapping (e.g. nested keys or an "
            f"empty section); got {type(section).__name__} in {config_path}"
        )
    return section
279
280
281
282
283
284
285
286
287
288
        if isinstance(stage, dict):
            stage_idx = stage.get("stage", idx)
            module_fqns = list(stage.get("modules", []))
        else:
            stage_idx = idx
            module_fqns = list(stage)
        plan.pp_stage(stage_idx, module_fqns)


def create_all_fsdp_plan() -> GraphParallelPlan:
hyper_parallel/compile/passes/pipeline.py
81
82
83
84
85
86
87
88
89
        # 2. Execution layer: Parallel dimension partitioning
        if getattr(self.config, "fsdp_enabled", False):
            self.passes.append(FSDPPass(parallel_plan=self.parallel_plan))
        if getattr(self.config, "pp_enabled", False):
            self.passes.append(PpPass(parallel_plan=self.parallel_plan))

        # 3. Communication-compute overlap optimization
        if getattr(self.config, "enable_overlap", False):
            self.passes.append(AutoOverlapPass())