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

Support for MultiScaleDeformableAttn module #73

Open
Thaslim opened this issue Mar 8, 2024 · 5 comments
Open

Support for MultiScaleDeformableAttn module #73

Thaslim opened this issue Mar 8, 2024 · 5 comments
Labels
question Further information is requested

Comments

@Thaslim
Copy link

Thaslim commented Mar 8, 2024

I am trying to profile BEVFormer which has MultiScaleDeformableAttn module,
current tool throws error:
NotImplementedError: this Node MultiScaleDeformableAttnTRT2-MultiScaleDeformableAttnTRT2_2825 has no value_infer
Is there any workaround/ plan to support Deformable attention layer.
I am mainly looking to get list of OPs and MAC/ Param counts.

@ThanatosShinji
Copy link
Owner

ThanatosShinji commented Mar 9, 2024

You should profile this model with custom-registered nodes, refer this

@ThanatosShinji ThanatosShinji added the question Further information is requested label Mar 9, 2024
@Thaslim Thaslim closed this as completed Mar 12, 2024
@Thaslim Thaslim reopened this Mar 12, 2024
@Thaslim
Copy link
Author

Thaslim commented Mar 12, 2024

Hi
I get the following error when trying the example mentioned using @NODE_REGISTRY
When I try to import NODEPROFILER_REGISTRY, it throws an error

/home/thasleem.tajudeen/miniconda3/envs/cramnet/lib/python3.9/site-packages/onnx_tool/node.py:2511: UserWarning: node MultiScaleDeformableAttnTRT2 is not registed for profiling, return 0 Macs and 0 params as default. Use NODEPROFILER_REGISTRY to register your profiler for this node.
  warnings.warn(f'node {n.op_type} is not registed for profiling, return 0 Macs and 0 params as default. '
Node Init Time Elapsed 0.007455110549926758
Tensor Init Time Elapsed 0.11277580261230469
IO Tensor Init Time Elapsed 0.0007681846618652344
Traceback (most recent call last):
  File "/home/thasleem.tajudeen/enntools-workspace/BFCP/bfcp_head/bev.py", line 44, in <module>
    bevformer()
  File "/home/thasleem.tajudeen/enntools-workspace/BFCP/bfcp_head/bev.py", line 37, in bevformer
    m = onnx_tool.Model(file,{'verbose':True,"constant_folding":True})
  File "/home/thasleem.tajudeen/miniconda3/envs/cramnet/lib/python3.9/site-packages/onnx_tool/model.py", line 26, in __init__
    self.graph = Graph(m.graph, self.cfg)
  File "/home/thasleem.tajudeen/miniconda3/envs/cramnet/lib/python3.9/site-packages/onnx_tool/graph.py", line 184, in __init__
    self.__constant_search__(self.cfg.constant_folding)
  File "/home/thasleem.tajudeen/miniconda3/envs/cramnet/lib/python3.9/site-packages/onnx_tool/graph.py", line 290, in __constant_search__
    this_node.value_infer(itensors, otensors)
  File "/home/thasleem.tajudeen/miniconda3/envs/cramnet/lib/python3.9/site-packages/onnx_tool/node.py", line 158, in value_infer
    raise NotImplementedError(f'this Node {self.op_type}-{self.name} has no value_infer')
NotImplementedError: this Node MultiScaleDeformableAttnTRT2-MultiScaleDeformableAttnTRT2_2825 has no value_infer

@ThanatosShinji
Copy link
Owner

@Thaslim It seems that you used a different ONNX model. In my example, the TRT operator is MultiScaleDeformableAttnTRT, but you got MultiScaleDeformableAttnTRT2.

@Thaslim
Copy link
Author

Thaslim commented Jun 6, 2024

Hi @ThanatosShinji ,The ONNX model I have uses this TRT plugin

@ThanatosShinji
Copy link
Owner

how to get this model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants