{
  "id": 226843,
  "title": "Error in using TPU",
  "url": "/competitions/bms-molecular-translation/discussion/226843",
  "author_name": "fatma_ahmed303",
  "post_date": "2021-03-17T22:17:39.032000",
  "votes": 2,
  "comment_count": 0,
  "views": 0,
  "content": "<p>please can anyone help me with this error when i use tpu <br>\nif CFG.device == 'TPU':<br>\n    import os<br>\n    os.system('curl <a href=\"https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py\" target=\"_blank\">https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py</a> -o pytorch-xla-env-setup.py')<br>\n    os.system('python pytorch-xla-env-setup.py --version nightly --apt-packages libomp5 libopenblas-dev')<br>\n    os.system('export XLA_USE_BF16=1')<br>\n    import torch_xla.core.xla_model as xm<br>\n    import torch_xla.distributed.parallel_loader as pl<br>\n    import torch_xla.distributed.xla_multiprocessing as xmp<br>\n    CFG.batch_size = CFG.batch_size // CFG.nprocs</p>\n<p>it gives the following error<br>\nImportError: /opt/conda/lib/python3.7/site-packages/_XLAC.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo</p>",
  "messages": [
    {
      "id": 1242897,
      "postDate": "2021-03-17T22:17:39.033Z",
      "content": "<p>please can anyone help me with this error when i use tpu <br>\nif CFG.device == 'TPU':<br>\n    import os<br>\n    os.system('curl <a href=\"https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py\" target=\"_blank\">https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py</a> -o pytorch-xla-env-setup.py')<br>\n    os.system('python pytorch-xla-env-setup.py --version nightly --apt-packages libomp5 libopenblas-dev')<br>\n    os.system('export XLA_USE_BF16=1')<br>\n    import torch_xla.core.xla_model as xm<br>\n    import torch_xla.distributed.parallel_loader as pl<br>\n    import torch_xla.distributed.xla_multiprocessing as xmp<br>\n    CFG.batch_size = CFG.batch_size // CFG.nprocs</p>\n<p>it gives the following error<br>\nImportError: /opt/conda/lib/python3.7/site-packages/_XLAC.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo</p>",
      "rawMarkdown": "please can anyone help me with this error when i use tpu \nif CFG.device == 'TPU':\n    import os\n    os.system('curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py')\n    os.system('python pytorch-xla-env-setup.py --version nightly --apt-packages libomp5 libopenblas-dev')\n    os.system('export XLA_USE_BF16=1')\n    import torch_xla.core.xla_model as xm\n    import torch_xla.distributed.parallel_loader as pl\n    import torch_xla.distributed.xla_multiprocessing as xmp\n    CFG.batch_size = CFG.batch_size // CFG.nprocs\n\nit gives the following error\nImportError: /opt/conda/lib/python3.7/site-packages/_XLAC.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo\n",
      "votes": 2
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1242897": "please can anyone help me with this error when i use tpu \nif CFG.device == 'TPU':\n    import os\n    os.system('curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py')\n    os.system('python pytorch-xla-env-setup.py --version nightly --apt-packages libomp5 libopenblas-dev')\n    os.system('export XLA_USE_BF16=1')\n    import torch_xla.core.xla_model as xm\n    import torch_xla.distributed.parallel_loader as pl\n    import torch_xla.distributed.xla_multiprocessing as xmp\n    CFG.batch_size = CFG.batch_size // CFG.nprocs\n\nit gives the following error\nImportError: /opt/conda/lib/python3.7/site-packages/_XLAC.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo\n"
  }
}