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

🐛 [Bug] "Cannot convert symbols to int" when compiling graph that outputs tensor with dynamic shape #3269

Open
dgcnz opened this issue Oct 31, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dgcnz
Copy link
Contributor

dgcnz commented Oct 31, 2024

Bug Description

When doing parse_graph_io on a graph that outputs a tensor with dynamic shapes, extract_var_range_info(node.meta["val"]) fails because tensor.shape[0] in opt_val = int(tensor.shape[0].node.shape_env.get(expr) is an unbacked SymInt without an actual value attached.

This sort of makes sense, so I'm not sure if it's a bug or a non-feature.

Anyway, (I think) another possible source to get a value for that unbacked symint is to use tensor.shape[0].node.shape_env.dim_constraints._static_results which returns {"L['x'].size()[0] == 10"}.

To Reproduce

MRE and logs in this gist.

Expected behavior

Not sure.

Environment

Build information about Torch-TensorRT can be found by turning on debug messages

  • Torch-TensorRT Version (e.g. 1.0.0): 2.6.0.dev20241030+cu124
  • PyTorch Version (e.g. 1.0): 2.6.0.dev20241028+cu124
  • CPU Architecture: x86_64
  • OS (e.g., Linux): Linux
  • How you installed PyTorch (conda, pip, libtorch, source): pip
  • Build command you used (if compiling from source): -
  • Are you using local sources or building from archives: -
  • Python version: 3.10.0
  • CUDA version: 12.4
  • GPU models and configuration: 4060 TI
  • Any other relevant information: -
@dgcnz dgcnz added the bug Something isn't working label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants