Repository navigation
v2.2.3 - Count F.linear and functional multi-head attention (#186)
🌟 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.linearnow uses the same counting rule asnn.Linear. Functionalmulti_head_attention_forwardis counted using thenn.MultiheadAttentionrule, 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-uvand build packages withuv 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.MultiheadAttentioncounting 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
- Use setup-uv defaults for Python and the venv by @glenn-jocher in #184
- Suppress Slack notifications on workflow reruns by @glenn-jocher in #185
- Count F.linear and functional multi-head attention by @fcakyon in #186
New Contributors
Full Changelog: v2.2.2...v2.2.3