-
Notifications
You must be signed in to change notification settings - Fork 493
[Mthreads] Optimized mm addmm bmm with FlagOSTune #2643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
huangyiqun
merged 14 commits into
flagos-ai:master
from
Fattysand:feature/mm-addmm-bmm-flagtune-support
Apr 27, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b00c233
add flagtune support for mm and addmm operators on mthreads backend
Fattysand 3f54d09
feat: add FlagTune auto-tuning support for mm and addmm operators
Fattysand d7e9f4e
add flagtune for bmm.py and bmm_mthreads_expand.yaml
Fattysand a98db0e
modify mm_hopper_expand.yaml
Fattysand cbf288f
modify SQMMA_ON switch for mthreads mm addmm bmm
Fattysand 79b2611
fix mthreads ops and use configloader logic
Fattysand 37e129b
sync utils.py
Fattysand 3953ba7
fix bug in fp32 for mm/addmm/bmm
Fattysand c6605d6
modify test_blas_perf_parallel func: test_blas_benchmark
Fattysand 0dcac0b
Modify as required
Fattysand 1939717
fix test_blas_perf_parallel
Fattysand 1dc8970
precommit test_blas_perf_parallel
Fattysand c410a3f
Merge branch 'flagos-ai:master' into feature/mm-addmm-bmm-flagtune-su…
Fattysand 1537529
Merge branch 'flagos-ai:master' into feature/mm-addmm-bmm-flagtune-su…
Fattysand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
src/flag_gems/runtime/backend/_mthreads/addmm_mthreads_expand.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| addmm_sqmma: | ||
| - config: | ||
| param_map: | ||
| META: | ||
| BLOCK_SIZE_M: block_m | ||
| BLOCK_SIZE_N: block_n | ||
| BLOCK_SIZE_K: block_k | ||
| num_stages: stages | ||
| num_warps: warps | ||
| block_m: | ||
| - 64 | ||
| - 128 | ||
| block_n: | ||
| - 64 | ||
| - 128 | ||
| block_k: | ||
| - 64 | ||
| - 128 | ||
| stages: | ||
| - 3 | ||
| - 4 | ||
| - 5 | ||
| - 6 | ||
| warps: | ||
| - 4 | ||
| - 8 | ||
| - strategy: | ||
| M: default | ||
| N: default | ||
| K: default | ||
30 changes: 30 additions & 0 deletions
30
src/flag_gems/runtime/backend/_mthreads/bmm_mthreads_expand.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| bmm_sqmma: | ||
| - config: | ||
| param_map: | ||
| META: | ||
| BLOCK_SIZE_M: block_m | ||
| BLOCK_SIZE_N: block_n | ||
| BLOCK_SIZE_K: block_k | ||
| num_stages: stages | ||
| num_warps: warps | ||
| block_m: | ||
| - 64 | ||
| - 128 | ||
| block_n: | ||
| - 64 | ||
| - 128 | ||
| block_k: | ||
| - 64 | ||
| - 128 | ||
| stages: | ||
| - 3 | ||
| - 4 | ||
| - 5 | ||
| - 6 | ||
| warps: | ||
| - 4 | ||
| - 8 | ||
| - strategy: | ||
| M: default | ||
| N: default | ||
| K: default |
95 changes: 95 additions & 0 deletions
95
src/flag_gems/runtime/backend/_mthreads/mm_mthreads_expand.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| mm_general_tma: | ||
| - config: | ||
| param_map: | ||
| META: | ||
| BLOCK_M: block_m | ||
| BLOCK_N: block_n | ||
| BLOCK_K: block_k | ||
| num_stages: stages | ||
| num_warps: warps | ||
| block_m: | ||
| - 64 | ||
| - 128 | ||
| block_n: | ||
| - 64 | ||
| - 128 | ||
| block_k: | ||
| - 64 | ||
| - 128 | ||
| stages: | ||
| - 1 | ||
| warps: | ||
| - 4 | ||
| - 8 | ||
| - strategy: | ||
| M: default | ||
| N: default | ||
| K: default | ||
| stride_am: default | ||
| stride_bk: default | ||
| dtype: default | ||
| mm: | ||
| - config: | ||
| param_map: | ||
| META: | ||
| BLOCK_M: block_m | ||
| BLOCK_N: block_n | ||
| BLOCK_K: block_k | ||
| num_stages: stages | ||
| num_warps: warps | ||
| block_m: | ||
| - 32 | ||
| - 64 | ||
| - 128 | ||
| block_n: | ||
| - 32 | ||
| - 64 | ||
| - 128 | ||
| block_k: | ||
| - 64 | ||
| - 128 | ||
| stages: | ||
| - 3 | ||
| - 4 | ||
| - 5 | ||
| - 6 | ||
| - 7 | ||
| - 8 | ||
| warps: | ||
| - 4 | ||
| - 8 | ||
| - strategy: | ||
| M: default | ||
| N: default | ||
| K: default | ||
| stride_am: default | ||
| stride_bk: default | ||
| gemv: | ||
| - config: | ||
| param_map: | ||
| META: | ||
| BLOCK_M: block_m | ||
| BLOCK_K: block_k | ||
| num_stages: stages | ||
| num_warps: warps | ||
| block_m: | ||
| - 8 | ||
| - 16 | ||
| - 32 | ||
| - 64 | ||
| block_k: | ||
| - 128 | ||
| - 256 | ||
| stages: | ||
| - 3 | ||
| - 4 | ||
| - 5 | ||
| - 6 | ||
| warps: | ||
| - 4 | ||
| - 8 | ||
| - strategy: | ||
| M: default | ||
| K: default | ||
| stride_am: default | ||
| stride_bk: default |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.