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

Common API #185

Open
attila-dusnoki-htec opened this issue Apr 10, 2024 · 5 comments
Open

Common API #185

attila-dusnoki-htec opened this issue Apr 10, 2024 · 5 comments
Assignees
Labels
Common API TensorRT Operator supported by TensorRT

Comments

@attila-dusnoki-htec
Copy link

The main idea is to come upt with a solution to mimic what HIP does for CUDA.

Ideally, we could run any TRT apps with MGX without any code change. But we could also do something similar what hipify does to convert the code to a Common API.

@attila-dusnoki-htec attila-dusnoki-htec converted this from a draft issue Apr 10, 2024
@attila-dusnoki-htec attila-dusnoki-htec added the TensorRT Operator supported by TensorRT label Apr 10, 2024
@attila-dusnoki-htec attila-dusnoki-htec moved this from 🔖 Ready to 🏗 In progress in MIGraphX ONNX support Apr 18, 2024
@mirza-halilcevic
Copy link

I created a separate issue for the initial stage: #187

@mirza-halilcevic
Copy link

mirza-halilcevic commented May 22, 2024

We started working on a C++ API equivalent to TensorRT's API. The only difference between the APIs, for now, is the namespaces (nvinfer1 -> mgxinfer1 and nvonnxparser -> mgxonnxparser). We can consider even keeping the same namespace later on. The code can be found here. At the moment, the new API is just a wrapper around the existing MIGraphX API. No modification of MIGraphX internals was needed. With this, we can successfully run the MNIST TensorRT sample.

Closed #187

@mirza-halilcevic
Copy link

mirza-halilcevic commented May 22, 2024

TensorRT has specific object lifetime rules. Some classes are factories for others and need to outlive them. Some return pointers to internal objects whose lifetime is not managed by the user. For now, we don't focus too much on these rules and use smart pointers to ensure no dangling references until we get the functionality right.

@mirza-halilcevic
Copy link

Dynamic shapes are handled differently between the two APIs. TensorRT expects the dynamic shapes after parsing, but before compilation, whereas MIGraphX expects the shapes during parsing. A workaround would be to replace the specific instructions after parsing. As discussed with the AMD team, the dynamic shapes support in MIGraphX is currently lacking, so we'll focus on that a bit later.

@mirza-halilcevic
Copy link

mirza-halilcevic commented May 22, 2024

We started implementing the API related to manual network creation. The goal is to get sampleCharRNN to run successfully. Related issue: #188

The TensorRT ONNX parser is open source with an Apache 2.0 license. This could prove useful later on with more complicated scripts that modify the network after creating it from an ONNX file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common API TensorRT Operator supported by TensorRT
Projects
Status: 🚧 Blocked
Development

No branches or pull requests

4 participants