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

error: 'func.func' op exceeded stack allocation limit of 32768 bytes for function. Got 229376 bytes #19333

Open
pdhirajkumarprasad opened this issue Nov 28, 2024 · 3 comments
Labels
bug 🐞 Something isn't working

Comments

@pdhirajkumarprasad
Copy link

pdhirajkumarprasad commented Nov 28, 2024

What happened?

For the given IR

module {
  func.func @"torch-jit-export"(%arg2: !torch.vtensor<[16,256,56,56],f32>) -> !torch.vtensor<[16,256,56,56],f32>  attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 21 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "0.3"} {
    %10 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<1.0> : tensor<256x4x3x3xf32>} : () -> !torch.vtensor<[256,4,3,3],f32> 
    %11 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<1.0> : tensor<256xf32>} : () -> !torch.vtensor<[256],f32> 
    %12 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<1.0> : tensor<256xf32>} : () -> !torch.vtensor<[256],f32> 
    %13 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<1.0> : tensor<256xf32>} : () -> !torch.vtensor<[256],f32> 
    %14 = torch.operator "onnx.Constant"() {torch.onnx.value = dense<1.0> : tensor<256xf32>} : () -> !torch.vtensor<[256],f32> 
    %529 = torch.operator "onnx.Conv"(%arg2, %10) {torch.onnx.dilations = [1 : si64, 1 : si64], torch.onnx.group = 64 : si64, torch.onnx.kernel_shape = [3 : si64, 3 : si64], torch.onnx.pads = [1 : si64, 1 : si64, 1 : si64, 1 : si64], torch.onnx.strides = [1 : si64, 1 : si64]} : (!torch.vtensor<[16,256,56,56],f32>, !torch.vtensor<[256,4,3,3],f32>) -> !torch.vtensor<[16,256,56,56],f32> 
    %530 = torch.operator "onnx.BatchNormalization"(%529, %11, %12, %13, %14) {torch.onnx.epsilon = 9.99999974E-6 : f32, torch.onnx.momentum = 0.899999976 : f32} : (!torch.vtensor<[16,256,56,56],f32>, !torch.vtensor<[256],f32>, !torch.vtensor<[256],f32>, !torch.vtensor<[256],f32>, !torch.vtensor<[256],f32>) -> !torch.vtensor<[16,256,56,56],f32> 
    %531 = torch.operator "onnx.Relu"(%530) : (!torch.vtensor<[16,256,56,56],f32>) -> !torch.vtensor<[16,256,56,56],f32> 
    return %531 : !torch.vtensor<[16,256,56,56],f32>
  }
}

getting error as

../model.torch_onnx.mlir:10:12: error: 'func.func' op exceeded stack allocation limit of 32768 bytes for function. Got 229376 bytes
    %531 = torch.operator "onnx.Relu"(%530) : (!torch.vtensor<[16,256,56,56],f32>) -> !torch.vtensor<[16,256,56,56],f32> 
           ^

Steps to reproduce your issue

command:

iree-compile --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-cpu=host -o abc.vmfb model.torch_onnx.mlir

Version: IREE compiler version 3.1.0rc20241127 @ 615e7ff

What component(s) does this issue relate to?

Compiler

Version information

No response

Additional context

No response

@ScottTodd
Copy link
Member

ScottTodd commented Dec 2, 2024

Can you share more information about the program(s) that failed and put that information in the issue title? It's difficult to prioritize issues and expand test coverage without that context.

@pdhirajkumarprasad
Copy link
Author

Can you share more information about the program(s) that failed and put that information in the issue title? It's difficult to prioritize issues and expand test coverage without that context.

We have ONNX zoo model regnetz_* which are failing with above error

@ScottTodd
Copy link
Member

Okay, RegNetZ, a CNN-based model.

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

2 participants