Releases: ultralytics/thop
v2.0.20 - Add Python 3.14 support (#124)
🌟 Summary
v2.0.20 is a small but useful compatibility release for thop that officially adds Python 3.14 support 🐍✨, with a minor workflow maintenance update to keep release notifications reliable 📣
📊 Key Changes
-
Official Python 3.14 support added ✅
- The package now advertises Python 3.14 compatibility in its metadata.
- This was the main change in the release and comes from PR #124 by @glenn-jocher.
-
Version bumped to
2.0.20🔖- The package version was updated from
2.0.19to2.0.20to publish this compatibility update.
- The package version was updated from
-
No model or runtime feature changes ⚙️
- There are no new profiling features, API changes, or behavior changes in
thop. - This release is focused on compatibility and packaging metadata, not new functionality.
- There are no new profiling features, API changes, or behavior changes in
-
GitHub Actions Slack notification update 🔔
- The Slack GitHub Action used in the publish workflow was updated from
v3.0.2tov3.0.3. - This helps keep release automation current and dependable.
- The Slack GitHub Action used in the publish workflow was updated from
🎯 Purpose & Impact
-
Makes adoption of newer Python versions easier 🚀
- Users moving to Python 3.14 can more confidently install and use
thop, since the package now officially declares support.
- Users moving to Python 3.14 can more confidently install and use
-
Improves package visibility for tools and indexes 🧰
- Package managers, CI systems, and dependency tools can correctly recognize Python 3.14 compatibility.
-
Low-risk release for existing users 👍
- Since there are no functional code changes, current users should not expect behavior differences when upgrading from
2.0.19.
- Since there are no functional code changes, current users should not expect behavior differences when upgrading from
-
Better release workflow reliability 📬
- The Slack action update mainly benefits maintainers by helping publication notifications stay up to date and stable.
In short, v2.0.20 is a compatibility-focused maintenance release: the biggest takeaway is official Python 3.14 support, with no disruption to existing thop functionality 🎉
What's Changed
- Bump slackapi/slack-github-action from v3.0.2 to v3.0.3 in /.github/workflows by @UltralyticsAssistant in #123
- Add Python 3.14 support by @glenn-jocher in #124
Full Changelog: v2.0.19...v2.0.20
v2.0.19 - Bump version from 2.0.18 to 2.0.19 (#122)
🌟 Summary
v2.0.19 is a maintenance-focused release: it officially bumps the package version, improves profiling correctness for parameter counting, and modernizes CI/CD workflows—without introducing new model architectures or user-facing API changes. 📦✅
📊 Key Changes
-
(Most immediate change, current PR #122)
thopversion updated from 2.0.18 → 2.0.19 by @glenn-jocher 🔢- This is the release marker and packaging update.
-
Profiling correctness fix (important functional improvement) 🧠
- In
thop/profile.py, recursive counting now starts with the module’s own parameter count (module.total_params.item()), improving total parameter accounting. - In
thop/vision/basic_hooks.py, parameter counting now usesparameters(recurse=False)to avoid double-counting child-module parameters in hierarchical models.
- In
-
New tests to validate Conv2D parameter counting behavior 🧪
- Added checks for:
- root
Conv2dmodules counting their own params correctly Sequentialwrappers not double-counting child params
- root
- Added checks for:
-
GitHub Actions workflow upgrades ⚙️
- Updated core actions (
checkout,setup-python,upload-artifact,download-artifact) and Slack action versions. - Includes migration toward newer Node runtime requirements (Node 24 in several actions).
- Updated core actions (
-
Documentation and style cleanups 🧹
- Minor docstring formatting improvements.
- External URL cleanup (YouTube + CUDA toolkit links) for more reliable docs navigation.
🎯 Purpose & Impact
- For users of
thopprofiling: more reliable parameter totals, especially in nested module structures. 📈 - For developers and maintainers: stronger regression protection via new tests and cleaner docs. 👩💻
- For CI/CD pipelines: updated automation stack improves long-term maintainability, but self-hosted runners may need to meet newer runner/runtime requirements. 🚦
- Overall risk: low-to-moderate operational change; no new model features, but a meaningful correctness fix in profiling internals. 👍
What's Changed
- Bump actions/upload-artifact from 4 to 5 in /.github/workflows by @dependabot[bot] in #108
- Bump actions/download-artifact from 4 to 6 in /.github/workflows by @dependabot[bot] in #107
- Bump actions/setup-python from 5 to 6 in /.github/workflows by @dependabot[bot] in #106
- Update Google-style docstrings by @glenn-jocher in #109
- Bump actions/checkout from 5 to 6 in /.github/workflows by @dependabot[bot] in #110
- Bump actions/upload-artifact from 5 to 6 in /.github/workflows by @dependabot[bot] in #112
- Bump actions/download-artifact from 6 to 8 in /.github/workflows by @dependabot[bot] in #118
- Bump actions/upload-artifact from 6 to 7 in /.github/workflows by @dependabot[bot] in #117
- Bump slackapi/slack-github-action from 2.1.1 to 3.0.1 in /.github/workflows by @dependabot[bot] in #119
- Fix redirected URLs by @glenn-jocher in #120
- Bump slackapi/slack-github-action from v3.0.1 to v3.0.2 in /.github/workflows by @UltralyticsAssistant in #121
- Bump version from 2.0.18 to 2.0.19 by @glenn-jocher in #122
Full Changelog: v2.0.18...v2.0.19
v2.0.18 - Bump `thop` to 2.0.18 (#105)
🌟 Summary
thop v2.0.18 is a maintenance-focused patch release: a version bump with code quality and CI workflow updates—no runtime or API changes. ✅
📊 Key Changes
- Version bump only
- Updated package version to 2.0.18 in
thop/__init__.pyvia PR #105: Bump thop to 2.0.18 🔖
- Updated package version to 2.0.18 in
- Code quality refinements (no behavior changes)
- Lint/format tweaks and clearer logging in PR #103: Ruff RUF refactor 🧹
- Reordered
__all__, prefixed unused variables, minor f-string improvement
- Automated dependency management
- Added Dependabot configuration with monthly checks in PR #99 🤖
- CI workflow hardening
🎯 Purpose & Impact
- Safe to upgrade: No functional or API changes; existing code continues to work as-is 🚀
- Better version tracking: Easier for downstream users/tools to pin and detect the latest patch 🔍
- Improved maintainability: Cleaner code and fewer linter warnings enhance long-term stability 🛠️
- More reliable CI: Updated GitHub Actions and tooling reduce build issues and keep pipelines current 🔄
- Security and freshness: Dependabot automates dependency updates with minimal noise 🔐
Note for maintainers: actions/checkout v5 and setup-uv v7 use newer Node runtimes; ensure self-hosted runners meet the required versions for CI. 🧩
What's Changed
- Create dependabot.yml by @glenn-jocher in #99
- Bump slackapi/slack-github-action from 2.0.0 to 2.1.1 in /.github/workflows by @dependabot[bot] in #100
- Bump actions/checkout from 4 to 5 in /.github/workflows by @dependabot[bot] in #101
- Bump astral-sh/setup-uv from 4 to 7 in /.github/workflows by @dependabot[bot] in #102
- Ruff
RUFrefactor by @glenn-jocher in #103 - Bump
thopto 2.0.18 by @glenn-jocher in #105
New Contributors
- @dependabot[bot] made their first contribution in #100
Full Changelog: v2.0.17...v2.0.18
v2.0.17 - Unpack star imports (#98)
🌟 Summary
v2.0.17 focuses on cleaner, safer imports and internal refactors that make THOP more maintainable and reliable without changing its public API. 🧹✨
📊 Key Changes
- Replaced wildcard imports with explicit imports across core modules (profile, basic hooks, FX profiling) for clearer dependencies and fewer name clashes. 🔒
- Kept public APIs available at the package root and clarified exports via
__all__(e.g.,profile,profile_origin,clever_format,default_dtype). ✅ - Improved FX profiling internals with explicit
torch.fximports and clearer logging/util usage; added short docstrings for readability. 🧠 - Minor test fix (renamed a duplicate test) to ensure consistent test coverage. 🧪
- Documentation link updates to official PyTorch docs and refreshed download analytics link. 📚
- Version bump to 2.0.17. 🏷️
Top PR prioritized:
- PR #98 by @glenn-jocher: “Unpack star imports” — converts
import *to explicit imports and clarifies module boundaries for safer, more maintainable code.
Additional improvements:
- PR #94 by @pderrenger: Internal refactors improving performance, readability, and structure. 🚀
🎯 Purpose & Impact
- More reliable and maintainable codebase: explicit imports reduce accidental name collisions and make the code easier to navigate and review. 🧭
- Better tooling and IDE support: explicit symbols enable improved static analysis, autocomplete, and linting. 🛠️
- Stable user experience: no breaking API changes; root-level functions like
profilestill work as before. 👍 - Cleaner profiling internals: FX-based profiling becomes easier to reason about and extend. 🧩
Quick note for users:
- Your imports should continue to work as usual:
from thop import profile, clever_format
- If you were relying on deep, relative, or internal imports, consider switching to the documented public APIs for long-term stability. 💡
For more details, see the PRs: Unpack star imports (PR #98) and Ultralytics Refactor (PR #94).
What's Changed
- Ultralytics Refactor https://ultralytics.com/actions by @pderrenger in #94
- Unpack star imports by @glenn-jocher in #98
Full Changelog: v2.0.16...v2.0.17
v2.0.16 - Fix ConvTranspose (#93)
🌟 Summary
Improved MACs accounting for ConvTranspose layers and strengthened CI security with automated SBOMs, delivering more accurate profiling results and safer releases. 🚀
📊 Key Changes
- Correct MACs for ConvTranspose layers ✅
- Added a dedicated count_convtNd hook for ConvTranspose1d/2d/3d.
- Updated calculate_conv2d_flops with a transpose flag to correctly handle transposed convolutions.
- Clear terminology: tests now use “MACs” instead of “FLOPs” for consistency and accuracy.
- Expanded test coverage 🧪
- New ConvTranspose2d tests (no-bias, with-bias, groups, random).
- Symmetry test ensures Conv2d downsample and ConvTranspose2d upsample report equal MACs in matching setups.
- CI/Release hardening 🔐
- Automated SPDX SBOM generation attached to each release.
- More reliable SBOM workflow using a dedicated virtual environment and editable installs.
- Safer PR title handling in notifications.
- Version bump to 2.0.16.
Tip: Usage remains the same
- from thop import profile
- macs, params = profile(model, inputs=(x,))
🎯 Purpose & Impact
- More accurate complexity metrics for models using transposed convolutions (common in decoders/upsampling) ➜ better comparison, profiling, and deployment planning. 📈
- Clearer language reduces confusion between MACs and FLOPs, improving interpretability for all users. 🧠
- Stronger supply-chain transparency and compliance with SBOMs, benefiting security-conscious teams. 🛡️
- No breaking API changes; you may see adjusted (more accurate) MAC counts on ConvTranspose-heavy architectures. ✅
What's Changed
- Add automated SPDX SBOM generation to releases by @glenn-jocher in #90
- Update publish.yml by @glenn-jocher in #91
- Fix ConvTranspose by @FrzMtrsprt in #93
Full Changelog: v2.0.15...v2.0.16
v2.0.15 - Enable trilinear mode calculation in Upsample (#87)
🌟 Summary
This release introduces support for trilinear upsampling in model profiling, alongside several workflow and documentation improvements for better usability, security, and contributor experience. 🚀
📊 Key Changes
- Trilinear Upsample Support: Added calculation for trilinear mode in the Upsample layer, enabling accurate profiling of models that use 3D upsampling. 🧊
- Workflow Enhancements:
- Improved GitHub Actions workflows for code formatting, labeling, and security permissions. 🔒
- Automated Contributor License Agreement (CLA) checks for all pull requests to ensure compliance. 🤝
- Documentation Updates: Expanded and clarified README and benchmarking documentation for easier onboarding and better understanding of MACs vs. FLOPs. 📚
🎯 Purpose & Impact
- Broader Model Support: With trilinear upsampling now profiled, users working on 3D models (such as medical imaging or volumetric data) get more accurate computational metrics, making THOP more versatile. 🩻
- Smoother Contributions: Automated CLA checks and improved workflow automation make it easier and safer for new contributors to participate, while maintainers benefit from streamlined processes.
- Better Transparency & Usability: Enhanced documentation and clearer workflow permissions help both new and experienced users understand and use the tool more effectively, while also improving repository security and compliance.
Overall, this update makes THOP more robust, user-friendly, and ready for a wider range of deep learning projects! 🌐✨
What's Changed
- Ultralytics Refactor https://ultralytics.com/actions by @pderrenger in #83
- Ultralytics Refactor https://ultralytics.com/actions by @pderrenger in #84
- Add Permissions to Ultralytics Actions
format.ymlby @glenn-jocher in #85 - Potential fix for code scanning alert no. 1: Workflow does not contain permissions by @glenn-jocher in #86
- Create cla.yml by @glenn-jocher in #88
- Update cla.yml by @glenn-jocher in #89
- Enable trilinear mode calculation in Upsample by @FrzMtrsprt in #87
New Contributors
- @FrzMtrsprt made their first contribution in #87
Full Changelog: v2.0.14...v2.0.15
v2.0.14 - Update __init__.py (#82)
🌟 Summary
Minor updates to standardize license formatting across workflow and project files. 🛠️✨
📊 Key Changes
- Adjusted the license formatting in
format.yml,publish.yml, andpyproject.tomlto a consistent style:
Changed fromUltralytics YOLO 🚀, AGPL-3.0 licensetoUltralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license.
🎯 Purpose & Impact
- 📄 Improved Clarity: Ensures the license reference is standardized and easier to understand.
- ✅ Consistency: Promotes a polished, uniform format across all project-related files.
- 🌐 Transparency: Reinforces openness and accessibility by linking directly to the license details.
What's Changed
- Ultralytics Refactor https://ultralytics.com/actions by @glenn-jocher in #78
- Standardize license headers in Python files by @pderrenger in #79
- Standardize license headers in TOML/YAML files by @pderrenger in #80
- Update pyproject.toml by @glenn-jocher in #81
- Update init.py by @glenn-jocher in #82
Full Changelog: v2.0.13...v2.0.14
v2.0.13 - Update publish.yml (#76)
🌟 Summary
Release v2.0.13 introduces significant improvements to the CI/CD workflow for the Ultralytics thop repository, enhancing maintainability, automation, and efficiency for package building and publishing. 🚀
📊 Key Changes
- 🔄 The GitHub Actions workflow was modularized into clear, logical steps:
check,build,publish, andnotify. - ✅ Added precise checks to determine when to increment versioning and proceed with publishing, ensuring only necessary updates are released.
- 🛠 Refined artifact handling by separating the building process from publishing and enabling artifact uploading for better clarity.
- 🔧 Improved error handling (e.g.,
continue-on-error) for greater workflow resilience, reducing disruptions from non-critical issues. - 🔔 Enhanced Slack notifications to better inform users about success or failure in specific workflow stages.
- 📦 Updated the project version from
2.0.12to2.0.13.
🎯 Purpose & Impact
- 🧹 Streamlined Processes: The modular structure makes the CI/CD pipeline easier to understand, debug, and maintain, benefiting developers and contributors alike.
- 🚀 Improved Automation: More robust checks and workflow refinements minimize redundant actions, reducing overall execution time and ensuring smoother deployments.
- 🛡 Enhanced Reliability: Introducing better error handling prevents minor issues from halting the entire workflow, leading to more reliable operations.
- 📢 Clearer Communication: Notification improvements help keep stakeholders up-to-date with the exact status of releases.
This update makes development workflows more efficient for contributors while ensuring smoother experiences for end-users through well-tested and efficiently published updates. 🎉
What's Changed
- Ultralytics Refactor https://ultralytics.com/actions by @pderrenger in #74
- Update publish.yml by @glenn-jocher in #75
- Update publish.yml by @glenn-jocher in #76
Full Changelog: v2.0.12...v2.0.13
v2.0.12 - Slack v2 API usage (#73)
🌟 Summary
The release v2.0.12 enhances Slack integration for notifications and updates the project's version.
📊 Key Changes
- Slack Integration Update: The Slack GitHub action is upgraded from version
v1.26.0tov2.0.0, changing the configuration syntax for more robust notifications. - Version Update: The project version is incremented from
2.0.11to2.0.12, reflecting these updates.
🎯 Purpose & Impact
- Improved Notification Stability: The update to Slack's latest version ensures more reliable notifications for workflow successes and failures, leveraging enhancements from the Slack action update.
- Version Bump for Maintenance: Upgrading the version helps users and developers track changes easily, underscoring minor improvements or bug fixes without major functional shifts.
What's Changed
- Update publish.yml to PyPI by @glenn-jocher in #71
- Fix PyPI downloads links by @pderrenger in #72
- Slack v2 API usage by @glenn-jocher in #73
Full Changelog: v2.0.11...v2.0.12
v2.0.11 - Add environment to publish.yml (#70)
🌟 Summary
The v2.0.11 release for the ultralytics/thop project focuses on refining the deployment process through improved GitHub Actions workflows and enhanced notification clarity.
📊 Key Changes
- GitHub Actions Enhancement: Updated the
publish.ymlwith an environment section detailing deployment specifications, including environment name and URL for better tracking via GitHub's Deployments tab. - Version Number Update: Incremented the version number from
2.0.10to2.0.11to reflect these updates. - Notification Improvements: Enhanced Slack notifications in GitHub Actions to display the current release tag being published, improving the context of updates.
🎯 Purpose & Impact
- Streamlined Deployment: The addition of environment details in the workflow increases transparency and organization in the deployment process, aiding developers in effectively managing and tracking releases. 🌐
- Clear Versioning: The version bump to
2.0.11signals minor improvements, assisting users in pinpointing updates and maintaining software consistency. 🆙 - Improved Communication: Updating Slack notifications with more precise information helps team members quickly recognize and respond to the latest package releases, enhancing the team's operational efficiency. 📢🚀
What's Changed
- Update publish.yml by @glenn-jocher in #69
- Add environment to publish.yml by @glenn-jocher in #70
Full Changelog: v2.0.10...v2.0.11