{
  "id": 443386,
  "title": "Understanding dot node layout configurations",
  "url": "/competitions/predict-ai-model-runtime/discussion/443386",
  "author_name": "Angelica Babei",
  "post_date": "2023-09-27T02:50:33.081000",
  "votes": 4,
  "comment_count": 12,
  "views": 0,
  "content": "<p>Can someone help me understand something about layout configurations for dot nodes?</p>\n<p>For example, consider the dot node 125 (the 6th configurable node) in the graph <code>npz_all/npz/layout/xla/default/train/alexnet_train_batch_32.npz</code>. The input layout of the 0-th configuration at this node is <code>{ 1,  0, -1, -1, -1, -1 }</code>.  As far as I understand, this input layout indicates that there are two dimensions, and their minor to major ordering is <code>{1, 0}</code>. However, the input layout in the 3rd configuration at this node is  <code>{-1, -1, -1, -1, -1, -1}</code>. What does this mean for the minor to major ordering? </p>\n<p>Thanks! Any help is much appreciated.</p>",
  "messages": [
    {
      "id": 2457534,
      "postDate": "2023-09-27T02:50:33.083Z",
      "content": "<p>Can someone help me understand something about layout configurations for dot nodes?</p>\n<p>For example, consider the dot node 125 (the 6th configurable node) in the graph <code>npz_all/npz/layout/xla/default/train/alexnet_train_batch_32.npz</code>. The input layout of the 0-th configuration at this node is <code>{ 1,  0, -1, -1, -1, -1 }</code>.  As far as I understand, this input layout indicates that there are two dimensions, and their minor to major ordering is <code>{1, 0}</code>. However, the input layout in the 3rd configuration at this node is  <code>{-1, -1, -1, -1, -1, -1}</code>. What does this mean for the minor to major ordering? </p>\n<p>Thanks! Any help is much appreciated.</p>",
      "rawMarkdown": "Can someone help me understand something about layout configurations for dot nodes?\n\nFor example, consider the dot node 125 (the 6th configurable node) in the graph `npz_all/npz/layout/xla/default/train/alexnet_train_batch_32.npz`. The input layout of the 0-th configuration at this node is ` { 1,  0, -1, -1, -1, -1 }`.  As far as I understand, this input layout indicates that there are two dimensions, and their minor to major ordering is `{1, 0}`. However, the input layout in the 3rd configuration at this node is  `{-1, -1, -1, -1, -1, -1} `. What does this mean for the minor to major ordering? \n\nThanks! Any help is much appreciated.",
      "votes": 3
    },
    {
      "id": 2468459,
      "postDate": "2023-10-05T14:07:55.030Z",
      "content": "<p>Another point I'm confused about, what does it mean if there is a just a 0 e.g [-1., -1., -1., -1., -1., -1.,  0., -1., -1., -1., -1., -1., -1.,-1., -1., -1., -1., -1.]?</p>",
      "rawMarkdown": "Another point I'm confused about, what does it mean if there is a just a 0 e.g [-1., -1., -1., -1., -1., -1.,  0., -1., -1., -1., -1., -1., -1.,-1., -1., -1., -1., -1.]?",
      "votes": 1,
      "replies": [
        {
          "id": 2471979,
          "postDate": "2023-10-06T20:10:06.783Z",
          "content": "<p>Since the 0 is in the input layout of the configuration, I would think there is only one dimension, but I might be wrong. Can you show a specific example?</p>",
          "rawMarkdown": "Since the 0 is in the input layout of the configuration, I would think there is only one dimension, but I might be wrong. Can you show a specific example?",
          "replies": [
            {
              "id": 2472406,
              "postDate": "2023-10-07T09:49:53.390Z",
              "content": "<p>For example I am looking at the graph with the path layout/nlp/default/train/small_bert_bert_en_uncased_L-2_H-768_A-12_batch_size_16_test.npz', and when looking at the second configuration for example, some of the nodes have features like this:</p>\n<pre><code>   [ 0.,  1., ., ., ., .,  0., ., ., ., ., ., .,\n    ., ., ., ., .],\n   [ 0.,  1., ., ., ., .,  0., ., ., ., ., ., .,\n    ., ., ., ., .]\n</code></pre>\n<p>Does this just mean a 2D input tensor with a minor to major config of 0,1 is converted into a 1D tensor?</p>",
              "rawMarkdown": "For example I am looking at the graph with the path layout/nlp/default/train/small_bert_bert_en_uncased_L-2_H-768_A-12_batch_size_16_test.npz', and when looking at the second configuration for example, some of the nodes have features like this:\n\n       [ 0.,  1., -1., -1., -1., -1.,  0., -1., -1., -1., -1., -1., -1.,\n        -1., -1., -1., -1., -1.],\n       [ 0.,  1., -1., -1., -1., -1.,  0., -1., -1., -1., -1., -1., -1.,\n        -1., -1., -1., -1., -1.]\n\nDoes this just mean a 2D input tensor with a minor to major config of 0,1 is converted into a 1D tensor?",
              "votes": 1
            },
            {
              "id": 2472895,
              "postDate": "2023-10-07T17:26:09.287Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2472896,
              "postDate": "2023-10-07T17:28:11.267Z",
              "content": "<p>Yes, but the other way around: in the layout configuration feature description, the first 6 entries are the output layout, here <code>0., 1., -1., -1., -1., -1.</code>, then the next 6 are the input layout <code>0., -1., -1., -1., -1., -1.</code>, so it looks like a 1D tensor is reshaped into a 2D one.</p>",
              "rawMarkdown": "Yes, but the other way around: in the layout configuration feature description, the first 6 entries are the output layout, here ` 0., 1., -1., -1., -1., -1.`, then the next 6 are the input layout `0., -1., -1., -1., -1., -1.`, so it looks like a 1D tensor is reshaped into a 2D one.",
              "votes": 1
            },
            {
              "id": 2472982,
              "postDate": "2023-10-07T19:01:51.313Z",
              "content": "<p>For the input shouldn't the minor dimension always be 0 if it is a 1D tensor?, how is that any different than the default compiler configuration?</p>",
              "rawMarkdown": "For the input shouldn't the minor dimension always be 0 if it is a 1D tensor?, how is that any different than the default compiler configuration?",
              "votes": 1
            },
            {
              "id": 2473008,
              "postDate": "2023-10-07T19:21:46.903Z",
              "content": "<p>I think so; I don't see how this would be different from the default.</p>",
              "rawMarkdown": "I think so; I don't see how this would be different from the default.",
              "votes": 1
            },
            {
              "id": 2473023,
              "postDate": "2023-10-07T19:49:31.737Z",
              "content": "<p>Thanks, that's what i was thinking too</p>",
              "rawMarkdown": "Thanks, that's what i was thinking too\n"
            }
          ]
        }
      ]
    },
    {
      "id": 2465047,
      "postDate": "2023-10-02T17:03:32.840Z",
      "content": "<p>Nice observation! We didn't explain that we also include a tensor layout of {-1, -1, -1, -1, -1, -1} to indicate the compiler to apply its default strategy of selecting the layout for that particular tensor. We just updated the description of the data to clarify this point.</p>",
      "rawMarkdown": "Nice observation! We didn't explain that we also include a tensor layout of {-1, -1, -1, -1, -1, -1} to indicate the compiler to apply its default strategy of selecting the layout for that particular tensor. We just updated the description of the data to clarify this point.",
      "votes": 2,
      "replies": [
        {
          "id": 2467814,
          "postDate": "2023-10-04T21:26:48.743Z",
          "content": "<p>Thank you, Mangpo! Much appreciated.</p>",
          "rawMarkdown": "Thank you, Mangpo! Much appreciated."
        },
        {
          "id": 2468845,
          "postDate": "2023-10-05T21:46:51.240Z",
          "content": "<p>Can you share more on the default strategy of the compiler?</p>",
          "rawMarkdown": "Can you share more on the default strategy of the compiler?",
          "votes": 2,
          "replies": [
            {
              "id": 2472111,
              "postDate": "2023-10-07T02:39:28.707Z",
              "content": "<p>Check this out: <a href=\"https://www.kaggle.com/competitions/predict-ai-model-runtime/discussion/443265\" target=\"_blank\">https://www.kaggle.com/competitions/predict-ai-model-runtime/discussion/443265</a></p>",
              "rawMarkdown": "Check this out: https://www.kaggle.com/competitions/predict-ai-model-runtime/discussion/443265",
              "votes": 1
            }
          ]
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2468459,
      "author_name": "Camilla",
      "author_url": "",
      "post_date": "2023-10-05T14:07:55.030000",
      "content": "<p>Another point I'm confused about, what does it mean if there is a just a 0 e.g [-1., -1., -1., -1., -1., -1.,  0., -1., -1., -1., -1., -1., -1.,-1., -1., -1., -1., -1.]?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2471979,
          "author_name": "Angelica Babei",
          "author_url": "",
          "post_date": "2023-10-06T20:10:06.783000",
          "content": "<p>Since the 0 is in the input layout of the configuration, I would think there is only one dimension, but I might be wrong. Can you show a specific example?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2472406,
              "author_name": "Camilla",
              "author_url": "",
              "post_date": "2023-10-07T09:49:53.390000",
              "content": "<p>For example I am looking at the graph with the path layout/nlp/default/train/small_bert_bert_en_uncased_L-2_H-768_A-12_batch_size_16_test.npz', and when looking at the second configuration for example, some of the nodes have features like this:</p>\n<pre><code>   [ 0.,  1., ., ., ., .,  0., ., ., ., ., ., .,\n    ., ., ., ., .],\n   [ 0.,  1., ., ., ., .,  0., ., ., ., ., ., .,\n    ., ., ., ., .]\n</code></pre>\n<p>Does this just mean a 2D input tensor with a minor to major config of 0,1 is converted into a 1D tensor?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2472895,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-10-07T17:26:09.287000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2472896,
              "author_name": "Angelica Babei",
              "author_url": "",
              "post_date": "2023-10-07T17:28:11.267000",
              "content": "<p>Yes, but the other way around: in the layout configuration feature description, the first 6 entries are the output layout, here <code>0., 1., -1., -1., -1., -1.</code>, then the next 6 are the input layout <code>0., -1., -1., -1., -1., -1.</code>, so it looks like a 1D tensor is reshaped into a 2D one.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2472982,
              "author_name": "Camilla",
              "author_url": "",
              "post_date": "2023-10-07T19:01:51.313000",
              "content": "<p>For the input shouldn't the minor dimension always be 0 if it is a 1D tensor?, how is that any different than the default compiler configuration?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2473008,
              "author_name": "Angelica Babei",
              "author_url": "",
              "post_date": "2023-10-07T19:21:46.903000",
              "content": "<p>I think so; I don't see how this would be different from the default.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2473023,
              "author_name": "Camilla",
              "author_url": "",
              "post_date": "2023-10-07T19:49:31.737000",
              "content": "<p>Thanks, that's what i was thinking too</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2465047,
      "author_name": "Mangpo Phothilimthana",
      "author_url": "",
      "post_date": "2023-10-02T17:03:32.840000",
      "content": "<p>Nice observation! We didn't explain that we also include a tensor layout of {-1, -1, -1, -1, -1, -1} to indicate the compiler to apply its default strategy of selecting the layout for that particular tensor. We just updated the description of the data to clarify this point.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2467814,
          "author_name": "Angelica Babei",
          "author_url": "",
          "post_date": "2023-10-04T21:26:48.743000",
          "content": "<p>Thank you, Mangpo! Much appreciated.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2468845,
          "author_name": "zshao9",
          "author_url": "",
          "post_date": "2023-10-05T21:46:51.240000",
          "content": "<p>Can you share more on the default strategy of the compiler?</p>",
          "votes": 2,
          "replies": [
            {
              "id": 2472111,
              "author_name": "Mangpo Phothilimthana",
              "author_url": "",
              "post_date": "2023-10-07T02:39:28.707000",
              "content": "<p>Check this out: <a href=\"https://www.kaggle.com/competitions/predict-ai-model-runtime/discussion/443265\" target=\"_blank\">https://www.kaggle.com/competitions/predict-ai-model-runtime/discussion/443265</a></p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2457534": "Can someone help me understand something about layout configurations for dot nodes?\n\nFor example, consider the dot node 125 (the 6th configurable node) in the graph `npz_all/npz/layout/xla/default/train/alexnet_train_batch_32.npz`. The input layout of the 0-th configuration at this node is ` { 1,  0, -1, -1, -1, -1 }`.  As far as I understand, this input layout indicates that there are two dimensions, and their minor to major ordering is `{1, 0}`. However, the input layout in the 3rd configuration at this node is  `{-1, -1, -1, -1, -1, -1} `. What does this mean for the minor to major ordering? \n\nThanks! Any help is much appreciated.",
    "2468459": "Another point I'm confused about, what does it mean if there is a just a 0 e.g [-1., -1., -1., -1., -1., -1.,  0., -1., -1., -1., -1., -1., -1.,-1., -1., -1., -1., -1.]?",
    "2465047": "Nice observation! We didn't explain that we also include a tensor layout of {-1, -1, -1, -1, -1, -1} to indicate the compiler to apply its default strategy of selecting the layout for that particular tensor. We just updated the description of the data to clarify this point."
  }
}