Repository navigation
Conversation
|
[For maintainers] Suggested jobs to run (before merge) run-slow: ggml |
|
fyi @SunMarc (you greenlit this on #40042) and @Cyrilvallez for the GGUF loading path; ready for review when you get a moment |
|
CI Dashboard: View test results in Grafana |
|
View the CircleCI Test Summary for this PR: https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=46718&sha=e88663 |
|
tests/models/kosmos2_5/test_modeling_kosmos2_5.py::Kosmos2_5ModelTest::test_generate_with_cache_matches_no_cache (AssertionError: Lists differ on generated token IDs). |
|
#45977 gguf support in transformers will be changed in those pr. So i think we have to wait until those changes are done. |
|
Thanks @minatoyukinaa. @SunMarc @ArthurZucker this just adds the glm4moe arch mapping to the existing GGUF loading path. Should i hold until #45977 lands and rebase on top, or is it ok to merge this small additive mapping independently? Whatever is less churn for you; i'll mark this as draft in the meantime |
|
We've refactored the GGUF integration to have better speed-up + design, please update the PR according to the new ones. Closing this for now ! |
What does this PR do?
Fixes #40042
What
Adds GGUF loading support for glm4_moe (GLM-4.5 / GLM-4.5-Air), closing #40042. Previously raised
ValueError: GGUF model with architecture glm4moe is not supported yet.Changes
glm4moeconfig mapping (attention + MoE + grouped routing;attention.key_length -> head_dimto preserve the partial-rotary default and a GPT2-style tokenizer convertermlp.experts.gate_up_proj; mapsexp_probs_b.bias->mlp.gate.e_score_correction_bias,glm4_moe<->glm4moearch aliasing, and a fixup dropping MTP layers fromnum_hidden_layersand inferring attention_bias/use_qk_norm from tensor presencetest_glm4moe_f16logit-parity testRouted-expert handling mirrors the existing MiniMax-M2 processor (same merged
gate_up_projlayout).Coordination
Issue #40042; maintainer greenlight from @SunMarc. No open PR addresses it (the earlier "base model missing" comment is outdated;
glm4_moemodeling now exists)Testing
Verified against a tiny GGUF, converted from
trl-internal-testing/tiny-Glm4MoeForCausalLM, hosted atmironableee/tiny-glm4moe-gguf:Test is
@slow+@require_torch_accelerator(inherited), so it runs on GPU CIAI assistance
Claude code was used in diagnosis. I reviewed every changed line, understood the implementation and ran the tests below myself
Fixture hosting
The fixture currently lives under my personal HF namespace
mironableee/tiny-glm4moe-gguf. Please let me know if you 'd like it moved tohf-internal-testingor similar.Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.
PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.
This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read
CONTRIBUTING.md.Before submitting
Pull Request checks?
to it if that's the case Support loading glm4moe GGUF #40042 (comment)
Who can review?
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.