[Proposal] MiniCPM adapter (MiniCPMForCausalLM) — I'm working on it
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Proposal
Add a TransformerBridge architecture adapter for MiniCPM (MiniCPMForCausalLM, model_type: minicpm, loaded via trust_remote_code). I'm working on this and will open a PR against dev.
Motivation
MiniCPMForCausalLM is listed in the architecture gap registry (71 models, ~928k downloads, relevancy 69.7) and isn't in the adapter factory yet. No existing issue or PR covers it.
Pitch
Scope: dense MiniCPM checkpoints only.
Validation checkpoints:
openbmb/MiniCPM4-0.5B(primary)openbmb/MiniCPM-1B-sft-bf16(if it fits my hardware; CPU only)
The architecture is Llama-shaped (RMSNorm, RoPE/LongRoPE, GQA, gated SiLU MLP, tied embeddings) with three µP-style scalings, which map onto existing Granite-adapter machinery:
scale_emb: embedding output multiplierscale_depth / sqrt(num_hidden_layers): residual-branch multiplierhidden_size / dim_model_base: hidden state divided beforelm_head(logit scaling)
Under transformers v5 the remote code needs a few loading-time patches, handled in the adapter's prepare_loading / prepare_model the same way the Baichuan and InternLM2 adapters do:
is_torch_fx_availablewas removed fromtransformers.utils.import_utilsand the remote code still imports it._tied_weights_keysis the v4 list form; v5 expects a dict.- The rotary buffers (
inv_freq,cos_cached,sin_cached) are non-persistent and come out of v5 loading uninitialized. The model still runs but produces garbage, so they're recomputed after load. forwardraises ifuse_cache=Truewithout aCacheobject.
With those fixes, MiniCPM4-0.5B loads and generates correctly on transformers 5.8.1.
Out of scope:
- MiniCPM4-8B / MiniCPM4.1-8B: sparse (InfLLM-v2) attention
- MiniCPM3 (
MiniCPM3ForCausalLM): a different class with MLA attention - MiniCPM-S and BitCPM variants: not validated
Alternatives
Waiting for upstream to update the remote code for v5. The patches are small and isolated, so I'd rather not block on that.
Checklist
- I have checked that there is no similar issue in the repo (required)
- 主要言語
- Python
- スター
- 3.9k
- フォーク
- 708
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 87
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TransformerLensOrg/TransformerLens のほかの issue
-
[Bug Report] test_faithfulness_recovery_is_graded_not_binary passes or fails on the sign of float32 rounding対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
TransformerLensOrg/TransformerLens#1993 ·
メンテナーはふだん 1 日以内に返信
-
[Bug Report] `TransformerBridge.boot_*` methods are invisible to static type checkers対応中かも @koriyoshi2041 が 2 日前に担当しました。 オープンbug complexity-simple TransformerBridge
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TransformerLensOrg/TransformerLens#1980 ·
メンテナーはふだん 1 日以内に返信
-
[Bug Report] detect_head fails with a list of sequences and a custom tensor detection pattern対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug complexity-moderate TransformerBridge
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TransformerLensOrg/TransformerLens#1979 ·
メンテナーはふだん 1 日以内に返信
-
[Proposal] Pretrained J++ lenses through JacobianLens: artifact provenance and filtered readoutsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
TransformerLensOrg/TransformerLens#1991 ·
メンテナーはふだん 1 日以内に返信
-
[Proposal] Demo or helper for statistical audits of activation-patching results on TransformerBridgeオープンcomplexity-moderate enhancement TransformerBridge
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
TransformerLensOrg/TransformerLens#1988 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
TransformerLensOrg/TransformerLens の issue をすべて見る
似ている issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
graphql-python/graphql-core#304 ·
メンテナーはふだん 1 日以内に返信
-
docs size:S
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
Gathin23/cleanyourtv#3464 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信