[KernelGen][MThreads] Add adaptive_max_pool3d_backward Moore Threads specialized operator - #308
Open
Yukun-Cui wants to merge 1 commit into
Open
Conversation
Collaborator
|
/test | adaptive_max_pool3d_backward:mthreads |
❌ On-demand test failedOperator: The test failed to complete. Check the workflow run for details. |
Collaborator
|
/test | adaptive_max_pool3d_backward:mthreads |
3 similar comments
Collaborator
|
/test | adaptive_max_pool3d_backward:mthreads |
Collaborator
|
/test | adaptive_max_pool3d_backward:mthreads |
Collaborator
|
/test | adaptive_max_pool3d_backward:mthreads |
…specialized operator
Yukun-Cui
force-pushed
the
pr/mthreads-adaptive_max_pool3d_backward
branch
from
August 19, 2026 03:41
931ad9c to
aca87de
Compare
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.
[KernelGen][MThreads] Add adaptive_max_pool3d_backward Moore Threads specialized operator
Summary
Add a Moore Threads (MUSA) specialized Triton kernel for
adaptive_max_pool3d_backward, overriding the generic implementation viaruntime.replace_customized_ops(). This is the backward pass ofadaptive_max_pool3d, scattering the gradient of each output window back to its argmax input position.The kernel uses two paths:
Testing
tests/test_adaptive_max_pool3d_backward.py(-m adaptive_max_pool3d_backward)GEMS_MTHREADS ADAPTIVE_MAX_POOL3D_BACKWARDdebug logoutput_size=(8,8,8)paired withshape=(1,1,7,7,7), where output_size > input spatial dims — intentional test skips, not failures)Performance
Compared against the generic FlagGems implementation on Moore Threads (MUSA).
adaptive_max_pool3d_backward
Files Changed
src/flag_gems/runtime/backend/_mthreads/ops/adaptive_max_pool3d_backward.py: Moore Threads Triton kernel + fallbacksrc/flag_gems/runtime/backend/_mthreads/ops/__init__.py: Register import and__all__