torch-export-zero-payload-allocation-poc / zero_payload_measurements_latest.json
AgentRen's picture
Add Torch Export zero-payload allocation PoC
002ee7c verified
Raw
History Blame Contribute Delete
11.4 kB
{
"candidate_declared_mib": 512,
"cases": {
"candidate": {
"file_bytes": 5558,
"path": "research/triage/audits/torch-export-2026-06-24/poc/zero-payload-512m.pt2",
"reads": {
"as_1200m": {
"children_maxrss_kb_after": 800792,
"children_maxrss_kb_delta_floor": 0,
"returncode": 0,
"stderr_tail": "/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n cpu = _conversion_method_template(device=torch.device(\"cpu\"))\nW0624 10:16:19.048000 320285 torch/export/pt2_archive/_package.py:798] Cannot call torch.frombuffer() on empty bytes. Creating a tensor with zeros as workaround.\n",
"stdout": "{'shape': (134217728,), 'numel': 134217728}"
},
"as_700m": {
"children_maxrss_kb_after": 800792,
"children_maxrss_kb_delta_floor": 0,
"returncode": 1,
"stderr_tail": "3 torch/export/__init__.py:348] ^^^^^^^^^^^^^^^^\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] File \"/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py\", line 829, in _build_file_map\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] tensor = _create_flat_tensor_from_bytes(tensor_bytes, payload_meta.tensor_meta)\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] File \"/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py\", line 802, in _create_flat_tensor_from_bytes\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] tensor = torch.zeros(size, dtype=dtype, device=device)\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nW0624 10:16:16.051000 320283 torch/export/__init__.py:348] RuntimeError: [enforce fail at alloc_cpu.cpp:127] err == 0. DefaultCPUAllocator: can't allocate memory: you tried to allocate 536870912 bytes. Error code 12 (Cannot allocate memory)\nTraceback (most recent call last):\n File \"<string>\", line 7, in <module>\n File \"/home/bradd/.openclaw/workspace/research/triage/audits/torch-export-2026-06-24/poc/mutate_and_measure_pt2_zero_payload.py\", line 39, in load_pt2\n obj = torch.export.load(path)\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/__init__.py\", line 360, in load\n raise RuntimeError(\nRuntimeError: We ran into an error when deserializing the saved file. Please check the warnings above for possible errors. \n",
"stdout": ""
},
"as_900m": {
"children_maxrss_kb_after": 800792,
"children_maxrss_kb_delta_floor": 0,
"returncode": 1,
"stderr_tail": "4 torch/export/__init__.py:348] ^^^^^^^^^^^^^^^^\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] File \"/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py\", line 829, in _build_file_map\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] tensor = _create_flat_tensor_from_bytes(tensor_bytes, payload_meta.tensor_meta)\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] File \"/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py\", line 802, in _create_flat_tensor_from_bytes\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] tensor = torch.zeros(size, dtype=dtype, device=device)\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nW0624 10:16:17.557000 320284 torch/export/__init__.py:348] RuntimeError: [enforce fail at alloc_cpu.cpp:127] err == 0. DefaultCPUAllocator: can't allocate memory: you tried to allocate 536870912 bytes. Error code 12 (Cannot allocate memory)\nTraceback (most recent call last):\n File \"<string>\", line 7, in <module>\n File \"/home/bradd/.openclaw/workspace/research/triage/audits/torch-export-2026-06-24/poc/mutate_and_measure_pt2_zero_payload.py\", line 39, in load_pt2\n obj = torch.export.load(path)\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/__init__.py\", line 360, in load\n raise RuntimeError(\nRuntimeError: We ran into an error when deserializing the saved file. Please check the warnings above for possible errors. \n",
"stdout": ""
},
"uncapped": {
"children_maxrss_kb_after": 800792,
"children_maxrss_kb_delta_floor": 523132,
"returncode": 0,
"stderr_tail": "/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n cpu = _conversion_method_template(device=torch.device(\"cpu\"))\nW0624 10:16:14.401000 320271 torch/export/pt2_archive/_package.py:798] Cannot call torch.frombuffer() on empty bytes. Creating a tensor with zeros as workaround.\n",
"stdout": "{'shape': (134217728,), 'numel': 134217728}"
}
}
},
"control": {
"file_bytes": 6160,
"path": "research/triage/audits/torch-export-2026-06-24/poc/control.pt2",
"reads": {
"as_1200m": {
"children_maxrss_kb_after": 277660,
"children_maxrss_kb_delta_floor": 0,
"returncode": 0,
"stderr_tail": "/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n cpu = _conversion_method_template(device=torch.device(\"cpu\"))\n/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py:793: UserWarning: The given buffer is not writable, and PyTorch does not support non-writable tensors. This means you can write to the underlying (supposedly non-writable) buffer using the tensor. You may want to copy the buffer to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_new.cpp:1576.)\n tensor = torch.frombuffer(\n",
"stdout": "{'shape': (1,), 'numel': 1}"
},
"as_700m": {
"children_maxrss_kb_after": 277648,
"children_maxrss_kb_delta_floor": 404,
"returncode": 0,
"stderr_tail": "/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n cpu = _conversion_method_template(device=torch.device(\"cpu\"))\n/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py:793: UserWarning: The given buffer is not writable, and PyTorch does not support non-writable tensors. This means you can write to the underlying (supposedly non-writable) buffer using the tensor. You may want to copy the buffer to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_new.cpp:1576.)\n tensor = torch.frombuffer(\n",
"stdout": "{'shape': (1,), 'numel': 1}"
},
"as_900m": {
"children_maxrss_kb_after": 277660,
"children_maxrss_kb_delta_floor": 12,
"returncode": 0,
"stderr_tail": "/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n cpu = _conversion_method_template(device=torch.device(\"cpu\"))\n/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py:793: UserWarning: The given buffer is not writable, and PyTorch does not support non-writable tensors. This means you can write to the underlying (supposedly non-writable) buffer using the tensor. You may want to copy the buffer to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_new.cpp:1576.)\n tensor = torch.frombuffer(\n",
"stdout": "{'shape': (1,), 'numel': 1}"
},
"uncapped": {
"children_maxrss_kb_after": 277244,
"children_maxrss_kb_delta_floor": 277244,
"returncode": 0,
"stderr_tail": "/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n cpu = _conversion_method_template(device=torch.device(\"cpu\"))\n/home/bradd/.openclaw/workspace/research/triage/audits/pytorch-archive-tar-2026-06-23/.venv-torch/lib/python3.12/site-packages/torch/export/pt2_archive/_package.py:793: UserWarning: The given buffer is not writable, and PyTorch does not support non-writable tensors. This means you can write to the underlying (supposedly non-writable) buffer using the tensor. You may want to copy the buffer to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_new.cpp:1576.)\n tensor = torch.frombuffer(\n",
"stdout": "{'shape': (1,), 'numel': 1}"
}
}
}
}
}