Thanks for reply. I have fix this problem by changing the model input. Previously, I directly put torchtext iterator object into the model:
for batch_idx, batch in enumerate(self.data_loader.train_iter):
    output = self.model(batch)

Then I modified the code and it works：
for batch_idx, batch in enumerate(self.data_loader.train_iter):
    input_data = {
            'q_word': batch.q_word[0],
            'q_lens': batch.q_word[1],
            'paras_word': batch.paras_word[0],
            'paras_num': batch.paras_word[1],
            'paras_lens': batch.paras_word[2],
        }
    output = self.model(input_data)

Or like this:
for batch_idx, batch in enumerate(self.data_loader.train_iter):
    output = self.model(batch.q_word[0], batch.q_word[1], \
                        batch.paras_word[0], batch.paras_word[1], batch.paras_word[2])

All the value of the input_data are tensor.
I think the key problem is that you should feed tensor or a dic of tensors so that the DataParallel model can find the tensor and split the dimension in  dim0.
I think that DataParallel should at least gives a warninig when the DataParallel can’t find any tensor that can be split in dim0