[WIP] Optimizing grouped convolutions#212
Open
jfsantos wants to merge 4 commits intosdatkinson:mainfrom
Open
Conversation
…chmarking tool for convolution performance.
… for Conv1D Conv1x1: Use explicit group loop with groups=1 fast path. For small channel counts (2-8), this avoids the overhead of zero multiplications in block-diagonal matrices that BLAS cannot optimize efficiently. Conv1D: Keep block-diagonal approach (single matmul per kernel position) which shows 1.5-1.9x speedup for grouped convolutions. The multiple kernel positions amortize the overhead, making this approach beneficial. Removed pre-computed GroupBlock structs as they are no longer needed with these simplified implementations. Updated benchmark tool to test channels 2-8 for detailed comparison. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimizing grouped convolutions by pre-computing weight block indices and unrolling loops for common numbers of groups. Also added a performance benchamark for Conv1D and Conv1x1.
Other potential updates (still not implemented):