Skip to content

Conversation

@NielsRogge
Copy link
Contributor

@NielsRogge NielsRogge commented Mar 5, 2022

What does this PR do?

This PR fixes the integration test of ViTMAE, which only passed on CPU.

ViTMAE uses randomness inside (it creates a random boolean mask to indicate which patches to mask). I used torch.manual_seed(2) to make this deterministic, however I learned that using the same seed across CPU/GPU will not result in the same random numbers (as both use a different random number generator).

Hence, this PR sets the expected slice depending on the device.

Huge thanks to @ydshieh for helping me out finding this.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@NielsRogge NielsRogge requested a review from LysandreJik March 5, 2022 09:23
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

LGTM

@NielsRogge NielsRogge merged commit b19f3e6 into huggingface:master Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants