feat: compile deterministic Slurm run plans - #893
Conversation
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Greptile SummaryThe PR adds strict Slurm configuration loading and building, resolves authored inputs into immutable effective configuration, and compiles deterministic run plans.
|
| Filename | Overview |
|---|---|
| packages/data-designer-slurm/src/data_designer/slurm/config/loading.py | Adds strict JSON/YAML loading, interpolation rejection, profile-file resolution, and deterministic profile selection. |
| packages/data-designer-slurm/src/data_designer/slurm/config/builder.py | Adds a fluent builder for constructing and serializing strict authored Slurm configurations. |
| packages/data-designer-slurm/src/data_designer/slurm/planning/resolution.py | Resolves authored configuration and supplied environmental facts into validated effective planning inputs. |
| packages/data-designer-slurm/src/data_designer/slurm/planning/compiler.py | Compiles effective configuration into deterministic deployment, client, port, shard, and artifact records. |
| packages/data-designer-slurm/src/data_designer/slurm/planning/validation.py | Enforces consistency between authored inputs, dependency locks, builder payloads, and compiled plans. |
| packages/data-designer-slurm/src/data_designer/slurm/contracts.py | Extends immutable contracts with hidden validation inputs and persisted-JSON digest support. |
| uv.lock | Updates the workspace lockfile for the Slurm package’s direct PyYAML dependency. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Authored Slurm config] --> B[Strict loading and validation]
B --> C[Resolved effective configuration]
C --> D[Deterministic plan compiler]
D --> E[Immutable Slurm run plan]
E --> F[Runtime and submission boundaries]
Reviews (4): Last reviewed commit: "fix: unify Slurm builder artifact identi..." | Re-trigger Greptile
Reject unsupported multi-shard semantics and managed output collisions at the effective configuration boundary. Normalize config errors and cover the corrected Big Iron field disposition. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Thanks for putting this together, @andreatnvidia — the separation between authored configuration, effective resolution, and deterministic compilation is a strong foundation. SummaryThis PR adds strict JSON/YAML loading, a fluent authored-config builder, profile resolution, and a pure compiler that reproduces the existing single- and multi-node plan contracts byte-for-byte. The broad implementation matches the PR’s stated intent, but a few configuration and identity invariants still need to be enforced before these plans are safe to submit. FindingsCritical — Let's fix these before merge
Warnings — Worth addressing
What Looks Good
VerdictNeeds changes — please address the shutdown-default bug and validation-error secret disclosure before merge, then close the multi-shard plugin gap, require complete model/deployment coverage, and bind sourced payload bytes to their recorded digest. This review was generated by an AI assistant. |
Preserve partial early-shutdown intent and hide secret values in validation errors. Reject unsafe sharding semantics, require exact deployment coverage, and bind sourced payload identity. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Preserve all authored early-shutdown controls and reject direct effective invocation drift. Bind shard partition digests to deterministic persisted JSON bytes. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Addressed all five cases in
|
|
Thanks, @nabinchha. I addressed all five findings in the latest head, including regression coverage for inline and sourced builders. Partial early-shutdown settings are preserved, validation errors no longer expose secret inputs, unsafe multi-shard semantics are rejected conservatively, deployment aliases must exactly cover declared models, and sourced payload bytes, digests, and aliases are now bound at the effective-config boundary. I also cross-checked the changes against the current #890-#892 heads to keep the ownership boundaries intact. |
|
Thanks for the follow-up, @andreatnvidia. I restarted the review from the current SummaryThe five issues from the first review have targeted fixes, and the submitted tests are green. The deeper pass found two correctness/security gaps that those fixes do not cover, plus several public-interface and ownership decisions that need to be settled while this API is new. Because these choices define serialized contracts and public compatibility commitments, the design findings below are merge-blocking rather than optional follow-up cleanup. Verification remains clean for the submitted suite: 469 Slurm tests pass in the isolated source worktree with only the two installed-package entry-point checks excluded, and standard Ruff lint, Ruff format, and FindingsCritical — Let's fix these before merge
Warnings — Worth addressing
What Looks Good
VerdictNeeds changes — please close the remaining secret-disclosure paths and remove submission-time inference over opaque plugin payloads before merge. The public field names, exception names, module boundary, compiler entry points, validation ownership, builder types, and digest vocabulary are also merge-blocking design decisions because deferring them would lock avoidable complexity into the serialized and public APIs. This review was generated by an AI assistant. |
|
Thanks for the quick follow-up, @andreatnvidia — the boundary cleanup addresses several important parts of the previous review. SummaryI re-reviewed the two commits after FindingsCritical — Let's fix these before merge
Warnings — Worth addressing
What Looks Good
VerdictNeeds changes — the new effective-input bypass must be closed before merge, and the supported planning API needs to be explicit enough that callers cannot accidentally skip resolution. The previously reported lifecycle/artifact field names and Python builder-surface decisions also remain open compatibility choices. This review was generated by an AI assistant. |
|
Thanks, @nabinchha. I addressed the remaining correctness/security gaps and the plan-aligned ownership items in Config, builder, resolution, and compilation boundaries now sanitize parser and Pydantic failures without forwarding raw messages or unsafe causes. The regressions cover malformed YAML, custom-validator values, and profile-selection validation containing secret sentinels. Planning now inspects only aliases declared in I also split configuration resolution from compilation, moved builder identity out of the record module, scoped the error types, reduced the package-root API, preserved contract-error classification, and made I reconciled the broader recommendations against the agreed migration plan and current #890-#892 heads. I retained I also ran an independent follow-up review against those constraints after the changes; it found no remaining blockers or regressions. Could you take another look at the latest head? |
|
Thanks, @andreatnvidia. GitHub is still showing 079da69 as the PR head—the same head I reviewed after those two commits—and the direct effective-input invariant bypass reproduces there. Do you have additional commits locally that haven’t been pushed yet? |
📋 Summary
Compile strict authored Slurm configuration and explicitly resolved inputs into an immutable, deterministic run plan before submission. This lands the M0 configuration-resolution and planning slice without taking ownership of serving, image discovery, scheduler execution, runtime rendering, or state transitions.
🔗 Related Issue
Closes #875
🔄 Changes
🔍 Attention Areas
🧪 Testing
make testpasses (not invoked because it usesuv run; the equivalent direct four-package suite passed with 4,552 tests and one skip).venv/bin/ruff check --fix .and.venv/bin/ruff format .passmake check-slurmpasses✅ Checklist