Skip to content

Move window tensor to proper device - #1171

Open
hhatefi wants to merge 1 commit into
lhotse-speech:masterfrom
hhatefi:master
Open

Move window tensor to proper device#1171
hhatefi wants to merge 1 commit into
lhotse-speech:masterfrom
hhatefi:master

Conversation

@hhatefi

@hhatefi hhatefi commented Oct 4, 2023

Copy link
Copy Markdown

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

pzelasko commented Oct 4, 2023

Copy link
Copy Markdown
Collaborator

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

hhatefi commented Oct 4, 2023

Copy link
Copy Markdown
Author

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

pzelasko commented Oct 7, 2023

Copy link
Copy Markdown
Collaborator

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