{ "cells": [ { "cell_type": "code", "execution_count": 4, "id": "efdc584c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
source_filen_rowsn_colsphasemodemodeltaskdatasetmodel_taskworkload
0./train_separated/data_DEEPSEEKforTextClassifi...17595678fine-tuningllmDEEPSEEKTextClassificationdefaultDEEPSEEK__TextClassificationDEEPSEEK__TextClassification__default
1./train_separated/data_DEEPSEEKforTextClassifi...19203678fine-tuningllmDEEPSEEKTextClassificationdefaultDEEPSEEK__TextClassificationDEEPSEEK__TextClassification__default
2./train_separated/data_DEEPSEEKforTextClassifi...18854678fine-tuningllmDEEPSEEKTextClassificationdefaultDEEPSEEK__TextClassificationDEEPSEEK__TextClassification__default
3./train_separated/data_DEEPSEEKforTextClassifi...17782678fine-tuningllmDEEPSEEKTextClassificationdefaultDEEPSEEK__TextClassificationDEEPSEEK__TextClassification__default
4./train_separated/data_DEEPSEEKforTextClassifi...17700678fine-tuningllmDEEPSEEKTextClassificationdefaultDEEPSEEK__TextClassificationDEEPSEEK__TextClassification__default
.................................
675./infer_separated/infer_ViTL16forImageSemantic...93678infernonllmViTL16ImageSemanticSegmentationdefaultViTL16__ImageSemanticSegmentationViTL16__ImageSemanticSegmentation__default
676./infer_separated/infer_ViTL16forImageSemantic...94678infernonllmViTL16ImageSemanticSegmentationdefaultViTL16__ImageSemanticSegmentationViTL16__ImageSemanticSegmentation__default
677./infer_separated/infer_ViTL16forImageSemantic...106678infernonllmViTL16ImageSemanticSegmentationdefaultViTL16__ImageSemanticSegmentationViTL16__ImageSemanticSegmentation__default
678./infer_separated/infer_ViTL16forImageSemantic...114678infernonllmViTL16ImageSemanticSegmentationdefaultViTL16__ImageSemanticSegmentationViTL16__ImageSemanticSegmentation__default
679./infer_separated/infer_ViTL16forImageSemantic...105678infernonllmViTL16ImageSemanticSegmentationdefaultViTL16__ImageSemanticSegmentationViTL16__ImageSemanticSegmentation__default
\n", "

680 rows × 10 columns

\n", "
" ], "text/plain": [ " source_file n_rows n_cols \\\n", "0 ./train_separated/data_DEEPSEEKforTextClassifi... 17595 678 \n", "1 ./train_separated/data_DEEPSEEKforTextClassifi... 19203 678 \n", "2 ./train_separated/data_DEEPSEEKforTextClassifi... 18854 678 \n", "3 ./train_separated/data_DEEPSEEKforTextClassifi... 17782 678 \n", "4 ./train_separated/data_DEEPSEEKforTextClassifi... 17700 678 \n", ".. ... ... ... \n", "675 ./infer_separated/infer_ViTL16forImageSemantic... 93 678 \n", "676 ./infer_separated/infer_ViTL16forImageSemantic... 94 678 \n", "677 ./infer_separated/infer_ViTL16forImageSemantic... 106 678 \n", "678 ./infer_separated/infer_ViTL16forImageSemantic... 114 678 \n", "679 ./infer_separated/infer_ViTL16forImageSemantic... 105 678 \n", "\n", " phase mode model task dataset \\\n", "0 fine-tuning llm DEEPSEEK TextClassification default \n", "1 fine-tuning llm DEEPSEEK TextClassification default \n", "2 fine-tuning llm DEEPSEEK TextClassification default \n", "3 fine-tuning llm DEEPSEEK TextClassification default \n", "4 fine-tuning llm DEEPSEEK TextClassification default \n", ".. ... ... ... ... ... \n", "675 infer nonllm ViTL16 ImageSemanticSegmentation default \n", "676 infer nonllm ViTL16 ImageSemanticSegmentation default \n", "677 infer nonllm ViTL16 ImageSemanticSegmentation default \n", "678 infer nonllm ViTL16 ImageSemanticSegmentation default \n", "679 infer nonllm ViTL16 ImageSemanticSegmentation default \n", "\n", " model_task \\\n", "0 DEEPSEEK__TextClassification \n", "1 DEEPSEEK__TextClassification \n", "2 DEEPSEEK__TextClassification \n", "3 DEEPSEEK__TextClassification \n", "4 DEEPSEEK__TextClassification \n", ".. ... \n", "675 ViTL16__ImageSemanticSegmentation \n", "676 ViTL16__ImageSemanticSegmentation \n", "677 ViTL16__ImageSemanticSegmentation \n", "678 ViTL16__ImageSemanticSegmentation \n", "679 ViTL16__ImageSemanticSegmentation \n", "\n", " workload \n", "0 DEEPSEEK__TextClassification__default \n", "1 DEEPSEEK__TextClassification__default \n", "2 DEEPSEEK__TextClassification__default \n", "3 DEEPSEEK__TextClassification__default \n", "4 DEEPSEEK__TextClassification__default \n", ".. ... \n", "675 ViTL16__ImageSemanticSegmentation__default \n", "676 ViTL16__ImageSemanticSegmentation__default \n", "677 ViTL16__ImageSemanticSegmentation__default \n", "678 ViTL16__ImageSemanticSegmentation__default \n", "679 ViTL16__ImageSemanticSegmentation__default \n", "\n", "[680 rows x 10 columns]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "\n", "df = pd.read_csv('meta.csv')\n", "\n", "df" ] }, { "cell_type": "code", "execution_count": 7, "id": "2d875356", "metadata": {}, "outputs": [], "source": [ "import re\n", "import pandas as pd\n", "\n", "# ==== Network-size-related Metrics Description Text ====\n", "network_size_text = \"\"\"\n", "NetworkInterStat_diff:rx_bytes.*.*[Bytes] — Bytes received on during sample window (delta).\n", "NetworkInterStat_diff:rx_packets.*.*[count] — Packets received during window (delta).\n", "NetworkInterStat_diff:tx_bytes.*.*[Bytes] — Bytes transmitted on during window (delta).\n", "NetworkInterStat_diff:tx_packets.*.*[count] — Packets transmitted during window (delta).\n", "\"\"\"\n", "\n", "# ==== Extract Metrics and Descriptions ====\n", "network_size_metrics = re.findall(r\"^([A-Za-z0-9_:.*\\[\\]]+)\\s+—\\s+(.*)$\", network_size_text, flags=re.M)\n", "df_metrics = pd.DataFrame(network_size_metrics, columns=[\"metric_pattern\", \"description\"])\n" ] }, { "cell_type": "code", "execution_count": 9, "id": "0a1046bd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reading: ./infer_separated/data_DEEPSEEKforInference_default_2025-04-26T09-41-59_htc-g003.txt\n", "Matched 8 columns:\n", "['NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]', 'NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]', 'NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]', 'NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]', 'NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]', 'NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]', 'NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]', 'NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]']\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]
021504048.05662.014657.0023.0267176.06536.01562.016.00
131028162.04602.520905.7519.5305426.016161.01954.015.25
240552276.03543.027154.5016.0343676.025786.02346.014.50
350076390.02483.533403.2512.5381926.035411.02738.013.75
459600504.01424.039652.009.0420176.045036.03130.013.00
\n", "
" ], "text/plain": [ " NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes] \\\n", "0 21504048.0 \n", "1 31028162.0 \n", "2 40552276.0 \n", "3 50076390.0 \n", "4 59600504.0 \n", "\n", " NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes] \\\n", "0 5662.0 \n", "1 4602.5 \n", "2 3543.0 \n", "3 2483.5 \n", "4 1424.0 \n", "\n", " NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count] \\\n", "0 14657.00 \n", "1 20905.75 \n", "2 27154.50 \n", "3 33403.25 \n", "4 39652.00 \n", "\n", " NetworkInterStat_diff:rx_packets.ib0.htc-g003[count] \\\n", "0 23.0 \n", "1 19.5 \n", "2 16.0 \n", "3 12.5 \n", "4 9.0 \n", "\n", " NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes] \\\n", "0 267176.0 \n", "1 305426.0 \n", "2 343676.0 \n", "3 381926.0 \n", "4 420176.0 \n", "\n", " NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes] \\\n", "0 6536.0 \n", "1 16161.0 \n", "2 25786.0 \n", "3 35411.0 \n", "4 45036.0 \n", "\n", " NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count] \\\n", "0 1562.0 \n", "1 1954.0 \n", "2 2346.0 \n", "3 2738.0 \n", "4 3130.0 \n", "\n", " NetworkInterStat_diff:tx_packets.ib0.htc-g003[count] \n", "0 16.00 \n", "1 15.25 \n", "2 14.50 \n", "3 13.75 \n", "4 13.00 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# ==== Only focus on 'llm' mode and 'infer' phase ====\n", "for file in df[(df['mode'] == 'llm') & (df['phase'] == 'infer')]['source_file'].tolist():\n", " print(f\"Reading: {file}\")\n", " data = pd.read_csv(file, sep='\\t', header=0)\n", "\n", " # ==== Find matching columns based on the memory patterns ====\n", " matched_cols = []\n", " for pattern in df_metrics[\"metric_pattern\"]:\n", " # Replace .* in the regular expression with the actual regular expression matching pattern\n", " regex = pattern.replace(\".*\", \".*\")\n", " matched = [col for col in data.columns if re.match(regex, col)]\n", " matched_cols.extend(matched)\n", "\n", " # Deduplication and sorting\n", " matched_cols = list(sorted(set(matched_cols)))\n", "\n", " print(f\"Matched {len(matched_cols)} columns:\")\n", " print(matched_cols)\n", "\n", " # ==== Extract data from these columns ====\n", " data_selected = data[matched_cols]\n", "\n", " # ==== Optional: Merge description information (matching by regular expression pattern) ====\n", " # Create a mapping for metric_name -> description (using the first matching rule)\n", " desc_map = {}\n", " for _, row in df_metrics.iterrows():\n", " regex = row['metric_pattern'].replace(\".*\", \".*\")\n", " for col in matched_cols:\n", " if re.match(regex, col):\n", " desc_map[col] = row['description']\n", "\n", " desc_df = pd.DataFrame(list(desc_map.items()), columns=[\"metric_name\", \"description\"])\n", "\n", " # display(desc_df.head())\n", " display(data_selected.head())\n", "\n", " break" ] }, { "cell_type": "code", "execution_count": 10, "id": "f92fd087", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]
021504048.05662.014657.0023.0267176.06536.01562.016.00
131028162.04602.520905.7519.5305426.016161.01954.015.25
240552276.03543.027154.5016.0343676.025786.02346.014.50
350076390.02483.533403.2512.5381926.035411.02738.013.75
459600504.01424.039652.009.0420176.045036.03130.013.00
...........................
93813003982.013888.08675.0040.0178826.058460.0925.038.00
9396512100.07336.04385.5022.0120400.529952.0512.520.50
94020218.0784.096.004.061975.01444.0100.03.00
94120210.02831.090.5011.571827.53268.0101.08.00
94220202.04878.085.0019.081680.05092.0102.013.00
\n", "

943 rows × 8 columns

\n", "
" ], "text/plain": [ " NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes] \\\n", "0 21504048.0 \n", "1 31028162.0 \n", "2 40552276.0 \n", "3 50076390.0 \n", "4 59600504.0 \n", ".. ... \n", "938 13003982.0 \n", "939 6512100.0 \n", "940 20218.0 \n", "941 20210.0 \n", "942 20202.0 \n", "\n", " NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes] \\\n", "0 5662.0 \n", "1 4602.5 \n", "2 3543.0 \n", "3 2483.5 \n", "4 1424.0 \n", ".. ... \n", "938 13888.0 \n", "939 7336.0 \n", "940 784.0 \n", "941 2831.0 \n", "942 4878.0 \n", "\n", " NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count] \\\n", "0 14657.00 \n", "1 20905.75 \n", "2 27154.50 \n", "3 33403.25 \n", "4 39652.00 \n", ".. ... \n", "938 8675.00 \n", "939 4385.50 \n", "940 96.00 \n", "941 90.50 \n", "942 85.00 \n", "\n", " NetworkInterStat_diff:rx_packets.ib0.htc-g003[count] \\\n", "0 23.0 \n", "1 19.5 \n", "2 16.0 \n", "3 12.5 \n", "4 9.0 \n", ".. ... \n", "938 40.0 \n", "939 22.0 \n", "940 4.0 \n", "941 11.5 \n", "942 19.0 \n", "\n", " NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes] \\\n", "0 267176.0 \n", "1 305426.0 \n", "2 343676.0 \n", "3 381926.0 \n", "4 420176.0 \n", ".. ... \n", "938 178826.0 \n", "939 120400.5 \n", "940 61975.0 \n", "941 71827.5 \n", "942 81680.0 \n", "\n", " NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes] \\\n", "0 6536.0 \n", "1 16161.0 \n", "2 25786.0 \n", "3 35411.0 \n", "4 45036.0 \n", ".. ... \n", "938 58460.0 \n", "939 29952.0 \n", "940 1444.0 \n", "941 3268.0 \n", "942 5092.0 \n", "\n", " NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count] \\\n", "0 1562.0 \n", "1 1954.0 \n", "2 2346.0 \n", "3 2738.0 \n", "4 3130.0 \n", ".. ... \n", "938 925.0 \n", "939 512.5 \n", "940 100.0 \n", "941 101.0 \n", "942 102.0 \n", "\n", " NetworkInterStat_diff:tx_packets.ib0.htc-g003[count] \n", "0 16.00 \n", "1 15.25 \n", "2 14.50 \n", "3 13.75 \n", "4 13.00 \n", ".. ... \n", "938 38.00 \n", "939 20.50 \n", "940 3.00 \n", "941 8.00 \n", "942 13.00 \n", "\n", "[943 rows x 8 columns]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_selected" ] }, { "cell_type": "markdown", "id": "74012855", "metadata": {}, "source": [ "Divide the \"bytes received\" by the \"packets received\" to get the average/estimated bytes per packet for each sampling window." ] }, { "cell_type": "code", "execution_count": 12, "id": "57d6d3b5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1467.152078\n", "1 1484.192722\n", "2 1493.390635\n", "3 1499.147239\n", "4 1503.089478\n", " ... \n", "938 1499.018098\n", "939 1484.916201\n", "940 210.604167\n", "941 223.314917\n", "942 237.670588\n", "Length: 943, dtype: float64" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "estimated_size_bytes = data_selected['NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]']\n", "estimated_size_bytes" ] }, { "cell_type": "code", "execution_count": 13, "id": "ccc13ee9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 171.047375\n", "1 156.308086\n", "2 146.494459\n", "3 139.490869\n", "4 134.241534\n", " ... \n", "938 193.325405\n", "939 234.927805\n", "940 619.750000\n", "941 711.163366\n", "942 800.784314\n", "Length: 943, dtype: float64" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "estimated_size_bytes = data_selected['NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]']\n", "estimated_size_bytes" ] }, { "cell_type": "code", "execution_count": 14, "id": "62efe14a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 246.173913\n", "1 236.025641\n", "2 221.437500\n", "3 198.680000\n", "4 158.222222\n", " ... \n", "938 347.200000\n", "939 333.454545\n", "940 196.000000\n", "941 246.173913\n", "942 256.736842\n", "Length: 943, dtype: float64" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "estimated_size_bytes = data_selected['NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]']\n", "estimated_size_bytes" ] }, { "cell_type": "code", "execution_count": 15, "id": "e976cc06", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 408.500000\n", "1 1059.737705\n", "2 1778.344828\n", "3 2575.345455\n", "4 3464.307692\n", " ... \n", "938 1538.421053\n", "939 1461.073171\n", "940 481.333333\n", "941 408.500000\n", "942 391.692308\n", "Length: 943, dtype: float64" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "estimated_size_bytes = data_selected['NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]']\n", "estimated_size_bytes" ] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.5" } }, "nbformat": 4, "nbformat_minor": 5 }