Skip to content

Commit 2187fc0

Browse files
authored
Qualcomm AI Engine Direct - heap profiling at runtime on target (pytorch#20272)
### 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} ### Note This test is expected to run on target device.
1 parent 0378fc4 commit 2187fc0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎backends/qualcomm/tests/test_qnn_delegate.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,6 +6181,8 @@ def test_qnn_backend_profile_op(self):
61816181
TestQNN.profile_level = 0
61826182

61836183
def test_qnn_backend_runtime_option_heap_profile(self):
6184+
if self.enable_x86_64:
6185+
self.skipTest("heap profiling is not supported on host machine")
61846186
module = SimpleModel() # noqa: F405
61856187
sample_input = (torch.ones(1, 32, 28, 28), torch.ones(1, 32, 28, 28))
61866188

@@ -7122,6 +7124,8 @@ def test_qnn_backend_profile_op(self):
71227124
TestQNN.profile_level = 0
71237125

71247126
def test_qnn_backend_runtime_option_heap_profile(self):
7127+
if self.enable_x86_64:
7128+
self.skipTest("heap profiling is not supported on host machine")
71257129
module = SimpleModel() # noqa: F405
71267130
sample_input = (torch.ones(1, 32, 28, 28), torch.ones(1, 32, 28, 28))
71277131
module1 = self.get_qdq_module(module, sample_input)

0 commit comments

Comments
 (0)