Skip to content
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

Move window tensor to proper device #1171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hhatefi
Copy link

@hhatefi hhatefi commented Oct 4, 2023

When running inference on GPU, Wav2Win._forward_strided fails if x_strided and self._window are on different device. Therefore, self._window should move into the same device as that of x_strided

@pzelasko
Copy link
Collaborator

pzelasko commented Oct 4, 2023

You can move the Wav2Win (or any other module in that file) to device before running the inference. If you're using Fbank, there's an option in the config to place it on the gpu.

@hhatefi
Copy link
Author

hhatefi commented Oct 4, 2023

The problem it not the module, it is self._window which is created by create_frame_window which does not set the device type. Even if the module is loaded into gpu, forward call will fail, if self._window is not in gpu.

@pzelasko
Copy link
Collaborator

pzelasko commented Oct 7, 2023

Wouldn't module = module.to("cuda") solve the issue by placing every registered parameter and buffer on the GPU?

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.

2 participants