{
  "id": 199583,
  "title": "Our GPU rasterizer",
  "url": "/competitions/lyft-motion-prediction-autonomous-vehicles/discussion/199583",
  "author_name": "",
  "post_date": "2020-11-26T10:04:09.912804600Z",
  "votes": 27,
  "comment_count": 9,
  "views": 0,
  "content": "<p>In this post, you can read more details about our C++/CUDA rasterization solution. I published the <a href=\"https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch\" target=\"_blank\">source code</a> and a basic tutorial on implementing all of this.</p>\n<h2>Speed</h2>\n<p>In short, rasterizing on the GPU is at least 2x faster. With a longer history, higher image size, the difference is even more significant. If you add some tricks, you can achieve ~4x speedup.<br>\n(Of course, this highly depends on your environment, the available RAM, GPU, number of CPU, etc.)</p>\n<h2>Our final output images</h2>\n<p><em>Note</em>: The following modifications are more or less just our assumptions (not the result of precise testing). We made these changes in the rasterized outputs:</p>\n<ul>\n<li>No road surface polygons. </li>\n<li>We used only the blue channel for drawing  lane lines.</li>\n<li>We used different values for different types of lines. There is extra line-type information in the map data:  single, solid, dashed, double, etc. (See the \"color codes\" below)</li>\n<li>No anti-aliased lines. IMO, That is for graphical purposes, with no information value.</li>\n<li>We draw only \"borders\" for the agent. I have not implemented any polygon/rectangle filling algorithm. After the first few tests, it seemed that the validation is better than with the filled rectangles (on CPU).</li>\n<li>We added the speed-bumps (and speed-humps) information as well.</li>\n</ul>\n<h2>Channel and color codes we used</h2>\n<h3>Lane separator lines</h3>\n<p>For more details, check l5kit's <a href=\"https://github.com/lyft/l5kit/blob/41197693335c0259fc84d2fba7d239c842cc06d6/l5kit/l5kit/data/proto/road_network.proto#L458-L472\" target=\"_blank\">protobuffer data</a></p>\n<p>We draw all of the lines on the blue channel (channel #2) (except for the traffic-light updates, see below). We used these channel values:</p>\n<pre><code>enum DividerType {\n  UNKNOWN = 128;\n  NONE = 128;\n  SINGLE_YELLOW_SOLID = 16;\n  SINGLE_WHITE_SOLID = 40;\n  SINGLE_YELLOW_DASHED = 64;\n  SINGLE_WHITE_DASHED = 88;\n  DOUBLE_YELLOW_SOLID = 112;\n  DOUBLE_WHITE_SOLID = 1136;\n  DOUBLE_YELLOW_SOLID_FAR_DASHED_NEAR = 160;\n  DOUBLE_YELLOW_DASHED_FAR_SOLID_NEAR = 184;\n  CURB_RED = 208; \n  CURB_YELLOW = 232; \n  CURB = 255; \n}\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F3454413ec949361610e91b74838860de%2Fsample_lanes.png?generation=1606384742434552&amp;alt=media\" alt=\"\"></p>\n<h3>Traffic lights</h3>\n<ul>\n<li><strong>Red lights</strong> Channel #0 (red), value 255</li>\n<li><strong>Yellow lights</strong> Channel #1 (green) value 128</li>\n<li><strong>Green lights</strong> Channel #1 (green) value 255</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F52c72f23b6206a4fe49416bb958ecd97%2Fsample_map.png?generation=1606384833139006&amp;alt=media\" alt=\"\"></p>\n<h3>Other elements</h3>\n<ul>\n<li><strong>Crosswalks</strong>: Channel #0 (red), value 128</li>\n<li><strong>Speed bumps</strong>: Channel #1 (green), value 128</li>\n</ul>\n<h3>Agents</h3>\n<ul>\n<li><strong>EGO</strong>: Channel #3 .. #history, value 255</li>\n<li><strong>Others</strong>: Channel #ego_history+1 .. , value 255</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2Ffedc7e2113d8423ee1921a036985ced4%2Fsample_lanes_agents.png?generation=1606384847342779&amp;alt=media\" alt=\"\"></p>\n<h3>History</h3>\n<ul>\n<li>We used 29 historical steps (+ one for the current step)</li>\n<li>We kept the current and the last 1.5s in different channels, and we merged the earlier history into one channel (one for the ego, one for the other agents) with descending values.</li>\n<li>Channel #3: agents; current step; value 255</li>\n<li>Channels #4 - #17: agents; 1.5 sec history, value 255</li>\n<li>Channel #18: agents; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45</li>\n<li>Channel #19: ego; current step; value 255</li>\n<li>Channels #20 - #33: ego; 1.5 sec history, value 255</li>\n<li>Channels #34: ego; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F9bcf8f1c799715b4be2bd2857d6381ca%2Fsample_raster.png?generation=1606384879072500&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "1091815",
      "postDate": "11/26/2020 10:04:09",
      "content": "<p>In this post, you can read more details about our C++/CUDA rasterization solution. I published the <a href=\"https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch\" target=\"_blank\">source code</a> and a basic tutorial on implementing all of this.</p>\n<h2>Speed</h2>\n<p>In short, rasterizing on the GPU is at least 2x faster. With a longer history, higher image size, the difference is even more significant. If you add some tricks, you can achieve ~4x speedup.<br>\n(Of course, this highly depends on your environment, the available RAM, GPU, number of CPU, etc.)</p>\n<h2>Our final output images</h2>\n<p><em>Note</em>: The following modifications are more or less just our assumptions (not the result of precise testing). We made these changes in the rasterized outputs:</p>\n<ul>\n<li>No road surface polygons. </li>\n<li>We used only the blue channel for drawing  lane lines.</li>\n<li>We used different values for different types of lines. There is extra line-type information in the map data:  single, solid, dashed, double, etc. (See the \"color codes\" below)</li>\n<li>No anti-aliased lines. IMO, That is for graphical purposes, with no information value.</li>\n<li>We draw only \"borders\" for the agent. I have not implemented any polygon/rectangle filling algorithm. After the first few tests, it seemed that the validation is better than with the filled rectangles (on CPU).</li>\n<li>We added the speed-bumps (and speed-humps) information as well.</li>\n</ul>\n<h2>Channel and color codes we used</h2>\n<h3>Lane separator lines</h3>\n<p>For more details, check l5kit's <a href=\"https://github.com/lyft/l5kit/blob/41197693335c0259fc84d2fba7d239c842cc06d6/l5kit/l5kit/data/proto/road_network.proto#L458-L472\" target=\"_blank\">protobuffer data</a></p>\n<p>We draw all of the lines on the blue channel (channel #2) (except for the traffic-light updates, see below). We used these channel values:</p>\n<pre><code>enum DividerType {\n  UNKNOWN = 128;\n  NONE = 128;\n  SINGLE_YELLOW_SOLID = 16;\n  SINGLE_WHITE_SOLID = 40;\n  SINGLE_YELLOW_DASHED = 64;\n  SINGLE_WHITE_DASHED = 88;\n  DOUBLE_YELLOW_SOLID = 112;\n  DOUBLE_WHITE_SOLID = 1136;\n  DOUBLE_YELLOW_SOLID_FAR_DASHED_NEAR = 160;\n  DOUBLE_YELLOW_DASHED_FAR_SOLID_NEAR = 184;\n  CURB_RED = 208; \n  CURB_YELLOW = 232; \n  CURB = 255; \n}\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F3454413ec949361610e91b74838860de%2Fsample_lanes.png?generation=1606384742434552&amp;alt=media\" alt=\"\"></p>\n<h3>Traffic lights</h3>\n<ul>\n<li><strong>Red lights</strong> Channel #0 (red), value 255</li>\n<li><strong>Yellow lights</strong> Channel #1 (green) value 128</li>\n<li><strong>Green lights</strong> Channel #1 (green) value 255</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F52c72f23b6206a4fe49416bb958ecd97%2Fsample_map.png?generation=1606384833139006&amp;alt=media\" alt=\"\"></p>\n<h3>Other elements</h3>\n<ul>\n<li><strong>Crosswalks</strong>: Channel #0 (red), value 128</li>\n<li><strong>Speed bumps</strong>: Channel #1 (green), value 128</li>\n</ul>\n<h3>Agents</h3>\n<ul>\n<li><strong>EGO</strong>: Channel #3 .. #history, value 255</li>\n<li><strong>Others</strong>: Channel #ego_history+1 .. , value 255</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2Ffedc7e2113d8423ee1921a036985ced4%2Fsample_lanes_agents.png?generation=1606384847342779&amp;alt=media\" alt=\"\"></p>\n<h3>History</h3>\n<ul>\n<li>We used 29 historical steps (+ one for the current step)</li>\n<li>We kept the current and the last 1.5s in different channels, and we merged the earlier history into one channel (one for the ego, one for the other agents) with descending values.</li>\n<li>Channel #3: agents; current step; value 255</li>\n<li>Channels #4 - #17: agents; 1.5 sec history, value 255</li>\n<li>Channel #18: agents; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45</li>\n<li>Channel #19: ego; current step; value 255</li>\n<li>Channels #20 - #33: ego; 1.5 sec history, value 255</li>\n<li>Channels #34: ego; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F9bcf8f1c799715b4be2bd2857d6381ca%2Fsample_raster.png?generation=1606384879072500&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "In this post, you can read more details about our C++/CUDA rasterization solution. I published the [source code](https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch) and a basic tutorial on implementing all of this.\n\n\n## Speed\n\nIn short, rasterizing on the GPU is at least 2x faster. With a longer history, higher image size, the difference is even more significant. If you add some tricks, you can achieve ~4x speedup.\n(Of course, this highly depends on your environment, the available RAM, GPU, number of CPU, etc.)\n\n\n\n## Our final output images\n\n*Note*: The following modifications are more or less just our assumptions (not the result of precise testing). We made these changes in the rasterized outputs:\n\n- No road surface polygons. \n- We used only the blue channel for drawing  lane lines.\n- We used different values for different types of lines. There is extra line-type information in the map data:  single, solid, dashed, double, etc. (See the \"color codes\" below)\n- No anti-aliased lines. IMO, That is for graphical purposes, with no information value.\n- We draw only \"borders\" for the agent. I have not implemented any polygon/rectangle filling algorithm. After the first few tests, it seemed that the validation is better than with the filled rectangles (on CPU).\n- We added the speed-bumps (and speed-humps) information as well.\n\n\n\n\n\n## Channel and color codes we used\n\n\n\n### Lane separator lines\n\nFor more details, check l5kit's [protobuffer data](https://github.com/lyft/l5kit/blob/41197693335c0259fc84d2fba7d239c842cc06d6/l5kit/l5kit/data/proto/road_network.proto#L458-L472)\n\nWe draw all of the lines on the blue channel (channel \\#2) (except for the traffic-light updates, see below). We used these channel values:\n\n```python\nenum DividerType {\n  UNKNOWN = 128;\n  NONE = 128;\n  SINGLE_YELLOW_SOLID = 16;\n  SINGLE_WHITE_SOLID = 40;\n  SINGLE_YELLOW_DASHED = 64;\n  SINGLE_WHITE_DASHED = 88;\n  DOUBLE_YELLOW_SOLID = 112;\n  DOUBLE_WHITE_SOLID = 1136;\n  DOUBLE_YELLOW_SOLID_FAR_DASHED_NEAR = 160;\n  DOUBLE_YELLOW_DASHED_FAR_SOLID_NEAR = 184;\n  CURB_RED = 208; \n  CURB_YELLOW = 232; \n  CURB = 255; \n}\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F3454413ec949361610e91b74838860de%2Fsample_lanes.png?generation=1606384742434552&alt=media)\n\n\n\n\n### Traffic lights\n\n- **Red lights** Channel \\#0 (red), value 255\n- **Yellow lights** Channel \\#1 (green) value 128\n- **Green lights** Channel \\#1 (green) value 255\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F52c72f23b6206a4fe49416bb958ecd97%2Fsample_map.png?generation=1606384833139006&alt=media)\n\n### Other elements\n\n- **Crosswalks**: Channel \\#0 (red), value 128\n- **Speed bumps**: Channel \\#1 (green), value 128\n\n\n\n### Agents\n\n- **EGO**: Channel \\#3 .. \\#history, value 255\n- **Others**: Channel \\#ego_history+1 .. , value 255\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2Ffedc7e2113d8423ee1921a036985ced4%2Fsample_lanes_agents.png?generation=1606384847342779&alt=media)\n\n### History\n\n- We used 29 historical steps (+ one for the current step)\n- We kept the current and the last 1.5s in different channels, and we merged the earlier history into one channel (one for the ego, one for the other agents) with descending values.\n- Channel \\#3: agents; current step; value 255\n- Channels \\#4 - \\#17: agents; 1.5 sec history, value 255\n- Channel \\#18: agents; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45\n- Channel \\#19: ego; current step; value 255\n- Channels \\#20 - \\#33: ego; 1.5 sec history, value 255\n- Channels \\#34: ego; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F9bcf8f1c799715b4be2bd2857d6381ca%2Fsample_raster.png?generation=1606384879072500&alt=media)",
      "votes": null
    },
    {
      "id": "1091819",
      "postDate": "11/26/2020 10:07:25",
      "content": "<p>is there any score difference in terms of previous one</p>",
      "rawMarkdown": "is there any score difference in terms of previous one",
      "votes": null
    },
    {
      "id": "1091823",
      "postDate": "11/26/2020 10:09:30",
      "content": "<p>The link is in the post. Or <a href=\"https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch\" target=\"_blank\">here</a></p>",
      "rawMarkdown": "The link is in the post. Or [here](https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch)",
      "votes": null
    },
    {
      "id": "1091827",
      "postDate": "11/26/2020 10:15:03",
      "content": "<p>I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?</p>",
      "rawMarkdown": "I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?",
      "votes": null
    },
    {
      "id": "1091834",
      "postDate": "11/26/2020 10:23:28",
      "content": "<p>:D I read \"source\". I need some sleep..<br>\nI don't know. I modified the l5kit from day one, compared to my modifications it improved, but I don't run experiments with the official l5kit code.</p>",
      "rawMarkdown": ":D I read \"source\". I need some sleep..\nI don't know. I modified the l5kit from day one, compared to my modifications it improved, but I don't run experiments with the official l5kit code.",
      "votes": null
    },
    {
      "id": "1091836",
      "postDate": "11/26/2020 10:27:58",
      "content": "<p>Great contribution! Is the choice for using just border for agents related to the decision to merge older history into a single channel? I imagine it would be more interpretable than filled polygons.</p>",
      "rawMarkdown": "Great contribution! Is the choice for using just border for agents related to the decision to merge older history into a single channel? I imagine it would be more interpretable than filled polygons.",
      "votes": null
    },
    {
      "id": "1091851",
      "postDate": "11/26/2020 10:39:44",
      "content": "<blockquote>\n  <p>I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?</p>\n</blockquote>\n<p>Sure, My question was that</p>",
      "rawMarkdown": ">I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?\n\nSure, My question was that",
      "votes": null
    },
    {
      "id": "1091888",
      "postDate": "11/26/2020 11:01:47",
      "content": "<p>No. I was too lazy to implement :) After the first test, it was good enough so we moved on to other ideas. Later, when we merged the layers, it seemed better this way.</p>",
      "rawMarkdown": "No. I was too lazy to implement :) After the first test, it was good enough so we moved on to other ideas. Later, when we merged the layers, it seemed better this way.",
      "votes": null
    },
    {
      "id": "1092500",
      "postDate": "11/26/2020 22:19:55",
      "content": "<p>Wow, this is very impressive!</p>",
      "rawMarkdown": "Wow, this is very impressive!",
      "votes": null
    },
    {
      "id": "1379117",
      "postDate": "07/07/2021 05:44:39",
      "content": "<p>For those guys who found Kaggle's GPU is not sufficient, I recommend an MLOps tool called AIbro. The company is giving a lot of free credit to use cloud GPU. You can use it to train AI models on any instance from AWS in one line. <a href=\"https://colab.research.google.com/drive/19sXZ4kbic681zqEsrl_CZfB5cegUwuIB#scrollTo=CSgozfXs572M\" target=\"_blank\">https://colab.research.google.com/drive/19sXZ4kbic681zqEsrl_CZfB5cegUwuIB#scrollTo=CSgozfXs572M</a></p>",
      "rawMarkdown": "For those guys who found Kaggle's GPU is not sufficient, I recommend an MLOps tool called AIbro. The company is giving a lot of free credit to use cloud GPU. You can use it to train AI models on any instance from AWS in one line. https://colab.research.google.com/drive/19sXZ4kbic681zqEsrl_CZfB5cegUwuIB#scrollTo=CSgozfXs572M",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1091819,
      "author_name": "morizin",
      "author_url": "",
      "post_date": "11/26/2020 10:07:25",
      "content": "<p>is there any score difference in terms of previous one</p>",
      "votes": null,
      "replies": [
        {
          "id": 1091823,
          "author_name": "pestipeti",
          "author_url": "",
          "post_date": "11/26/2020 10:09:30",
          "content": "<p>The link is in the post. Or <a href=\"https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch\" target=\"_blank\">here</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1091827,
          "author_name": "ryches",
          "author_url": "",
          "post_date": "11/26/2020 10:15:03",
          "content": "<p>I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1091834,
          "author_name": "pestipeti",
          "author_url": "",
          "post_date": "11/26/2020 10:23:28",
          "content": "<p>:D I read \"source\". I need some sleep..<br>\nI don't know. I modified the l5kit from day one, compared to my modifications it improved, but I don't run experiments with the official l5kit code.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1091851,
          "author_name": "morizin",
          "author_url": "",
          "post_date": "11/26/2020 10:39:44",
          "content": "<blockquote>\n  <p>I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?</p>\n</blockquote>\n<p>Sure, My question was that</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1091836,
      "author_name": "taindow",
      "author_url": "",
      "post_date": "11/26/2020 10:27:58",
      "content": "<p>Great contribution! Is the choice for using just border for agents related to the decision to merge older history into a single channel? I imagine it would be more interpretable than filled polygons.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1091888,
          "author_name": "pestipeti",
          "author_url": "",
          "post_date": "11/26/2020 11:01:47",
          "content": "<p>No. I was too lazy to implement :) After the first test, it was good enough so we moved on to other ideas. Later, when we merged the layers, it seemed better this way.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1092500,
      "author_name": "frankpanxj",
      "author_url": "",
      "post_date": "11/26/2020 22:19:55",
      "content": "<p>Wow, this is very impressive!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1379117,
      "author_name": "y223li",
      "author_url": "",
      "post_date": "07/07/2021 05:44:39",
      "content": "<p>For those guys who found Kaggle's GPU is not sufficient, I recommend an MLOps tool called AIbro. The company is giving a lot of free credit to use cloud GPU. You can use it to train AI models on any instance from AWS in one line. <a href=\"https://colab.research.google.com/drive/19sXZ4kbic681zqEsrl_CZfB5cegUwuIB#scrollTo=CSgozfXs572M\" target=\"_blank\">https://colab.research.google.com/drive/19sXZ4kbic681zqEsrl_CZfB5cegUwuIB#scrollTo=CSgozfXs572M</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1091815": "In this post, you can read more details about our C++/CUDA rasterization solution. I published the [source code](https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch) and a basic tutorial on implementing all of this.\n\n\n## Speed\n\nIn short, rasterizing on the GPU is at least 2x faster. With a longer history, higher image size, the difference is even more significant. If you add some tricks, you can achieve ~4x speedup.\n(Of course, this highly depends on your environment, the available RAM, GPU, number of CPU, etc.)\n\n\n\n## Our final output images\n\n*Note*: The following modifications are more or less just our assumptions (not the result of precise testing). We made these changes in the rasterized outputs:\n\n- No road surface polygons. \n- We used only the blue channel for drawing  lane lines.\n- We used different values for different types of lines. There is extra line-type information in the map data:  single, solid, dashed, double, etc. (See the \"color codes\" below)\n- No anti-aliased lines. IMO, That is for graphical purposes, with no information value.\n- We draw only \"borders\" for the agent. I have not implemented any polygon/rectangle filling algorithm. After the first few tests, it seemed that the validation is better than with the filled rectangles (on CPU).\n- We added the speed-bumps (and speed-humps) information as well.\n\n\n\n\n\n## Channel and color codes we used\n\n\n\n### Lane separator lines\n\nFor more details, check l5kit's [protobuffer data](https://github.com/lyft/l5kit/blob/41197693335c0259fc84d2fba7d239c842cc06d6/l5kit/l5kit/data/proto/road_network.proto#L458-L472)\n\nWe draw all of the lines on the blue channel (channel \\#2) (except for the traffic-light updates, see below). We used these channel values:\n\n```python\nenum DividerType {\n  UNKNOWN = 128;\n  NONE = 128;\n  SINGLE_YELLOW_SOLID = 16;\n  SINGLE_WHITE_SOLID = 40;\n  SINGLE_YELLOW_DASHED = 64;\n  SINGLE_WHITE_DASHED = 88;\n  DOUBLE_YELLOW_SOLID = 112;\n  DOUBLE_WHITE_SOLID = 1136;\n  DOUBLE_YELLOW_SOLID_FAR_DASHED_NEAR = 160;\n  DOUBLE_YELLOW_DASHED_FAR_SOLID_NEAR = 184;\n  CURB_RED = 208; \n  CURB_YELLOW = 232; \n  CURB = 255; \n}\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F3454413ec949361610e91b74838860de%2Fsample_lanes.png?generation=1606384742434552&alt=media)\n\n\n\n\n### Traffic lights\n\n- **Red lights** Channel \\#0 (red), value 255\n- **Yellow lights** Channel \\#1 (green) value 128\n- **Green lights** Channel \\#1 (green) value 255\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F52c72f23b6206a4fe49416bb958ecd97%2Fsample_map.png?generation=1606384833139006&alt=media)\n\n### Other elements\n\n- **Crosswalks**: Channel \\#0 (red), value 128\n- **Speed bumps**: Channel \\#1 (green), value 128\n\n\n\n### Agents\n\n- **EGO**: Channel \\#3 .. \\#history, value 255\n- **Others**: Channel \\#ego_history+1 .. , value 255\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2Ffedc7e2113d8423ee1921a036985ced4%2Fsample_lanes_agents.png?generation=1606384847342779&alt=media)\n\n### History\n\n- We used 29 historical steps (+ one for the current step)\n- We kept the current and the last 1.5s in different channels, and we merged the earlier history into one channel (one for the ego, one for the other agents) with descending values.\n- Channel \\#3: agents; current step; value 255\n- Channels \\#4 - \\#17: agents; 1.5 sec history, value 255\n- Channel \\#18: agents; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45\n- Channel \\#19: ego; current step; value 255\n- Channels \\#20 - \\#33: ego; 1.5 sec history, value 255\n- Channels \\#34: ego; 1.5 (earlier) sec history; values decreasing by 15 from 255 to 45\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F9bcf8f1c799715b4be2bd2857d6381ca%2Fsample_raster.png?generation=1606384879072500&alt=media)",
    "1091819": "is there any score difference in terms of previous one",
    "1091823": "The link is in the post. Or [here](https://www.kaggle.com/pestipeti/custom-c-and-cuda-extensions-with-pytorch)",
    "1091827": "I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?",
    "1091834": ":D I read \"source\". I need some sleep..\nI don't know. I modified the l5kit from day one, compared to my modifications it improved, but I don't run experiments with the official l5kit code.",
    "1091836": "Great contribution! Is the choice for using just border for agents related to the decision to merge older history into a single channel? I imagine it would be more interpretable than filled polygons.",
    "1091851": ">I see the speed benchmarks, but I think their question was regarding predictive performance. Did this yield any delta in score or simply speed up iteration?\n\nSure, My question was that",
    "1091888": "No. I was too lazy to implement :) After the first test, it was good enough so we moved on to other ideas. Later, when we merged the layers, it seemed better this way.",
    "1092500": "Wow, this is very impressive!",
    "1379117": "For those guys who found Kaggle's GPU is not sufficient, I recommend an MLOps tool called AIbro. The company is giving a lot of free credit to use cloud GPU. You can use it to train AI models on any instance from AWS in one line. https://colab.research.google.com/drive/19sXZ4kbic681zqEsrl_CZfB5cegUwuIB#scrollTo=CSgozfXs572M"
  },
  "source": "meta"
}