feat: support fused_bias_residual_activation for medusa #1199
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.
Motivation
To support the ResBlock in FasterDecoding/Medusa https://github.com/FasterDecoding/Medusa/blob/700ff848f4cbfc66dfc2da30485130d64904241f/medusa/model/medusa_model.py#L43-L72, @b4b4o and I implemented fused_bias_residual_activation by referencing and porting the implementation from FasterTransformer https://github.com/NVIDIA/FasterTransformer/blob/df4a7534860137e060e18d2ebf019906120ea204/src/fastertransformer/kernels/activation_kernels.cu#L166-L284. Since this kernel is a relatively independent component, we created a separate pull request for it to be submitted first.
Hi all @lvhan028 @lzhangzz @grimoire @irexyc We have confirmed the accuracy of the entire ResBlock unit in the unit test. The corresponding code will be included in an upcoming PR, which is still undergoing refinement. Do you have any feedback or suggestions for this PR? Thanks.
Modification
add fused_bias_residual_activation in
src/turbomind/kernels
activation_kernelsChecklist