Skip to content

Revamp MultiThreshold#201

Merged
maltanar merged 8 commits intomainfrom
feature/threshold_revamp
Sep 11, 2025
Merged

Revamp MultiThreshold#201
maltanar merged 8 commits intomainfrom
feature/threshold_revamp

Conversation

@maltanar
Copy link
Copy Markdown
Collaborator

  • Clean reimplementation of the core multithresholding implementation based solely on numpy broadcasting and vectorized ops, no more loops. Much faster and capable of supporting arbitrary dimensionality/data layout.
  • Allow core multithresholding op to optionally do channels-last conversion where needed, simplifying the MultiThreshold op wrapper.
  • Bring back performance benchmark in test_multithreshold.py
  • Expands test cases for the core multithresholding implementation to cover more combinations of dimensions and tensor shapes

Example run from performance benchmark:

input size (128, 1024, 1) with 254 global (not per-channel) thresholds

before:
Runtime non-vectorized:  31.17622971534729 s
Runtime vectorized:  128.39458513259888 s
Speed-up:  0.24281576737173294

after:
Runtime non-vectorized:  31.00561213493347 s
Runtime vectorized:  0.057237863540649414 s
Speed-up:  541.6975794862396

@maltanar maltanar merged commit 82f38a2 into main Sep 11, 2025
3 checks passed
@maltanar maltanar deleted the feature/threshold_revamp branch September 11, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants