Heuristics for mmq_id -> original threshold #734
Merged
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.
This is a follow up of #728.
For large enough u-batches the original implementation of the fused
ffn_up_exps+ffn_gate_expsop becomes faster than themmq_idimplementation added in #728. In #728 a fixed threshold ofu-batch = 2048was used to transition to the original implementation. I have now investigated the speed of original vsmmq_idfor 3 models with different number of total and active experts, and it looks like the best heuristics is to usemmq_idforu-batch <= 32 * total_experts. This PR makes this simple change.