Allow for registered experts from kernels hub#45577
Merged
IlyasMoutawwakil merged 12 commits intohuggingface:mainfrom Apr 23, 2026
Merged
Allow for registered experts from kernels hub#45577IlyasMoutawwakil merged 12 commits intohuggingface:mainfrom
IlyasMoutawwakil merged 12 commits intohuggingface:mainfrom
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
SunMarc
approved these changes
Apr 22, 2026
| def get_correct_experts_implementation(self, requested_experts: str | None) -> str: | ||
| applicable_experts = "grouped_mm" if requested_experts is None else requested_experts | ||
| if applicable_experts not in ["eager", "grouped_mm", "batched_mm", "deepgemm"]: | ||
| base_experts_fns = ["eager", "deepgemm"] + list(ALL_EXPERTS_FUNCTIONS.keys()) |
Member
There was a problem hiding this comment.
we can remove deepgemm in the base_experts_fns. it will be present in ALL_EXPERTS_FUNCTIONS if fp8 is used.
Suggested change
| base_experts_fns = ["eager", "deepgemm"] + list(ALL_EXPERTS_FUNCTIONS.keys()) | |
| base_experts_fns = ["eager"] + list(ALL_EXPERTS_FUNCTIONS.keys()) |
Member
There was a problem hiding this comment.
actually fp8 has its own different registry, maybe we can add both registeries
Member
|
@bot /style |
Member
|
@bot /style |
Member
|
thanks for catching this, i left a small suggestion to allow fp8 implementations as well. |
Member
|
@bot /style |
Member
|
@bot /style |
Contributor
|
Style fix bot fixed some files and pushed the changes. |
Member
|
😭 |
tarekziade
pushed a commit
that referenced
this pull request
Apr 23, 2026
* Allow for registered experts from kernels hub * remove deepgemm as that is also dynamic * Apply repo consistency fixes * Update src/transformers/modeling_utils.py * Update src/transformers/modeling_utils.py * Apply repo consistency fixes * Apply suggestion from @IlyasMoutawwakil * Apply repo consistency fixes * get rid of triton dependency * keep eager first --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com> Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com> Co-authored-by: IlyasMoutawwakil <moutawwakil.ilyas.tsi@gmail.com>
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.
What does this PR do?
When loading custom expert kernels from HF Hub, there is still a check that prevents them from being used. This grabs the list of registered expert fns instead of hardcoding.
Fixes # (issue) N/A
Code Agent Policy
AI was used just to write the unit tests.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@ArthurZucker @SunMarc
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.