Skip to content

QNN: mobilebert failed to generate Qnn context binary #7946

@guangy10

Description

@guangy10

🐛 Describe the bug

python -m examples.qualcomm.scripts.mobilebert_fine_tune -b cmake-out -m SM8450 --compile_only --use_fp16

stacktrace:


[ERROR] [Qnn ExecuTorch]: QnnDsp <E> Context binary size calculation failed

[ERROR] [Qnn ExecuTorch]: QnnDsp <E> Failed to get serialized binary

[ERROR] [Qnn ExecuTorch]: QnnDsp <E> Failed to get context binary size with err 0x7532

[ERROR] [Qnn ExecuTorch]: Can't determine the size of graph binary to be saved to cache. Error 30002
E 00:01:45.674883 executorch:QnnManager.cpp:484] Fail to get context binary.
Traceback (most recent call last):
  File "/data/users/guangyang/executorch/examples/qualcomm/scripts/mobilebert_fine_tune.py", line 399, in <module>
    main(args)
  File "/data/users/guangyang/executorch/examples/qualcomm/scripts/mobilebert_fine_tune.py", line 270, in main
    build_executorch_binary(
  File "/home/guangyang/executorch/examples/qualcomm/utils.py", line 329, in build_executorch_binary
    exported_program = to_backend(edge_prog.exported_program, qnn_partitioner)
  File "/home/guangyang/.conda/envs/executorch/lib/python3.10/functools.py", line 878, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/home/guangyang/executorch/exir/backend/backend_api.py", line 396, in _
    tagged_graph_module = _partition_and_lower(
  File "/home/guangyang/executorch/exir/backend/backend_api.py", line 319, in _partition_and_lower
    partitioned_module = _partition_and_lower_one_graph_module(
  File "/home/guangyang/executorch/exir/backend/backend_api.py", line 249, in _partition_and_lower_one_graph_module
    lowered_submodule = to_backend(
  File "/home/guangyang/.conda/envs/executorch/lib/python3.10/functools.py", line 878, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/home/guangyang/executorch/exir/backend/backend_api.py", line 113, in _
    preprocess_result: PreprocessResult = cls.preprocess(
  File "/home/guangyang/executorch/backends/qualcomm/qnn_preprocess.py", line 110, in preprocess
    assert len(qnn_context_binary) != 0, "Failed to generate Qnn context binary."
AssertionError: Failed to generate Qnn context binary.

Versions

trunk

cc @cccclai @winskuo-quic @shewu-quic

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: examplesIssues related to demos under examples/module: qnnIssues related to Qualcomm's QNN delegate and code under backends/qualcomm/partner: qualcommFor backend delegation, kernels, demo, etc. from the 3rd-party partner, QualcommtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions