Repository navigation
feat(slurm): support hosted models through native DD provider settings - #1080
Conversation
Allow hosted endpoints alongside managed models and run hosted-only recipes in CPU allocations. Resolve credentials at runtime and preserve native Data Designer model settings and asynchronous execution. Reuse shard, retry, resume, and collection contracts while preserving existing local-only plan serialization. Add configuration examples, documentation, and native client and allocation lifecycle coverage. Closes #1079 Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
|
All contributors have signed the DCO ✍️ ✅ |
|
Fern preview: https://nvidia-preview-pr-1080.docs.buildwithfern.com/nemo/datadesigner
|
2f19916 to
dfcbbf0
Compare
Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
…tings Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com>
Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Exclude native hosted-provider payloads from recursive Slurm secret\nreference discovery while retaining explicit API-key references.\n\nCover mixed and hosted-only plans with SecretRef-shaped request data,\nincluding missing environment fields and nested lists. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
[High impact] The changes since the previous review appear safe to merge. SummaryThis PR lets Slurm recipes combine local deployments with hosted models from DD’s normal provider settings.
|
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
Reviewed all 43 changed files and their directly affected provider, allocation, client, publication, and export paths. One retry-idempotency regression remains: recovering an already accepted retry now unnecessarily requires submission credentials. The inline finding includes a targeted correction and regression checks.
Static review only; tests were inspected but not executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| export_environment = ( | ||
| self._export_environment | ||
| if dry_run | ||
| else build_run_export_environment(resolved_plan, self._source_environment, operation) |
There was a problem hiding this comment.
[P2] Defer credential validation until a new retry submission is needed
Failure: Submit a hosted-model retry with MODEL_API_KEY available, then repeat the same selection/resume mode from a fresh service with source_environment={} while that retry is pending or running. This unconditional call raises required secret environment 'MODEL_API_KEY' is unavailable before recovery is attempted. Expected: return the accepted job/attempt IDs without another submission or credentials already exported to that job. The coordinator explicitly returns active attempts before submitting, and the existing service regression asserts repeated requests return the same result. This also affects existing server/MCP/dependency secret references.
Correction: Resolve credentials only after the coordinator determines under its locks that a new submission is necessary, but before persisting PREPARED state. Merely skipping validation when preview_active() succeeds is unsafe: the active retry can finish before the coordinator refreshes state.
A targeted implementation is an optional lazy environment factory on SlurmRetryCoordinator, retaining existing explicit-mapping callers:
# Add Callable to collections.abc imports and a keyword-only constructor argument:
export_environment_factory: Callable[[], Mapping[str, str]] | None = None
# Store it in __init__:
self._export_environment_factory = export_environment_factory
# In retry(), inside the selection locks:
self._require_fresh_selection(status, selected)
if self._export_environment_factory is not None:
self._export_environment = dict(self._export_environment_factory())
self._persist_prepared_retry(plan, timestamp)Here, remove eager build_run_export_environment() evaluation and pass the factory instead:
coordinator = SlurmRetryCoordinator(
self._workspace_root,
run_id,
self._launcher,
self._export_environment,
export_environment_factory=lambda: build_run_export_environment(
resolved_plan, self._source_environment, operation
),
)The invariant is that active/pending-submission recovery and dry runs never evaluate the factory; every genuinely new submission does so before publishing PREPARED state. The inspected coordinator returns active attempts before this insertion point and uses the resolved mapping in _submit(). Suggested code is unexecuted and requires author verification.
Preservation / acceptance — proposed checks: Extend the service idempotency setup with a hosted credential: accept retry job 43 using the key, recreate the service without it, and repeat the identical request while job 43 is active. Assert the same result and no third submission. After job 43 fails, requesting a genuinely new retry without the key must fail before creating a new retry record or submitting; restoring the key must export its value at runtime without persisting it. Retain the existing sparse-selection, pinned resume-mode, local-only idempotency, and dry-run-without-persistence assertions.
There was a problem hiding this comment.
Fixed in 9b4ce45d.
Credential resolution now runs through a lazy environment factory inside the coordinator's selection locks, after freshness validation and before PREPARED state is persisted. Dry runs and recovery of active or accepted submissions bypass the factory; existing explicit-environment callers remain supported.
Regression coverage verifies recovery of both pending and running hosted retries from a fresh service without credentials, no additional submission, rejection of genuinely new retries without creating retry records when the key is missing, and successful runtime credential export after restoring the key without persisting its value. The lost-receipt recovery test also verifies the factory is never called during recovery.
Validation: all 2,040 Slurm tests passed, along with Ruff, formatting, diff checks, and commit hooks.
Resolve credentials only when a new retry submission is required, under the coordinator locks and before prepared state is published. Preserve credential-free recovery of active and accepted retries, and cover missing keys, dry runs, and restored credential transport. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Require a nonempty model alias set in resolved builder inputs and reject model-free inline or sourced recipes before staging or submission. Document the limitation and cover omitted, null, and empty model configs while retaining hosted-only CPU run coverage. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
nabinchha
left a comment
There was a problem hiding this comment.
Reviewed the final head, including independent checks of provider configuration, credential transport, hosted-only and mixed runtime behavior, retry recovery, dataset publication, export, and documentation. The identified issues are fixed; no outstanding actionable findings remain.
Validation includes 2,052 passing Slurm tests on the current production code, changed-file lint/format checks, and Fern validation/internal links. Live cluster qualification was not repeated in this review.
This review was generated by an AI assistant.
#1080) * feat(slurm): support external model providers Allow hosted endpoints alongside managed models and run hosted-only recipes in CPU allocations. Resolve credentials at runtime and preserve native Data Designer model settings and asynchronous execution. Reuse shard, retry, resume, and collection contracts while preserving existing local-only plan serialization. Add configuration examples, documentation, and native client and allocation lifecycle coverage. Closes #1079 Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * docs(slurm): describe hosted-only prerequisites Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * fix(slurm): finalize preclaimed datasets and configure node memory Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * fix(slurm): restrict generated datasets before winner publication Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * refactor(slurm): reuse native model-provider settings Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * fix(export): normalize batch column order before Parquet schema casts Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * fix(slurm): validate hosted credentials before capturing provider settings Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> * docs(slurm): align hosted provider plan Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> * fix(slurm): keep provider payloads opaque Exclude native hosted-provider payloads from recursive Slurm secret\nreference discovery while retaining explicit API-key references.\n\nCover mixed and hosted-only plans with SecretRef-shaped request data,\nincluding missing environment fields and nested lists. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> * fix(slurm): defer retry credential validation Resolve credentials only when a new retry submission is required, under the coordinator locks and before prepared state is published. Preserve credential-free recovery of active and accepted retries, and cover missing keys, dry runs, and restored credential transport. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> * fix(slurm): reject model-free runs before submission Require a nonempty model alias set in resolved builder inputs and reject model-free inline or sourced recipes before staging or submission. Document the limitation and cover omitted, null, and empty model configs while retaining hosted-only CPU run coverage. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> * docs(slurm): clarify hosted provider settings Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> --------- Signed-off-by: Dhruv Nathawani <128275431+dhruvnathawani@users.noreply.github.com> Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> Co-authored-by: Nabin Mulepati <nmulepati@nvidia.com>
📋 Summary
Slurm recipes can now use hosted models configured through DD's existing
model_providers.yaml, alongside managed vLLM deployments or in hosted-only CPU allocations. The Slurm run file describes only the models deployed locally; there is no parallel provider schema orinvocation.model_providerssetting.Targets
feat/slurm-execution. Live qualification combines head774774487da6with the independent vLLM version-gate fix in #1086 (3442c185abac). This PR remains draft for review.🔗 Related Issue
Closes #1079. Implements the native-provider ownership and snapshot flow proposed in Nabin's comment.
🔄 Changes
--gres=none, without GPU discovery, serving images, containers, or proxies. Add per-nodesubmission.memoryfor generation/collection.Async execution does not guarantee continuous GPU utilization. Local GPUs remain allocated during hosted requests; separate stages remain appropriate when hosted processing is substantial.
🧪 Testing
make check-all, changed-file Ruff checks, andgit diff --checkpassed.pass, then failed during Parquet consolidation. CPU replay with the export fix preserved all four saved records exactly; the original failed attempt remains preserved.pass, and all four records published and collected. Generation completed with exit code 0; collection also completed with exit code 0 on a CPU allocation with zero GPUs.The small fixture tests provider routing and publication. It does not qualify Gym SQL execution, production SQL data quality, sustained GPU utilization, or a full dataset/SFT rerun.
✅ Checklist