Repository: pytorch
Issue: RuntimeError: Caught RuntimeError in replica 1 on device 1.
Labels: needs reproduction,triaged,module: data parallel

## 🐛 Bug

version 1.4 OK, 1.6 Bug
mutil-GPU  torch.nn.DataParallel(model)
======================================

Traceback (most recent call last):
  File "/home/zy/CODE/bishe/glyce/glyce/bin/run_bert_glyce_classifier.py", line 421, in <module>
    main()
  File "/home/zy/CODE/bishe/glyce/glyce/bin/run_bert_glyce_classifier.py", line 412, in main
    train(model, optimizer, train_loader, dev_loader, test_loader, config, device, n_gpu, label_list)
  File "/home/zy/CODE/bishe/glyce/glyce/bin/run_bert_glyce_classifier.py", line 244, in train
    loss, glyph_loss = model(input_ids, segment_ids, input_mask, label_ids)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 155, in forward
    outputs = self.parallel_apply(replicas, inputs, kwargs)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 165, in parallel_apply
    return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply
    output.reraise()
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/_utils.py", line 395, in reraise
    raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in replica 1 on device 1.
Original Traceback (most recent call last):
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 60, in _worker
    output = module(*input, **kwargs)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/zy/CODE/bishe/glyce/glyce/models/glyce_bert/glyce_bert_classifier.py", line 55, in forward
    token_type_ids=token_type_ids, attention_mask=attention_mask)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/zy/CODE/bishe/glyce/glyce/layers/glyce_transformer.py", line 62, in forward
    glyph_embed, glyph_cls_loss = self.glyph_embedder(input_ids, token_type_ids=token_type_ids)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/zy/CODE/bishe/glyce/glyce/layers/glyph_position_embed.py", line 61, in forward
    glyph_embeddings, glyph_cls_loss = self.glyph_encoder(input_ids)
  File "/home/zy/anaconda3/envs/p16/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/zy/CODE/bishe/glyce/glyce/layers/char_glyph_embedding.py", line 138, in forward
    emb = torch.cat(all_embeddings, -1)  # seql, batch, feat*2
RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat.  This usually means that this function requires a non-empty list of Tensors.  Available functions are [CPU, CUDA, QuantizedCPU, Autograd, Profiler, Tracer, Autocast]




 - PyTorch Version (e.g., 1.0): 1.6
 - OS (e.g., Linux): linux 
 - How you installed PyTorch (`conda`, `pip`, source): conda
 - Build command you used (if compiling from source):
 - Python version:
 - CUDA/cuDNN version:
 - GPU models and configuration:
 - Any other relevant information: