Skip to content

Update torchmultimodal test golden values after trunc_normal_ change#539

Closed
albanD wants to merge 1 commit intofacebookresearch:mainfrom
albanD:export-D95591588
Closed

Update torchmultimodal test golden values after trunc_normal_ change#539
albanD wants to merge 1 commit intofacebookresearch:mainfrom
albanD:export-D95591588

Conversation

@albanD
Copy link
Copy Markdown

@albanD albanD commented Mar 6, 2026

Summary:
D94908913 changed torch.nn.init.trunc_normal_ from erfinv-based
to rejection-sampling, which produces different numerical outputs
with the same seed. This updates the hardcoded golden values in
torchmultimodal tests to match the new implementation.

Updated tests:

  • test_albef.py: image_embeddings, image_embeddings_momentum,
    multimodal_embeddings, multimodal_embeddings_momentum
  • test_image_encoder.py: test_vision_transformer
  • test_omnivore.py: swin_t, swin_s, swin_b forward tests
  • test_swin_transformer_3d_encoder.py: test_swin_transformer_3d_encoder
  • test_vision_transformer.py: test_vision_transformer_patch_drop

Partial fix for T258469553

Differential Revision: D95591588

Summary:
D94908913 changed `torch.nn.init.trunc_normal_` from erfinv-based
to rejection-sampling, which produces different numerical outputs
with the same seed. This updates the hardcoded golden values in
torchmultimodal tests to match the new implementation.

Updated tests:
- test_albef.py: image_embeddings, image_embeddings_momentum,
  multimodal_embeddings, multimodal_embeddings_momentum
- test_image_encoder.py: test_vision_transformer
- test_omnivore.py: swin_t, swin_s, swin_b forward tests
- test_swin_transformer_3d_encoder.py: test_swin_transformer_3d_encoder
- test_vision_transformer.py: test_vision_transformer_patch_drop

Partial fix for T258469553

Differential Revision: D95591588
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 6, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 6, 2026

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

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 Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant