Skip to content

Releases: ultralytics/thop

v2.0.20 - Add Python 3.14 support (#124)

06 Jun 11:42
f9f76e0

Choose a tag to compare

🌟 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.19 to 2.0.20 to publish this compatibility update.
  • 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.
  • GitHub Actions Slack notification update 🔔

    • The Slack GitHub Action used in the publish workflow was updated from v3.0.2 to v3.0.3.
    • This helps keep release automation current and dependable.

🎯 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.
  • 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.
  • 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

Full Changelog: v2.0.19...v2.0.20

v2.0.19 - Bump version from 2.0.18 to 2.0.19 (#122)

24 Apr 12:20
0172d44

Choose a tag to compare

🌟 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) thop version 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 uses parameters(recurse=False) to avoid double-counting child-module parameters in hierarchical models.
  • New tests to validate Conv2D parameter counting behavior 🧪

    • Added checks for:
      • root Conv2d modules counting their own params correctly
      • Sequential wrappers not double-counting child params
  • 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).
  • 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 thop profiling: 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)

29 Oct 16:57
e58d305

Choose a tag to compare

🌟 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
  • 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
    • Bumped actions and tools:
      • actions/checkout v5 in workflows PR #101 ⬆️
      • astral-sh/setup-uv v7 PR #102
      • slackapi/slack-github-action v2.1.1 PR #100 📨
    • Tests updated to silence unused variable warnings

🎯 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

New Contributors

Full Changelog: v2.0.17...v2.0.18

v2.0.17 - Unpack star imports (#98)

03 Sep 14:04
0d37c69

Choose a tag to compare

🌟 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.fx imports 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 profile still 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

Full Changelog: v2.0.16...v2.0.17

v2.0.16 - Fix ConvTranspose (#93)

20 Aug 12:06
883c628

Choose a tag to compare

🌟 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

Full Changelog: v2.0.15...v2.0.16

v2.0.15 - Enable trilinear mode calculation in Upsample (#87)

04 Aug 07:51
a6d263f

Choose a tag to compare

🌟 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

New Contributors

Full Changelog: v2.0.14...v2.0.15

v2.0.14 - Update __init__.py (#82)

16 Jan 21:37
30e1a4f

Choose a tag to compare

🌟 Summary

Minor updates to standardize license formatting across workflow and project files. 🛠️✨

📊 Key Changes

  • Adjusted the license formatting in format.yml, publish.yml, and pyproject.toml to a consistent style:
    Changed from Ultralytics YOLO 🚀, AGPL-3.0 license to Ultralytics 🚀 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

Full Changelog: v2.0.13...v2.0.14

v2.0.13 - Update publish.yml (#76)

08 Dec 16:47
9f5dbb0

Choose a tag to compare

🌟 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, and notify.
  • ✅ 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.12 to 2.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

Full Changelog: v2.0.12...v2.0.13

v2.0.12 - Slack v2 API usage (#73)

19 Nov 09:50
df9519d

Choose a tag to compare

🌟 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.0 to v2.0.0, changing the configuration syntax for more robust notifications.
  • Version Update: The project version is incremented from 2.0.11 to 2.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

Full Changelog: v2.0.11...v2.0.12

v2.0.11 - Add environment to publish.yml (#70)

07 Nov 14:35
b01f82c

Choose a tag to compare

🌟 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.yml with 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.10 to 2.0.11 to 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.11 signals 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

Full Changelog: v2.0.10...v2.0.11