Repository navigation
[Core] Validate coverage for declared partitioned inputs in framework-native training - #128
Conversation
Add declared input role routes and validate worker coverage before Framework Native training reports success or publishes a required bundle. Signed-off-by: jiangxt2 <jiangxt2@vip.qq.com>
[Medium impact] Adds input role validation to the framework-native training runtime. The PR appears safe to merge, with a non-blocking gap in the new integration test.
|
| workers = [ | ||
| { | ||
| "worker_id": f"{run_id}-worker-{rank}", | ||
| "node_id": f"ray-node-{rank}", | ||
| "rank": rank, | ||
| "world_size": 2, | ||
| "shard_id": f"{run_id}-shard-{rank}", | ||
| "rows_processed": len(train_rows[rank]), | ||
| "input_rows": { | ||
| "train": len(train_rows[rank]), | ||
| "validation": len(validation_rows[rank]), | ||
| }, | ||
| "model_state_digest": "a" * 64, | ||
| "resources": {"num_cpus": 1.0, "num_gpus": 0.0, "custom": {}}, |
There was a problem hiding this comment.
Coverage gate skips real training
The job builds both worker records on the driver, invents their node IDs, and calls the private coverage helpers directly. It never runs FrameworkNativeRuntime.execute or a trainer, so it can pass even if the runtime stops checking coverage after a real fit. Run a small framework-native trainer and collect counts and row IDs inside its workers, then check the resulting evidence.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/training/jobs/framework_native_input_coverage_job.py
Line: 61-74
Comment:
**Coverage gate skips real training**
The job builds both worker records on the driver, invents their node IDs, and calls the private coverage helpers directly. It never runs `FrameworkNativeRuntime.execute` or a trainer, so it can pass even if the runtime stops checking coverage after a real fit. Run a small framework-native trainer and collect counts and row IDs inside its workers, then check the resulting evidence.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Description
Add a public alpha Framework Native input route contract and validate declared input-role coverage before a run reports success or publishes a required Bundle. Partitioned roles are checked by summing worker counts; replicated roles are checked against the canonical row count on each worker. The runtime reuses InputCoverageContract, counts routed datasets before trainer construction, and validates staged and cross-fit evidence. The legacy single-train plan remains compatible.
Cross-fit worker evidence aggregates row counts across folds and identifies that scope in state details. The generated API reference and manual Ray Jobs suite inventory are updated.
Related issues
Fixes #121
Additional information