Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ gridfm_graphkit evaluate --config path/to/eval.yaml --model_path path/to/model.p
| `--profiler` | `str` | Enable Lightning profiler (`simple`, `advanced`, `pytorch`). | `None` |
| `--compute_dc_ac_metrics` | `flag` | Compute ground-truth AC/DC power balance metrics on the test split. | `False` |
| `--save_output` | `flag` | Save predictions under MLflow artifacts (`.../artifacts/test`). For the PowerFlow task this writes `<grid_name>_predictions.parquet` (bus-level) and `<grid_name>_branch_predictions.parquet` (branch-level flows, thermal loading, and angle violations). | `False` |
| `--output_path` | `str` | Optional custom output directory to save evaluation predictions (when used with `--save_output`). Defaults to MLflow artifacts directory (`artifacts/test`). | `None` |
| `--mp_context` | `str` | DataLoader multiprocessing start method (`spawn`, `fork`, `forkserver`). Defaults to PyTorch's automatic choice. On Linux, `spawn` is recommended for safety (CUDA + fork is unsafe); other choices emit a warning. | `None` |

### Example with saved normalizer stats
Expand Down
1 change: 1 addition & 0 deletions docs/quick_start/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ gridfm_graphkit evaluate --config path/to/eval.yaml --model_path path/to/model.p
| `--profiler` | `str` | Enable Lightning profiler (`simple`, `advanced`, `pytorch`). | `None` |
| `--compute_dc_ac_metrics` | `flag` | Compute ground-truth AC/DC power balance metrics on the test split. | `False` |
| `--save_output` | `flag` | Save predictions under MLflow artifacts (`.../artifacts/test`). For the PowerFlow task this writes `<grid_name>_predictions.parquet` (bus-level) and `<grid_name>_branch_predictions.parquet` (branch-level flows, thermal loading, and angle violations). | `False` |
| `--output_path` | `str` | Optional custom output directory to save evaluation predictions (when used with `--save_output`). Defaults to MLflow artifacts directory (`artifacts/test`). | `None` |
| `--mp_context` | `str` | DataLoader multiprocessing start method (`spawn`, `fork`, `forkserver`). Defaults to PyTorch's automatic choice. On Linux, `spawn` is recommended for safety (CUDA + fork is unsafe); other choices emit a warning. | `None` |

### Example with saved normalizer stats
Expand Down
6 changes: 6 additions & 0 deletions gridfm_graphkit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ def main():
"--converted_config_path",
**_converted_config_path_kwargs,
)
evaluate_parser.add_argument(
"--output_path",
type=str,
default=None,
help="Optional custom output directory to save evaluation predictions. Defaults to MLflow artifacts/test directory.",
)
evaluate_parser.add_argument("--stream-partitions", **_stream_partitions_kwargs)

# ---- PREDICT SUBCOMMAND ----
Expand Down
5 changes: 4 additions & 1 deletion gridfm_graphkit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,10 @@ def main_cli(args):
if args.command == "predict":
output_dir = args.output_path
else:
output_dir = os.path.join(artifacts_dir, "test")
output_dir = getattr(args, "output_path", None) or os.path.join(
artifacts_dir,
"test",
)
os.makedirs(output_dir, exist_ok=True)
first_prediction = predictions[0]
if any(isinstance(value, dict) for value in first_prediction.values()):
Expand Down
Loading
Loading