Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polygraphy: how to compare the precision layer by layer with TensorRT if I have a custom operator in my onnx (and a corresponding plugin in TensorRT)? #4256

Open
MyraYu2022 opened this issue Nov 22, 2024 · 2 comments
Labels
Plugins Issues when using TensorRT plugins Tools: Polygraphy Issues with Polygraphy triaged Issue has been triaged by maintainers

Comments

@MyraYu2022
Copy link

Description

I used to check my engine(tensorRT) layer by layer with onnx using polygraphy tool. But I have a custom operator writen by myself in my onnx, and a corresponding plugin in my tensorRT now and how can I compare them layer by layer using polygraphy?

I write the .sh script like this:

 polygraphy run my_model_with_custom_operator.onnx  \
                --onnxrt --trt  \
                --trt-outputs mark all  \
                --onnx-outputs mark all  \
                --atol 1e-3  --rtol 1e-3  \
                --fail-fast  \
                --val-range [0,1]  \
                --verbose 

And I get error as below:
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Fatal error: customPlugin(-1) is not a registered function/op

Thank you very much.

Environment

TensorRT Version:
8.4.0.6

NVIDIA Driver Version:
535.183.01

CUDA Version:
11.3

CUDNN Version:
8.3.2.44

Operating System:

Python Version (if applicable):
3.9.7

PyTorch Version (if applicable):
1.13.0

@MyraYu2022 MyraYu2022 changed the title Polygraphy: how to compare the precision layer by layer with engine(for example, tensorRT) if I have a custom operator in my onnx (and a corresponding plugin in TensorRT)? Polygraphy: how to compare the precision layer by layer with TensorRT if I have a custom operator in my onnx (and a corresponding plugin in TensorRT)? Nov 22, 2024
@MyraYu2022 MyraYu2022 reopened this Nov 25, 2024
@lix19937
Copy link

polygraphy support plugins load.

@lix19937
Copy link

Like follow

# Build and run TensorRT engine with plugins

polygraphy run modelB.onnx \
    --trt \
    --plugins ./AddScalarPlugin.so \
    > result.log 2>&1

ref https://docs.nvidia.com/deeplearning/tensorrt/polygraphy/docs/backend/trt/loader.html#polygraphy.backend.trt.loader.LoadPlugins

@poweiw poweiw added Plugins Issues when using TensorRT plugins triaged Issue has been triaged by maintainers Tools: Polygraphy Issues with Polygraphy labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugins Issues when using TensorRT plugins Tools: Polygraphy Issues with Polygraphy triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants