-
Notifications
You must be signed in to change notification settings - Fork 691
feat: Support Fused MoE non gated Relu2 NVFP4 & FP8 and support Nemotron #2304
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
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
46205b4
Using ActivationType instead of GatedActType, added compiled kernels,…
amitz-nv b8eac34
Add actType and eltwiseActType to 'no kernel found' message, move is_…
amitz-nv f771e0c
Update remaining GatedActType uses to ActivationType, remove GatedAct…
amitz-nv 440c062
Use ActivationType in benchmarks, add missing activation_type argument
amitz-nv 5725739
Minor fixes
amitz-nv c2c8531
Fix activation_type default value to Swiglu on trtllm_fp4_block_scale…
amitz-nv bb4e821
Minor improvement
amitz-nv c6ac4af
Support non-gated activation in NVFP4 block scale MoE
amitz-nv 3bf918e
Rename useShuffledMatrixA to useShuffledMatrix (remove the 'A' suffix)
amitz-nv 1193b02
Add FP4_NVFP4_NVFP4 parameterization to test_llama4_routing, update t…
amitz-nv b0e6d59
Increase supported topK and num experts in deepseek routing for nemotron
amitz-nv d4182ae
Commit more files for increase supported topK and num experts in deep…
amitz-nv 8ee2193
Fix formatting
amitz-nv c899d16
Change TODO to comment
amitz-nv 0f6f15c
Change default activation_type to Swiglu
amitz-nv cf6f76b
Restore intermediate size factor of 2 for gated activation in getWork…
amitz-nv e63e17d
Formatting fixes
amitz-nv 8398e20
Treat SwigluBias as gated activation
amitz-nv ea67cef
Fix use of ActivationType enum in CLI
amitz-nv abefe22
Fix activation-type command line argument handling in benchmarks
amitz-nv da35764
Fix choices of activation-type command line argument handling in benc…
amitz-nv 205989f
GEMM (non batched) still has mUseShuffledMatrixA member (with 'A' suf…
amitz-nv e467f1d
Update bench_trtllm_gen_fused_moe_autotuner.py to support more activa…
amitz-nv 80d1b53
Revert activation_Type check in bench_trtllm_gen_fused_moe_autotuner.…
amitz-nv 21e0e08
Include activation type in results in benchmarks/routings/moe.py
amitz-nv 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
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
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
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
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 |
|---|---|---|
|
|
@@ -101,14 +101,16 @@ TrtllmGenBatchedGemmRunner::TrtllmGenBatchedGemmRunner( | |
| options.mTransposeMmaOutput == mOptions.transposeMmaOutput && | ||
| (!doesRouteImplUseNoRoute(options.mRouteImpl)) == mOptions.routeAct && | ||
| options.mFusedAct == mOptions.fusedAct && options.mIsStaticBatch == mOptions.staticBatch && | ||
| tileSize == mOptions.tileSize && | ||
| options.mUseShuffledMatrix == mOptions.useShuffledMatrixA && | ||
| tileSize == mOptions.tileSize && options.mUseShuffledMatrix == mOptions.useShuffledMatrix && | ||
| options.mLayoutA == mOptions.weightLayout) { | ||
| if (options.mFusedAct) { | ||
| if (options.mActType != static_cast<batchedGemm::gemmGatedAct::ActType>(mOptions.actType)) { | ||
| continue; | ||
| } | ||
| } | ||
| if ((int64_t)options.mEltwiseActType != (int64_t)mOptions.eltwiseActType) { | ||
| continue; | ||
| } | ||
|
|
||
| if (mOptions.transposeMmaOutput && options.mEpilogueTileM == mOptions.epilogueTileM) { | ||
| mPassingConfigIndices.push_back(i); | ||
|
|
@@ -122,6 +124,8 @@ TrtllmGenBatchedGemmRunner::TrtllmGenBatchedGemmRunner( | |
| << ", mDtypeB: " << tg::dtypeToString(mOptions.dtypeB) | ||
| << ", mDtypeC: " << tg::dtypeToString(mOptions.dtypeC) | ||
| << ", mUseDeepSeekFp8: " << mOptions.deepSeekFp8 | ||
| << ", mActType: " << (int64_t)mOptions.actType | ||
| << ", mEltwiseActType: " << (int64_t)mOptions.eltwiseActType | ||
| << ", mTransposeMmaOutput: " << mOptions.transposeMmaOutput | ||
| << ", mRouteAct: " << mOptions.routeAct << ", mFusedAct: " << mOptions.fusedAct | ||
| << ", mIsStaticBatch: " << mOptions.staticBatch << ", mTileSize: " << mOptions.tileSize; | ||
|
|
@@ -219,6 +223,8 @@ void TrtllmGenBatchedGemmRunner::run( | |
| gemmData.mInputBuffers.mPtrSfB = mOptions.transposeMmaOutput ? sfA : sfB; | ||
| gemmData.mInputBuffers.mPtrScaleC = scaleC; | ||
| gemmData.mInputBuffers.mPtrScaleGate = scaleGateC; | ||
| // For simplicity pass set scaleAct to scaleGateC | ||
| gemmData.mInputBuffers.mPtrScaleAct = scaleGateC; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Decide whether it's OK or fix in the future? |
||
| gemmData.mInputBuffers.mPtrPerTokenSfA = | ||
| mOptions.transposeMmaOutput ? perTokensSfB : perTokensSfA; | ||
| gemmData.mInputBuffers.mPtrPerTokenSfB = | ||
|
|
||
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.