Skip to content

v2.2.3 - Count F.linear and functional multi-head attention (#186)

Choose a tag to compare

@github-actions github-actions released this 19 Oct 20:35
· 3 commits to main since this release
cc9e36f

🌟 Summary

THOP 2.2.3 improves FLOPs profiling for functional linear and multi-head attention operations, while also streamlining release workflows.

📊 Key Changes

  • 🧮 More complete FLOPs counts: Functional F.linear now uses the same counting rule as nn.Linear. Functional multi_head_attention_forward is counted using the nn.MultiheadAttention rule, including calls that pass arguments by keyword.
  • ✅ Avoids double-counting: Existing module-level rules remain in effect, so operations inside supported modules are not counted again by the functional counters.
  • 📦 Version bump: Updates the package version from 2.2.2 to 2.2.3.
  • ⚙️ Simplified CI and publishing: Workflows use the activated environment provided by setup-uv and build packages with uv build.
  • 🔔 Cleaner notifications: Workflow reruns no longer send duplicate Slack notifications.

🎯 Purpose & Impact

  • 📈 Models that use functional linear or attention operations are less likely to have their compute reported as zero or understated. This also addresses nn.MultiheadAttention counting gaps on older PyTorch versions.
  • 🔍 More reliable FLOPs estimates help users compare models and understand their computational cost.
  • 🛠️ The workflow changes simplify environment setup and reduce duplicate release notifications without changing the package’s wheel contents.

What's Changed

New Contributors

Full Changelog: v2.2.2...v2.2.3