Hi, I’m having a problem specific to GPU. This code works in cpu, but yields “Child terminated with signal 11” when executed in GPU
The class I have is as the following:
class CustomLSTM(torch.nn.Module):
    def __init__(self, input_size=100, embedding_dict_size=466553, batch_size = 25, hidden_size=30, output_dim=2, num_layers=1):
        super(YelpLSTM, self).__init__()
        # Attributes
        self.input_size = input_size # Input size is the length of comment (how many words)
        self.embedding_dict_size = embedding_dict_size # Size of word dictionary
        self.hidden_size = hidden_size
        self.batch_size = batch_size
        self.output_dim = output_dim
        self.num_layers = num_layers

        # Embedding layer
        self.embedding = torch.nn.Embedding(num_embeddings=self.embedding_dict_size, embedding_dim=self.input_size)

        # Construct lstm
        self.lstm = torch.nn.LSTM(input_size=self.input_size, hidden_size=self.hidden_size, num_layers=self.num_layers)

        # Add linear layer for the end
        self.linear = torch.nn.Linear(self.hidden_size, self.output_dim)

    def forward(self, X):
        X = self.embedding(X)
        trans_X = X.transpose(0, 1) # Make it to [sequence length, batch size, input_size]
        hidden_state = torch.zeros(1, len(X), self.hidden_size)
        cell_state = torch.zeros(1, len(X), self.hidden_size)
        outputs, (_, _) = self.lstm(trans_X, (hidden_state, cell_state)) # Something went wrong here from debugging, it's the last line that got executed.
        outputs = self.linear(outputs[-1].view(self.batch_size, -1)) # [Batch x (30*5000)]
        outputs = torch.nn.Sigmoid()(outputs)

        return outputs # Shape: [Batch, 2 (Length of out vector)]

Is there anyone who can help, or has resolved this problem before?
Thank you