-
Notifications
You must be signed in to change notification settings - Fork 51
feat: Expose shutdown options as RunConfig #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+179
−1
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4edb96d
Expose shutdown features to `create(...)`
eric-tramel 69109b5
Tests to verify passthrough of early shutdown properties
eric-tramel e2f4c44
Change to a config type and helper settings
eric-tramel ca4c187
Update tests/interface/test_data_designer.py
eric-tramel 96a3a77
Merge branch 'main' into ewt/control-shutdown
eric-tramel 467c1a8
Update module naming
eric-tramel 8efcc71
Formatting
eric-tramel b68d89f
Backwards Compat for python 3.10
eric-tramel a05f116
Import ordering
eric-tramel 7397bb7
Merge branch 'main' into ewt/control-shutdown
eric-tramel 47376ab
Merge branch 'main' into ewt/control-shutdown
eric-tramel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from pydantic import Field, model_validator | ||
| from typing_extensions import Self | ||
|
|
||
| from data_designer.config.base import ConfigBase | ||
|
|
||
|
|
||
| class RunConfig(ConfigBase): | ||
| """Runtime configuration for dataset generation. | ||
|
|
||
| Groups configuration options that control generation behavior but aren't | ||
| part of the dataset configuration itself. | ||
|
|
||
| Attributes: | ||
| disable_early_shutdown: If True, disables early shutdown entirely. Generation | ||
| will continue regardless of error rate. Default is False. | ||
| shutdown_error_rate: Error rate threshold (0.0-1.0) that triggers early shutdown. | ||
| When early shutdown is disabled, this value is normalized to 1.0. Default is 0.5. | ||
| shutdown_error_window: Minimum number of completed tasks before error rate | ||
| monitoring begins. Must be >= 0. Default is 10. | ||
| """ | ||
|
|
||
| disable_early_shutdown: bool = False | ||
| shutdown_error_rate: float = Field(default=0.5, ge=0.0, le=1.0) | ||
| shutdown_error_window: int = Field(default=10, ge=0) | ||
|
|
||
| @model_validator(mode="after") | ||
| def normalize_shutdown_settings(self) -> Self: | ||
| """Set shutdown_error_rate to 1.0 when early shutdown is disabled.""" | ||
| if self.disable_early_shutdown: | ||
| self.shutdown_error_rate = 1.0 | ||
| return self | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.