{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/11"}],"enrichment":{"capability":"Applies specialized optimization techniques to ONNX neural network models, particularly those with Einsum and OneHot operations that standard optimizers cannot effectively reduce.","skillfed_tags":["model-optimization","onnx","neural-networks"],"use_cases":["Optimize large computer vision models with Einsum operations for deployment on resource-constrained devices.","Reduce model complexity and file size for models that onnxsim alone cannot adequately simplify.","Pre-process ONNX models before quantization or conversion to other inference formats.","Improve inference latency by reducing the operation count in models with OneHot layers.","Prepare models with fixed input dimensions for edge deployment after manual shape specification."],"what_it_does":"spo4onnx is a specialized ONNX model optimizer designed to handle cases where standard tools like onnx-optimizer and onnxsim reach their limits. It focuses on models containing Einsum and OneHot operations, which are common bottlenecks in neural network graphs. The tool works by temporarily downgrading onnxsim to version 0.4.30, applying its own optimization sequence to reduce redundant operations, then restoring the original environment. It can be used as a command-line tool or imported as a Python module.\n\nThe optimization strategy preserves Einsum operations rather than expanding them into MatMul chains, which can lead to significant reductions in model complexity\u2014documented examples show reductions from 9,988 operations to 3,927. However, the tool has important limitations: it cannot safely process models with non-deterministic output shapes (like NonZero or NonMaxSuppression), and not all models benefit equally. The package requires onnx and onnxruntime as peer dependencies and is permissively licensed under MIT.","worth_installing":"Yes, if you have ONNX models with Einsum or OneHot operations that standard optimizers leave largely unchanged and you can verify the model contains no non-deterministic operations. The low install friction and permissive license make it a low-risk addition to a model optimization pipeline. However, the dormant maintenance status means no active support for new onnxsim versions or bug fixes\u2014treat it as a specialized tool for a specific problem, not a general-purpose optimizer."},"id":"spo4onnx","links":{"html":"https://skillfed.io/packages/spo4onnx","md":"https://skillfed.io/packages/spo4onnx.md","pypi":"https://pypi.org/project/spo4onnx/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-05-07","license_spdx":null,"license_treatment":"permissive","name":"spo4onnx","python_support":"supports_current","summary":"Simple tool for partial optimization of ONNX. Further optimize some models that cannot be optimized with onnx-optimizer and onnxsim by several tens of percent. In particular, models containing Einsum and OneHot."},"popularity":{"monthly_downloads":82697,"position":14143,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.0.5"}
