{
  "id": 494975,
  "title": "Submission code is extremely slow. Need help",
  "url": "/competitions/birdclef-2024/discussion/494975",
  "author_name": "",
  "post_date": "2024-04-19T06:51:01.658851200Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I have been trying to figure out why my submission code is so slow for the last whole day but have not had any success. I did some profiling and found that the inference code, literally the one line <code>output = model(inputs)</code> is the part slowing everything down. DataLoading speeds and everything else seem fine but this part is almost 3-4 times slower than most public notebooks' code taking 10-12+ seconds to run inference on one 4 minute clip compared to most public notebooks which can run at 5 seconds per 4 minute clip. I tried using onnx but it did not help much and even if it did i think my code is unusually slow even before onnx speedup so I want to figure out the issue. Would anyone be willing to look at my code and help? this is the link to my submission code <a href=\"https://www.kaggle.com/code/snehalverma10/birdclef-submission\" target=\"_blank\">https://www.kaggle.com/code/snehalverma10/birdclef-submission</a></p>",
  "messages": [
    {
      "id": "2760217",
      "postDate": "04/19/2024 06:51:01",
      "content": "<p>I have been trying to figure out why my submission code is so slow for the last whole day but have not had any success. I did some profiling and found that the inference code, literally the one line <code>output = model(inputs)</code> is the part slowing everything down. DataLoading speeds and everything else seem fine but this part is almost 3-4 times slower than most public notebooks' code taking 10-12+ seconds to run inference on one 4 minute clip compared to most public notebooks which can run at 5 seconds per 4 minute clip. I tried using onnx but it did not help much and even if it did i think my code is unusually slow even before onnx speedup so I want to figure out the issue. Would anyone be willing to look at my code and help? this is the link to my submission code <a href=\"https://www.kaggle.com/code/snehalverma10/birdclef-submission\" target=\"_blank\">https://www.kaggle.com/code/snehalverma10/birdclef-submission</a></p>",
      "rawMarkdown": "I have been trying to figure out why my submission code is so slow for the last whole day but have not had any success. I did some profiling and found that the inference code, literally the one line `output = model(inputs)` is the part slowing everything down. DataLoading speeds and everything else seem fine but this part is almost 3-4 times slower than most public notebooks' code taking 10-12+ seconds to run inference on one 4 minute clip compared to most public notebooks which can run at 5 seconds per 4 minute clip. I tried using onnx but it did not help much and even if it did i think my code is unusually slow even before onnx speedup so I want to figure out the issue. Would anyone be willing to look at my code and help? this is the link to my submission code https://www.kaggle.com/code/snehalverma10/birdclef-submission",
      "votes": null
    },
    {
      "id": "2760218",
      "postDate": "04/19/2024 06:52:14",
      "content": "<p>I was originally using timm tf_efficientnet_b0_ns. Then i switched to torchvision.models.efficientnetb0 to see if it helped and it did not.</p>",
      "rawMarkdown": "I was originally using timm tf_efficientnet_b0_ns. Then i switched to torchvision.models.efficientnetb0 to see if it helped and it did not.",
      "votes": null
    },
    {
      "id": "2762771",
      "postDate": "04/20/2024 04:53:06",
      "content": "<p>How about this topic?</p>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2024/discussion/492649\" target=\"_blank\">https://www.kaggle.com/competitions/birdclef-2024/discussion/492649</a></p>",
      "rawMarkdown": "How about this topic?\n\nhttps://www.kaggle.com/competitions/birdclef-2024/discussion/492649",
      "votes": null
    },
    {
      "id": "2765593",
      "postDate": "04/21/2024 08:14:14",
      "content": "<p>so - can't tell too much without seeing the model…. I will say that some of my earlier efforts involved adding additional layers to an efficientnet - and adding the layers caused a larger-than-intuitive performance drop.</p>\n<p>If you are adding a bunch of layers - I might look at that first.</p>",
      "rawMarkdown": "so - can't tell too much without seeing the model.... I will say that some of my earlier efforts involved adding additional layers to an efficientnet - and adding the layers caused a larger-than-intuitive performance drop.\n\nIf you are adding a bunch of layers - I might look at that first.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2760218,
      "author_name": "snehalverma10",
      "author_url": "",
      "post_date": "04/19/2024 06:52:14",
      "content": "<p>I was originally using timm tf_efficientnet_b0_ns. Then i switched to torchvision.models.efficientnetb0 to see if it helped and it did not.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2762771,
      "author_name": "goyashuto",
      "author_url": "",
      "post_date": "04/20/2024 04:53:06",
      "content": "<p>How about this topic?</p>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2024/discussion/492649\" target=\"_blank\">https://www.kaggle.com/competitions/birdclef-2024/discussion/492649</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2765593,
      "author_name": "richolson",
      "author_url": "",
      "post_date": "04/21/2024 08:14:14",
      "content": "<p>so - can't tell too much without seeing the model…. I will say that some of my earlier efforts involved adding additional layers to an efficientnet - and adding the layers caused a larger-than-intuitive performance drop.</p>\n<p>If you are adding a bunch of layers - I might look at that first.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2760217": "I have been trying to figure out why my submission code is so slow for the last whole day but have not had any success. I did some profiling and found that the inference code, literally the one line `output = model(inputs)` is the part slowing everything down. DataLoading speeds and everything else seem fine but this part is almost 3-4 times slower than most public notebooks' code taking 10-12+ seconds to run inference on one 4 minute clip compared to most public notebooks which can run at 5 seconds per 4 minute clip. I tried using onnx but it did not help much and even if it did i think my code is unusually slow even before onnx speedup so I want to figure out the issue. Would anyone be willing to look at my code and help? this is the link to my submission code https://www.kaggle.com/code/snehalverma10/birdclef-submission",
    "2760218": "I was originally using timm tf_efficientnet_b0_ns. Then i switched to torchvision.models.efficientnetb0 to see if it helped and it did not.",
    "2762771": "How about this topic?\n\nhttps://www.kaggle.com/competitions/birdclef-2024/discussion/492649",
    "2765593": "so - can't tell too much without seeing the model.... I will say that some of my earlier efforts involved adding additional layers to an efficientnet - and adding the layers caused a larger-than-intuitive performance drop.\n\nIf you are adding a bunch of layers - I might look at that first."
  },
  "source": "meta"
}