AI Infrastructure
An ONNX Graph File Can Leave Its Model Weights Outside the Delivery
An ONNX graph file can describe constant parameters whose bytes reside in separate files. Before treating the delivery as a complete model package, connect every external tensor reference to the supplied file contents, relative location, type, dimensions and byte range. A digest of the graph alone identifies only that graph file. The same unchanged graph can select different external weights and therefore describe a different numerical computation.
Follow the initializer beyond the graph file
An initializer can describe a constant tensor used by the graph while leaving its value bytes outside the protobuf model file. The ONNX v1.19.0 TensorProto schema uses data_location=EXTERNAL, whose enum value is 1, for that arrangement. DEFAULT, value 0, describes data inside the message, using raw_data or a type-specific field.
For external data, location supplies a POSIX path relative to the stored model's directory. Optional offset and length entries select the starting byte and byte count; these integers are stored as strings. An optional checksum entry describes a SHA1 digest of the referenced file. A path and a byte range locate data without specifying every value found there.
Read those fields together with the tensor's type and dimensions. The external bytes use the raw_data representation: for the FLOAT tensors below, fixed-width little-endian IEEE 754 values in row-major order. The descriptor establishes how to interpret the selected bytes; the external file supplies the bytes to interpret.
OX-32: two tensors occupy 32 bytes in a larger file
Fictional package OX-32 consists of graph.onnx and params/weights.bin. The graph refers to that relative path for both of its constant initializers, W and C. If graph.onnx sits in the package's top directory, the referenced file sits in its params subdirectory. Supplying a same-named file elsewhere does not meet that unchanged relative reference.
W has ONNX type FLOAT and dimensions [3,2]. Its six 32-bit values require 24 bytes. Its external metadata gives offset "0" and length "24", selecting [0,24). C is also FLOAT, with dimensions [1,2]. Its two values require 8 bytes, selected by offset "65536" and length "8": [65536,65544). In this range notation, the start is included and the end is excluded.
Stipulate that weights.bin is exactly 65,544 bytes long and contains no other tensors. The interval [24,65536) is a 65,512-byte gap between the selected ranges. Thus 24 + 8 = 32 tensor bytes, while 24 + 65,512 + 8 = 65,544 external-file bytes. The gap contributes no elements to W or C. The separate graph file adds its own bytes to the delivery; its size is not stipulated.
This distinction prevents two misleading comparisons. Calling weights.bin a 32-byte file ignores its gap. Calling its entire 65,544 bytes model parameters counts bytes outside the selected tensor ranges. Neither number describes startup RAM or GPU memory.
Carry the external values into the computation
OX-32 uses the historical main-domain Gemm operator definition with since_version 13. Its alpha and beta attributes are both 1, and transA and transB are both 0. The operator's formal second input, B, is supplied by initializer W, so the expression here is Y = A × W + C. Its only runtime input is FLOAT A, with shape [1,3] and values [1,1,1]; W and C are constant initializers, not additional runtime inputs.
Call the intended external contents parameter set P. W's rows are [1,0], [0,1] and [1,1], corresponding to the row-major sequence [1,0,0,1,1,1]. C has the single row [0.5,-0.5]. With A shaped [1,3] and W shaped [3,2], the product and output have shape [1,2], matching C.
The first output is 1 × 1 + 1 × 0 + 1 × 1 + 0.5 = 2.5. The second is 1 × 0 + 1 × 1 + 1 × 1 - 0.5 = 1.5. The mathematical result is therefore Y=[2.5,1.5].
Now call a second set of external contents Q. It changes only W's first value from 1 to 2, making its first row [2,0]. W's shape and selected range stay the same, as do C and A. The first output becomes 2 + 0 + 1 + 0.5 = 3.5; the second remains 1.5. Q therefore gives Y=[3.5,1.5].
Every value, file layout and condition in OX-32 is invented for this explanation. These are deductions from the named operator and stipulated inputs, with no model file created or runtime result measured. ONNX v1.19.0 pins the storage schema used here; Gemm 13 identifies the separate operator definition, rather than a library release or a complete model IR version.
An unchanged graph digest leaves P and Q unresolved
In the P-to-Q comparison, stipulate that graph.onnx remains byte-for-byte unchanged. Its location, offset, length, tensor types, dimensions and operator attributes all remain unchanged too. The graph contains no external checksum or other binding to the parameter contents. Only the first external weight value changes; weights.bin remains 65,544 bytes long.
A digest calculated only over graph.onnx consequently has the same value for both arrangements. No hash collision is involved: the hashed input has not changed. The differing bytes are outside it. A successful protobuf parse of that file likewise cannot establish whether P, Q or no external file has been supplied.
Even matching names, lengths and tensor ranges would leave this example unresolved. Both external files fit those descriptions, but they produce different mathematical outputs. To identify the intended P package, the delivery evidence must reach the external contents actually selected by the graph. A checksum declaration would also need a comparison with those contents; merely reading a declared value is a narrower observation.
Compare Offer G with a complete Offer P
Suppose the buyer requests the OX-32 computation using parameter set P. Fictional Offer G supplies graph.onnx and a digest identifying that file. G delivers the computation's graph description and external references, but omits the parameter bytes selected by those references. For this requirement, the delivery is incomplete even if its graph identity is correct.
Fictional Offer P supplies the same graph and the identified P version of weights.bin, placed at params/weights.bin relative to it. Its delivery evidence connects the supplied file contents to the intended P values and connects W and C to their stated types, dimensions and byte ranges. The package identity covers both files, rather than reporting the graph digest as though it covered the pair.
For this stipulated package, P closes the specific omission in G: every constant parameter byte needed for Y=[2.5,1.5] is supplied at the referenced location. If P instead supplied Q's equally long file, it would meet the layout description while failing the requested parameter identity. The worked calculation gives the buyer a concrete reason to require both relationships.
G can still be sufficient when the agreed purchase is only the graph and the buyer already supplies the exact required external contents. State that dependency explicitly. Equally, a genuinely complete inlined model can satisfy a one-file requirement when all required constant tensor data is contained in that file. External storage is a supported representation, not proof that a delivery is defective. Compare the actual supplied representation with what the buyer still needs to obtain.
Use package completeness for the decision it answers
P establishes the limited result that the graph and its required external parameter contents are supplied together with an interpretable layout. It establishes no permission for use, supported backend execution, acceptable model quality, startup-memory requirement or runtime measurement. Those questions need their own applicable evidence from the appointed model and application owners.
The related ONNX and TensorRT guide addresses implementation coverage and future artifact reuse. The checkpoint-deserialization guide addresses what software action loading requires. The memory-mapped loading guide addresses data residency and later startup work. Use those guides when comparing the corresponding claims; the presence of P's parameter bytes answers the earlier package question.
If a registry or release description identifies the model only by its graph-file digest, ask what identity includes the external weights. The registry-promotion guide follows that broader release into the serving application. Here, the missing link is already visible before serving: the graph reference must resolve to the intended supplied parameter contents.
Connect a separate physical equipment requirement
If the wider inference project also needs equipment installed, Leviathan's Complete Physical Infrastructure Deployment service and the linked project inquiry provide a route to discuss agreed receiving, rack integration, hardware QA, onsite installation, cabling and physical handoff records. Share a nonconfidential equipment outline, destination, target window and the physical handoff required by the receiving team so scope and availability can be confirmed.
The appointed software and model providers retain artifact packaging, loading, conversion and application evaluation. The equipment inquiry concerns the separate physical installation.
Primary sources
- [O1] ONNX v1.19.0 — TensorProto schemaChecked 2026-10-21. Defines tensor storage, row-major order, raw-data encoding and external reference fields. Its actual DataLocation enum is DEFAULT=0 and EXTERNAL=1; it governs over the obsolete MESSAGE/RAW labels in the same-tag ExternalData guide.
- [O2] ONNX v1.19.0 — External DataChecked 2026-10-21. Explains graph-directory-relative external files, reference metadata and the shared raw-data representation. Used alongside the tagged schema to interpret the selected external tensor contents.
- [O3] ONNX — Gemm, historical main-domain operator version 13Checked 2026-10-21. The Gemm 13 Summary, attributes, input/output shapes and type constraints support OX-32's mathematical calculation. The surrounding ONNX 1.24.0 documentation label does not change the historical operator version.