-
Notifications
You must be signed in to change notification settings - Fork 27
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
Will Haste work without CUDA? #2
Comments
At the moment it's CUDA-only but we'll definitely get to a CPU implementation. |
These implementations are written using the PyTorch Python API which allows them to run on any supported device (including CPU). Each layer will automatically choose either the CUDA or generic implementation depending on which device is currently selected for the layer. Issue: #2
You can now use these layers without CUDA. When the layer and input tensor are on CPU, the layer will use the CPU implementation. When the layer and input tensor are on GPU, it will use the fast CUDA implementation. Here's an example of an LSTM on CPU: import torch
import haste_pytorch as haste
batch_size = 128
seq_len = 256
input_size = 128
hidden_size = 256
x = torch.rand(seq_len, batch_size, input_size).cpu()
lstm = haste.LSTM(input_size, hidden_size).cpu()
y, state = lstm(x) Note that all Haste RNN features (e.g. Zoneout, DropConnect) are supported by the CPU implementation as well. |
Can this be used without CUDA? Specifically, I have my laptop for local development and my HPC for actual training. Will the Haste LSTM work on my local as well? (Slower, which is fine, but that way I can maintain one codebase)
The text was updated successfully, but these errors were encountered: