﻿# ONNX Runtime TensorRT cycle removal: graph vertex IDs are not subgraph-vector offsets

The 1.32 TensorRT cycle fix maps vertex identities explicitly; test skipped entries and misleading names rather than assuming numbering systems coincide.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-ort-tensorrt-cycle-vertex-index-map/
Language: en

ONNX Runtime 1.32.0 fixes TensorRT subgraph-cycle removal by explicitly mapping cycle-graph vertex IDs to supported subgraph positions. The linked PR describes failures when names or skipped entries made those numbering systems diverge. An integer that identifies a graph vertex is not automatically a valid index into another data structure.

## Two collections can assign different numbers

Cycle detection constructs a graph containing TensorRT subgraphs and other nodes. The supported-subgraph vector is another collection with its own positions. Skipping empty entries during graph construction can break a direct numerical correspondence. A proposed regression includes such gaps and checks which actual subgraph is removed. Staying within a vector’s bounds is insufficient if the selected element is still the wrong subgraph.

## Names are not ownership proof

The PR removes reliance on a node-name substring for identifying an actual TensorRT subgraph entry. A non-TensorRT node can contain the same text in its name. A proposed negative case uses that misleading name and verifies it cannot authorize removal of an unrelated vector element. This is an identity check, not a recommendation to reserve naming conventions as a substitute for structural metadata.

## Cycle repair changes partitioning, not the model function

A provider may need to decline a cyclic proposed partition while preserving the original graph’s semantics through another placement. A local test should inspect final partitions and compare complete outputs with a trusted route. Session initialization alone does not prove the right subgraph survived. Also record whether the repaired decision introduces fallback or transfers, because a correctness fix can legitimately change performance without changing the intended mathematical result.

## Do not generalize to every TensorRT cycle

The release fixes mapping during removal, not every possible cause of a cyclic partition proposal. This article reports the identifier distinction and proposed structural cases without new TensorRT measurements. A useful outcome shows correct selection and bounds handling under divergent numbering, then verifies numerical equivalence of the final executable graph. The source model’s own validity remains a separate requirement.

## Sources

- [ONNX Runtime v1.32.0 release](https://github.com/microsoft/onnxruntime/releases/tag/v1.32.0)
- [ONNX Runtime pull request #34025](https://github.com/microsoft/onnxruntime/pull/34025)

## Related reading

- [ONNX Runtime provider order: graph partition priority is not request failover](/journal/fg2-onnxruntime-provider-priority-subgraph-partition/)
- [ONNX Runtime offline optimization: a saved optimized graph inherits a target contract](/journal/fg2-onnxruntime-offline-graph-target-compatibility/)
