Skip to content

Conversation

@JenniferWang
Copy link
Contributor

Summary:

  • Fix the weight update test
  • Extract common logic to a separate util function; see the next diff D87083010 for how to use them in verifying weights do get updated as part of infra verification when debugging a buggy run.

Differential Revision: D87005971

@meta-codesync
Copy link

meta-codesync bot commented Nov 14, 2025

@JenniferWang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87005971.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2025
facebook-github-bot pushed a commit that referenced this pull request Nov 15, 2025
Summary:

* Fix the weight update test 
* Extract common logic to a separate util function; see the next diff D87083010 for how to use them in verifying weights do get updated as part of infra verification when debugging a buggy run.

Reviewed By: casteryh

Differential Revision: D87005971
Summary:

* Fix the weight update test 
* Extract common logic to a separate util function; see the next diff D87083010 for how to use them in verifying weights do get updated as part of infra verification when debugging a buggy run.

Reviewed By: casteryh

Differential Revision: D87005971


@dataclass
class WeightVerificationResult:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't this + the function verify_weights_changed belong in tests? I see no reason users should have access to this as a public API.

Copy link
Contributor Author

@JenniferWang JenniferWang Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See D87083010 on how we use it in verifying the infra set up -- for example, users want to write their own RL loop and want to verify that the weight sync is happening as expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider this a bit of an anti-pattern. The expectation for an API is that it does what it says it does. If we have an API that says it updates weights, the onus is on us to ensure that it actually does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a slightly different opinion -- for example, how to verify that the Generator model is initialized with the correct weight when resuming from checkpointing? Every single component can potentially do the right thing but the user may configured something wrong.

# TODO: Remove below param
_test_prev_params = {}

def __post_init__(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required to make the logger.info print to stdout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants