{
  "id": 182154,
  "title": "TPUs running slower than GPUs! Reason?",
  "url": "/competitions/landmark-recognition-2020/discussion/182154",
  "author_name": "",
  "post_date": "2020-09-11T13:48:09.167656800Z",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>using following code</p>\n<p>import torch_xla<br>\nimport torch_xla.core.xla_model as xm<br>\ndevice = xm.xla_device(n=4, devkind='TPU')<br>\nmodel = model.to(device)<br>\nmodel = nn.DataParallel()</p>",
  "messages": [
    {
      "id": "1006693",
      "postDate": "09/11/2020 13:48:09",
      "content": "<p>using following code</p>\n<p>import torch_xla<br>\nimport torch_xla.core.xla_model as xm<br>\ndevice = xm.xla_device(n=4, devkind='TPU')<br>\nmodel = model.to(device)<br>\nmodel = nn.DataParallel()</p>",
      "rawMarkdown": "using following code\n\nimport torch_xla\nimport torch_xla.core.xla_model as xm\ndevice = xm.xla_device(n=4, devkind='TPU')\nmodel = model.to(device)\nmodel = nn.DataParallel()",
      "votes": null
    },
    {
      "id": "1006732",
      "postDate": "09/11/2020 14:09:49",
      "content": "<p>Hello <a href=\"https://www.kaggle.com/sanjaydsb\" target=\"_blank\">@sanjaydsb</a> </p>\n<p>Larger models will illustrate the TPU and GPU performance better. Your example also is including the compilation time in the cost of the TPU call: every call after the first for a given program and shape will be cache.</p>\n<p>A solution could be to increase the number of workers.</p>",
      "rawMarkdown": "Hello @sanjaydsb \n\nLarger models will illustrate the TPU and GPU performance better. Your example also is including the compilation time in the cost of the TPU call: every call after the first for a given program and shape will be cache.\n\nA solution could be to increase the number of workers.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1006732,
      "author_name": "trikialaaa",
      "author_url": "",
      "post_date": "09/11/2020 14:09:49",
      "content": "<p>Hello <a href=\"https://www.kaggle.com/sanjaydsb\" target=\"_blank\">@sanjaydsb</a> </p>\n<p>Larger models will illustrate the TPU and GPU performance better. Your example also is including the compilation time in the cost of the TPU call: every call after the first for a given program and shape will be cache.</p>\n<p>A solution could be to increase the number of workers.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1006693": "using following code\n\nimport torch_xla\nimport torch_xla.core.xla_model as xm\ndevice = xm.xla_device(n=4, devkind='TPU')\nmodel = model.to(device)\nmodel = nn.DataParallel()",
    "1006732": "Hello @sanjaydsb \n\nLarger models will illustrate the TPU and GPU performance better. Your example also is including the compilation time in the cost of the TPU call: every call after the first for a given program and shape will be cache.\n\nA solution could be to increase the number of workers."
  },
  "source": "meta"
}