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] Segmentation Fault when Running Relay Transformations Iteratively #16991

Open
Jupiterghy opened this issue May 13, 2024 · 0 comments
Open
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@Jupiterghy
Copy link

Executing a sequence of Relay transformations iteratively using a custom script results in a segmentation fault (Segmentation fault (core dumped)). This issue seems to be related to the quantity of transformations applied rather than the specific optimizations in the optimizations array.

Actual behavior

Segmentation fault (core dumped)

Environment

  • Operating System: Ubuntu 18.04.5
  • TVM version: 0.15.dev0
  • ONNX: 1.15.0

Steps to reproduce

  1. Download the ONNX model
  2. Execute the script:
import onnx
import tvm
from tvm import relay

def mr1(mod):
    optimizations = [tvm.relay.transform.CombineParallelBatchMatmul(), tvm.relay.transform.CombineParallelConv2D(), tvm.relay.transform.CombineParallelDense(), tvm.relay.transform.DeadCodeElimination(), tvm.relay.transform.DefuseOps(), tvm.relay.transform.DivToMul(), tvm.relay.transform.DynamicToStatic(), tvm.relay.transform.EliminateCommonSubexpr(), tvm.relay.transform.EtaExpand(), tvm.relay.transform.FakeQuantizationToInteger(), tvm.relay.transform.FastMath(), tvm.relay.transform.FirstOrderGradient(), tvm.relay.transform.FlattenAtrousConv(), tvm.relay.transform.FoldConstant(), tvm.relay.transform.FoldExplicitPadding(), tvm.relay.transform.FoldScaleAxis(), tvm.relay.transform.ForwardFoldScaleAxis(), tvm.relay.transform.InferType(), tvm.relay.transform.Inline(), tvm.relay.transform.LambdaLift(), tvm.relay.transform.LazyGradientInit(), tvm.relay.transform.ManifestLifetimes(), tvm.relay.transform.MergeCompilerRegions(), tvm.relay.transform.PartialEvaluate(), tvm.relay.transform.PartitionGraph(), tvm.relay.transform.RemoveUnusedFunctions(), tvm.relay.transform.SimplifyExpr(), tvm.relay.transform.SimplifyInference()]
    for i in range(len(optimizations)):
        for j in range(i + 1, len(optimizations)):
            opt1 = optimizations[i]
            opt2 = optimizations[j]

            try:
                module = mod
                module = tvm.relay.transform.InferType()(module)
                module_once = opt1(opt2(module))
            except Exception as e:
                continue

if __name__ == "__main__":
    model_file = 'model.onnx'
    onnx_model = onnx.load(model_file)
    shape_dict = {'v10_0': [], 'v9_0': []}
    mod, params = relay.frontend.from_onnx(onnx_model, shape_dict, freeze_params=True)
    mr1(mod)

Triage

  • needs-triage
@Jupiterghy Jupiterghy added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

1 participant