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

Replace the operator of "torch.einsum" #4

Open
zhangnju opened this issue Apr 30, 2022 · 3 comments
Open

Replace the operator of "torch.einsum" #4

zhangnju opened this issue Apr 30, 2022 · 3 comments

Comments

@zhangnju
Copy link

q, k, v = (torch.einsum("tbh, oh -> tbo", x, self.attn.in_proj_weight) + self.attn.in_proj_bias).contiguous().chunk(
3, dim=-1)

@Lednik7 Thanks for your great work on Clip-ONNX. for the pytorch operator of "torch.einsum" , if we don't want to use this operator , do you have other codes to replace this operator?
this operator is not friendly to some Inference engine, like NV TensorRT, so if you have other codes to replace einsum, that will be better

@Lednik7
Copy link
Owner

Lednik7 commented May 2, 2022

Hi @zhangnju
Thank you for using my development and looking for bugs.
In the next free time I will try to fix it. I'll let you know when it's ready

@Lednik7
Copy link
Owner

Lednik7 commented May 3, 2022

I updated the library, now everything works?

@aaronrmm
Copy link

I am able to run your model with your onnx code, but I similarly have a problem converting to tensorrt. I tried with tensorrt versions 8.5.2.2, and 8.6.1, and the error for both is at the aten_unsqueeze op:

[06/17/2024-14:43:59] [E] [TRT] ModelImporter.cpp:726: While parsing node number 0 [aten_unsqueeze -> "unsqueeze"]:
[06/17/2024-14:43:59] [E] [TRT] ModelImporter.cpp:727: --- Begin node ---
[06/17/2024-14:43:59] [E] [TRT] ModelImporter.cpp:728: input: "l_x_"
output: "unsqueeze"
name: "aten_unsqueeze_1"
op_type: "aten_unsqueeze"
attribute {
  name: "dim"
  i: 2
  type: INT
}
doc_string: ""
domain: "pkg.onnxscript.torch_lib"

[06/17/2024-14:43:59] [E] [TRT] ModelImporter.cpp:729: --- End node ---
[06/17/2024-14:43:59] [E] [TRT] ModelImporter.cpp:731: ERROR: builtin_op_importers.cpp:5427 In function importFallbackPluginImporter:
[8] Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
[06/17/2024-14:43:59] [E] Failed to parse onnx file
[06/17/2024-14:43:59] [E] Parsing model failed
[06/17/2024-14:43:59] [E] Failed to create engine from model or file.
[06/17/2024-14:43:59] [E] Engine set up failed

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

No branches or pull requests

3 participants