NVIDIA / NVIDIA/TensorRT

Add support for determnisitc seed in RandomUniform on ONNX imports

Open
#4,497 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

TensorRT currently ignores the "seed" field in RandomUniform or RandomNormal ONNX operations. A nondeterministic random seed is used every time a TensorRT engine is rebuild.

https://github.com/onnx/onnx-tensorrt/blob/ff761afc76f4a352e88200199e86a375bfbf9928/onnxOpImporters.cpp#L4488

It would be nice to have a way to set the seed for random tensors from the outside like it's the case with PyTorch and NumPy for example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at onnxOpImporters.cpp around line 4488 and inspect how RandomUniform and RandomNormal imports handle the ONNX seed field. Trace how TensorRT engines are rebuilt and how an external seed could be supplied, then define validation that repeated builds produce deterministic random tensors when a seed is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.