Skip to content

Additional validation in LSTM and DynamicQuantizedLSTM - #29595

Merged
Scott McKay (skottmckay) merged 10 commits into
mainfrom
skottmckay/MSRC_125531
Jul 17, 2026
Merged

Additional validation in LSTM and DynamicQuantizedLSTM#29595
Scott McKay (skottmckay) merged 10 commits into
mainfrom
skottmckay/MSRC_125531

Conversation

@skottmckay

Copy link
Copy Markdown
Contributor

Description

Validate weights against hidden_size attribute for LSTM and DynamicQuantizedLSTM to prevent OOB heap read

Motivation and Context

MSRC 125531

Skip DML and QNN as they're no longer maintained in this repo.
The self-hosted runners (1ES.Pool=onnxruntime-github-Ubuntu2204-AMD-CPU)
cannot reach registry.npmjs.org, causing 'npm install -g detox-cli' to
time out with ETIMEDOUT. Configure both the Android and iOS jobs to use
the internal feed at https://packagefeedproxy.microsoft.io/npm/ via
the registry-url parameter on actions/setup-node.
Copilot AI and others added 4 commits July 14, 2026 18:00
…29703)

### Description
`Test Linux TensorRT x64 Release` failed in `CApiTest.basic_cuda_graph`
because the third replay returned stale output after input update.
This change aligns `basic_cuda_graph` with the annotated CUDA graph test
path by using one persistent `Ort::RunOptions` object across all runs.

- **Failure addressed**
- `onnxruntime_shared_lib_test` / `CApiTest.basic_cuda_graph` expected
updated replay output (`{10, 40, 90, 160, 250, 360}`) but observed
initial output (`{1, 4, 9, 16, 25, 36}`).

- **Code change**
- In `onnxruntime/test/shared_lib/test_inference.cc`, instantiate
`Ort::RunOptions run_option;` once in `CApiTest.basic_cuda_graph`.
- Replace per-call temporaries (`Ort::RunOptions()`) with the shared
`run_option` in all three `session.Run(...)` invocations.

- **Representative snippet**
```cpp
Ort::RunOptions run_option;
session.Run(run_option, binding);  // capture
session.Run(run_option, binding);  // replay
session.Run(run_option, binding);  // replay after input update
```

### Motivation and Context
The failing TensorRT Linux Actions job was isolated to
`basic_cuda_graph`, and the behavior diverged from the passing annotated
CUDA graph path that already reuses a persistent `RunOptions`.
Unifying this usage removes the mismatch in graph replay setup for this
test scenario and addresses the observed stale-output failure.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@skottmckay
Scott McKay (skottmckay) enabled auto-merge (squash) July 17, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants