Torch Export PT2 tensor_values amplification PoC
This repository contains a benign security research proof of concept for a valid .pt2 artifact whose models/model.json contains 100000 unused graph.tensor_values entries.
Files
poc-tensor-values-100k.pt2- valid PT2 artifact with100000extra unused tensor metadata entriesbuild-meta.json- artifact size and entry countreproduce_pt2_tensor_values_amp.py- local replay helper
What it demonstrates
torch.export.load() still materializes all graph.tensor_values entries, even if they are not referenced by graph inputs, graph outputs, or graph nodes.
In the local measurement:
- file size is about
17.40 MB torch.export.load()takes about11.6 sru_maxrssgrows by about394 MB
Quick repro
Install:
torch==2.8.0
Then run:
python reproduce_pt2_tensor_values_amp.py poc-tensor-values-100k.pt2
Expected output shape:
{
"file_size": 17395933,
"elapsed_ms": 11634.58,
"ru_maxrss_before": 332120064,
"ru_maxrss_after": 725958656
}
This PoC is intended for defensive validation and bug bounty triage only.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support