{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/6"}],"enrichment":{"capability":"Counts multiply-accumulate operations (MACs) in PyTorch models by tracing the computation graph, providing both aggregate and per-operator breakdowns.","skillfed_tags":["profiling","pytorch","model-analysis"],"use_cases":["Estimate computational cost of a model before deploying to resource-constrained devices.","Compare MAC efficiency across different model architectures or hyperparameter choices.","Identify which layers in a model consume the most computation for optimization targeting.","Profile models during development to catch unexpectedly expensive operations early.","Generate per-operator breakdowns for detailed performance analysis and model auditing."],"what_it_does":"TorchProfile is a lightweight profiler that measures the computational cost of PyTorch models by counting multiply-accumulate operations (MACs). It works by tracing the model's computation graph using torch.jit.trace, which is more accurate than hook-based profilers and more general than ONNX-based approaches. The package outputs either a single aggregate MAC count or a per-operator breakdown showing which layers consume the most computation.\n\nYou pass a model and sample input tensors to the profile_macs function, and it returns the total MACs or a dictionary mapping operation nodes to their individual MAC counts. This is useful for understanding model efficiency, comparing architectures, and identifying computational bottlenecks without running the model on actual hardware.","worth_installing":"Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real need for PyTorch developers who want to profile model efficiency. The MIT license is permissive. Main caveat: your model must be traceable with torch.jit.trace, which excludes models with dynamic control flow."},"id":"torchprofile","links":{"html":"https://skillfed.io/packages/torchprofile","md":"https://skillfed.io/packages/torchprofile.md","pypi":"https://pypi.org/project/torchprofile/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-10","license_spdx":null,"license_treatment":"permissive","name":"torchprofile","python_support":"supports_current","summary":"Count the MACs / FLOPs of PyTorch models"},"popularity":{"monthly_downloads":297561,"position":7882,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.1.0"}
