Harden BYOB config validation#270
Open
fallintoplace wants to merge 1 commit into
Open
Conversation
Contributor
|
Need signoff. |
Author
|
@chrisalexiuk-nvidia Let me have a look and push this. |
(cherry picked from commit df5acc9) Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
fallintoplace
force-pushed
the
fix/byob-config-validation
branch
from
July 8, 2026 18:36
8f9b02b to
f9db7be
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
assertstatements with explicit validation that raisesValueErrorpython -Odoes not silently disable those checksRoot cause
ByobConfig.from_yaml()andByobTranslationConfig.from_yaml()usedassertfor user-facing config validation. Underpython -O, those assertions are stripped entirely, which means required-field and threshold checks can disappear at runtime.What changed
I added a small
_require()helper insrc/nemotron/steps/byob/runtime/config.pyand converted the runtime config validators over to explicit checks. The error messages stay the same, but config failures now consistently surface asValueErroreven when Python optimization is enabled.Validation
python3 -m py_compile src/nemotron/steps/byob/runtime/config.py tests/steps/byob/test_byob_config.pyuv run --no-project --with pytest --with numpy --with pyyaml --with datasets --with requests env PYTHONPATH=src pytest tests/steps/byob/test_byob_config.py