Skip to content

Qualcomm AI Engine Direct - heap profiling at runtime with HTP backend#19224

Open
jethroqti wants to merge 2 commits intopytorch:mainfrom
CodeLinaro:dev1/memory/profiling
Open

Qualcomm AI Engine Direct - heap profiling at runtime with HTP backend#19224
jethroqti wants to merge 2 commits intopytorch:mainfrom
CodeLinaro:dev1/memory/profiling

Conversation

@jethroqti
Copy link
Copy Markdown
Contributor

@jethroqti jethroqti commented Apr 30, 2026

Summary:
Heap profiling at runtime with HTP backend on Android platforms. DSP heap profiling is available for QnnContext_createFromBinary use-cases. It captures total DSP heap usage at two checkpoints:

  • Before the first context is created (before_context_created)
  • After the last context is freed (after_context_freed)

The difference between the two values represents heap consumed during context execution. The value after freeing is typically equal to or greater than before creation.

Test plan:
python backends/qualcomm/tests/test_qnn_delegate.py TestQNNQuantizedUtils.test_qnn_backend_runtime_option_heap_profile -b build-android -H ${HOST} -s ${SN} -m ${SOC_MODEL}

Summary:
Heap profiling at runtime with HTP backend on Android platforms.
DSP heap profiling is available for QnnContext_createFromBinary use-cases. It captures total DSP heap usage at two checkpoints:
- Before the first context is created (before_context_created)
- After the last context is freed (after_context_freed)
The difference between the two values represents heap consumed during context execution. The value after freeing is typically equal to or greater than before creation.

Test plan:
python backends/qualcomm/tests/test_qnn_delegate.py TestQNNQuantizedUtils.test_qnn_backend_runtime_option_heap_profile -b build-android -H ${HOST} -s ${SN} -m ${SOC_MODEL}
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 30, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19224

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 30, 2026
@jethroqti
Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: qualcomm"

@pytorch-bot pytorch-bot Bot added the release notes: qualcomm Changes to the Qualcomm backend delegate label Apr 30, 2026
@jethroqti
Copy link
Copy Markdown
Contributor Author

This PR is used to measure heap profiling at runtime with HTP backend on Android platforms.
Please take a look. Thanks. @cccclai @haowhsu-quic @winskuo-quic @shewu-quic

@jethroqti
Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: qualcomm"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: qualcomm Changes to the Qualcomm backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant