Repository navigation
Conversation
load_response_dataset instantiates with dataset_class(**data_config) and every built-in loader accepts **kwargs, so a standard ResponseDatasetConfig key the class does not support is swallowed with no feedback — e.g. subset: socratic on gsm8k silently loads the hardcoded 'main' config, and split_validation_size/seed silently do nothing on the 12 loaders that never call split_train_validation. Add a dispatcher-level guard that warns when a user-set behavioral key (subset, split, split_validation_size, seed) is not declared anywhere in the resolved class's __init__ MRO. MRO-aware so kwargs-forwarding subclasses (intent datasets) are not flagged; functools.partial registry entries (AIME variants) are unwrapped; None values and a falsy split_validation_size are skipped to keep documented config boilerplate quiet. Closes NVIDIA-NeMo#3270 Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Tianyi Zhang <[email protected]>
|
Thanks a lot for adding this, @tianyi-zhang-02 ! Could we also apply warn_on_unsupported_dataset_config_keys() in load_preference_dataset()? It uses the same dataset_class(**data_config) pattern and is vulnerable to the same silent swallowing of unsupported keys—for example, Eval datasets are not yet using a fully unified loading format: some go through load_response_dataset(), while the remaining eval-specific loaders still use the legacy dispatcher. I think it is reasonable to defer the eval-side check and track it as pending under #2840, where the eval datasets are being consolidated into the response dataset registry. |
Address review on NVIDIA-NeMo#3271: - Expand _BEHAVIORAL_DATASET_CONFIG_KEYS to all constructor-consumed keys from ResponseDatasetConfig / PreferenceDatasetConfig (data_path, input_key, output_key, download_dir, prompt_key, chosen_key, rejected_key in addition to the original four). Audited every shipped examples/configs usage against the declaring loaders: no new warnings (OpenMathInstruct-2/output_key, NemoGymDataset/data_path, mmpr-tiny/download_dir all declare their keys). - Apply the same guard in load_preference_dataset (same dataset_class(**data_config) pattern; e.g. Tulu3PreferenceDataset silently ignored a configured split). Eval-side deferred to the NVIDIA-NeMo#2840 registry consolidation per review discussion. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Tianyi Zhang <[email protected]>
|
Done in |
|
LGTM! Thanks a lot for adding this. Trigger CI now. |
|
/ok to test ce56cf9 |
|
cc @RayenTian. Thanks! The |
yuki-97
left a comment
There was a problem hiding this comment.
LGTM, thanks for adding this @tianyi-zhang-02
|
/ok to test e466eae |
What does this PR do ?
load_response_datasetinstantiates withdataset_class(**data_config), and every built-in loader accepts**kwargs— so a standardResponseDatasetConfigkey the class doesn't support is silently swallowed. E.g.subset: socraticongsm8ksilently loads the hardcodedmainconfig, andsplit_validation_size/seedsilently do nothing on the 12 loaders that never callsplit_train_validation(while the SFT guide documents them as generic keys).This adds a dispatcher-level guard,
warn_on_unsupported_dataset_config_keys, that warns when a user-set behavioral key (subset,split,split_validation_size,seed) is not declared anywhere in the resolved class's__init__MRO.Design notes:
kwargs-forwarding subclasses that delegate to a declaring base (the intent datasets) are not flagged.functools.partialregistry entries (AIME variants) are unwrapped before inspection.Nonevalues and falsysplit_validation_sizeare skipped, so documented config boilerplate (subset: null,split_validation_size: 0) stays quiet — none of the shippedexamples/configsemit warnings.kwargs.get(...)without declaring it in any__init__signature would see a spurious warning. None of the built-in loaders do this (verified), and it's warning-only by design — but flagging it for review. Scoped to the response dispatcher; the preference dispatcher has the same pattern and can adopt the shared helper as a follow-up.Issues
Closes #3270. Generalizes the failure mode @RayenTian flagged in the #3131 review.
Usage
Before your PR is "Ready for review"
None/0quiet; MRO forwarding quiet;partialunwrapped; non-class input safe) plus an end-to-end dispatcher test, intests/unit/data/datasets/test_response_dataset_registry.py(registry-dispatch scope).ruff check/ruff format --checkclean;pyrefly==0.24.2(CI-pinned) reports no new errors on the two whitelisted files touched.cc @RayenTian @yuki-97