This SDK has been patched to fix critical memory corruption issues in the model converter tools, specifically when handling complex graph transformations and shape inference.
- Core Fix: Replaced buggy C++ shape inference logic with a robust Python implementation in
qti.aisw.converters.qnn_backend.qnn_backend_base.reinfer_graph_shapes. - Topological Pass: Added a comprehensive graph traversal that re-computes all buffer shapes using Python logic to ensure consistency across the entire network.
- Python Caching: Dimensons, shapes, and operation parameters are now cached in Python objects to avoid direct calls to unstable C++ library functions which were causing segmentation faults and data corruption.
- Safe Property Accessors: Overrode
__setattr__and added Python-backed property accessors for critical metadata likeperm,transpose, anddims.
- Conv2D: Improved shape inference with better NCHW/NHWC layout detection and support.
- MatMul: Added auto-detection and fixing of transpose flags when inner dimensions do not match, preventing conversion failures.
- BatchNorm & Element-wise Ops: Ensured output shapes strictly match input shapes to prevent stale dimensions from propagating.
- Reshape & Transpose: Fixed NCHW to NHWC transformation logic and perm parameter handling.
- Input/Output Buffers: Removed direct C++ calls to
inputs()andoutputs()on certain nodes to avoid memory corruption during graph optimization passes.
bin/: Executables and setup scripts.docs/: Original documentation for QNN, SNPE, and Genie.examples/: Sample code and models.include/: C++ header files.lib/: Shared libraries and Python modules (Patched).share/: Additional resources and templates.
Refer to bin/envsetup.ps1 (Windows) or bin/envsetup.sh (Linux) to set up your environment variables.
Individual READMEs for QNN and Genie are available in the root directory:
QNN_README.txtGENIE_README.txt
If these patches saved you hours of debugging or prevented a system crash, consider supporting the continued maintenance of this repository.
PayPal Account: drifterself01@gmail.com