-
Notifications
You must be signed in to change notification settings - Fork 22
feat(policies): per-dataset normalization + skip-stats safetensors flag #336
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
265aa9f
feat(policies): per-dataset normalization + skip-stats safetensors flag
shuheng-liu 1101728
test: strip wrapper-injected keys before mixture sample equality check
shuheng-liu d054809
fix(policies): default to dataset 0 for single-dataset policies in _r…
shuheng-liu dd2db97
test: pass explicit dataset_index when calling Normalize submodules d…
shuheng-liu f8c7492
fix(policies): address reviewer's 5 blockers + edge cases on per-data…
shuheng-liu e8fa45d
fix(policies): address second-round review — device source-of-truth, …
shuheng-liu 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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocker —
cfg.policy.type = "value"immediately raisesTypeError.The PR description says the
valuepolicy is "out of scope and unchanged", but the factory now unconditionally passesper_dataset_stats=anddataset_names=to every policy class.ValueFunction.__init__(policies/value/modeling_value.py:124-138) still has the old signature:So
make_policy(cfg, ds_meta=...)withcfg.type='value'triggers:Even if that were fixed,
ValueFunction.__init__still callsNormalize(config.input_features, config.normalization_mapping, dataset_stats)—dataset_statsis the 3rd positional arg, which is nowper_dataset_stats: list[...]. Passing adictthere would either crash increate_stats_buffers(which iterateslen(per_dataset_stats)as if it's a list) or worse, silently produce nonsense buffer shapes. Andself.normalize_inputs(batch)insideforwardis now missing thedataset_indexpositional arg.Either: (a) update
ValueFunctionto the new API so "unchanged" becomes true, (b) carvevalueout of the per_dataset_stats kwarg passing in this factory and keep the legacy path, or (c) explicitly raise NotImplementedError whencfg.type=='value'lands in this branch so it fails loudly with a useful message instead of a generic TypeError.Generated by Claude Code