Skip to content

Add GS1 decision model support - #50921

Open
jacklanda wants to merge 18 commits into
huggingface:mainfrom
jacklanda:add-gs1-decision-model
Open

jacklanda wants to merge 18 commits into
huggingface:mainfrom
jacklanda:add-gs1-decision-model

Conversation

@jacklanda

@jacklanda jacklanda commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Related model request:

This PR adds native support for the GS1 model family, with four model sizes. It reuses Transformers Qwen3.5 components and the existing decision-model APIs, adding GS1-specific architecture/configuration and training loss support.

🤖 mlinter review state

@jacklanda
jacklanda force-pushed the add-gs1-decision-model branch from 8ed5901 to 944bf27 Compare November 18, 2026 19:30
@jacklanda
jacklanda marked this pull request as ready for review November 18, 2026 19:48
@jacklanda

jacklanda commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

@stevhliu @vasqu @ArthurZucker Could one of you approve the required PR CI and Build PR Documentation workflow runs? I checked the maintainership history: @vasqu reviewed the original Qwen3.5 Transformers integration, and @ArthurZucker authored the decision-model API this GS1 integration builds on. Both runs currently end with action_required and have no jobs, leaving the required pr-ci / PR CI status and doc_build_status_check checks waiting for a report. The security gate and docs check have passed. Thank you!

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

Pages changed in this PR:

- Add the GS1 model documentation page to the explicit model-name allowlist used by check_repo.py.
- Keep the docs consistency check aligned with the model docs introduced by PR 50921.
- Add GS1 configuration and decision model modules built on the Qwen3.5 backbone.
- Register GS1 in model exports and auto decision mappings.
- Add the GS1 distribution NLL and expected Brier decision loss.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model linter — first pass

transformers-mlinter found 18 item(s) in the model files this PR touches. These are structural conventions a maintainer would otherwise flag by hand.

This is automated and advisory — it does not block merging.

rule count what it checks
TRF036 3 nn.Sequential hides the forward flow; declare the submodules explicitly.
TRF062 3 _init_weights must initialize tensors with the transformers initialization module, not torch.nn.init.
TRF060 2 Files in a model directory must import from transformers with relative imports, not from transformers....
TRF055 2 PreTrainedModel classes declare their config with a config: SomeConfig annotation, matched by __init__(config: SomeConfig); never config_class.
TRF068 2 _no_split_modules must only list classes that exist.
TRF028 1 Model files must carry a complete license header.
TRF038 1 Every modeling-family source file needs a matching test file under tests/models/.
TRF057 1 Public model, config, output and processor classes and their public methods must carry @auto_docstring.
TRF056 1 forward() must not materialize tensors with .item() or .tolist().
TRF002 1 base_model_prefix on a PreTrainedModel, when set, should be a non-empty canonical string.
TRF022 1 _no_split_modules entries must name module classes that exist in the model.
8 item(s) outside this diff
  • src/transformers/models/gs1/modular_gs1.py:322 TRF002 — TRF002: GS1PreTrainedModel.base_model_prefix should be a non-empty canonical token.
  • src/transformers/models/gs1/modular_gs1.py:323 TRF022 — TRF022: GS1PreTrainedModel._no_split_modules lists 'Qwen3_5VisionBlock', which is not defined or imported in modular_gs1.py and does not exist in the model directory. Either remove the entry, or correct it to the name of the layer class of this model. Do not name classes owned by a submodel (e.g. a language model or vision tower built through AutoModel): post_init already collects _no_split_modules from child submodels automatically.
  • src/transformers/models/gs1/modular_gs1.py:323 TRF068 — TRF068: GS1PreTrainedModel._no_split_modules lists GS1DecoderLayer, which is not a class in modeling_gs1.py generated from modular_gs1.py, so accelerate will never match it. Did you mean one of these: GS1DecisionHead?
  • src/transformers/models/gs1/modular_gs1.py:323 TRF068 — TRF068: GS1PreTrainedModel._no_split_modules lists Qwen3_5VisionBlock, which is not a class in modeling_gs1.py generated from modular_gs1.py, so accelerate will never match it.
  • src/transformers/models/gs1/modular_gs1.py:328 TRF062 — TRF062: _init_weights calls torch.nn.init.ones_. Use init.ones_ from the transformers initialization module instead, imported as from ... import initialization as init (not from torch.nn import init).
  • src/transformers/models/gs1/modular_gs1.py:330 TRF062 — TRF062: _init_weights calls torch.nn.init.zeros_. Use init.zeros_ from the transformers initialization module instead, imported as from ... import initialization as init (not from torch.nn import init).
  • src/transformers/models/gs1/modular_gs1.py:332 TRF062 — TRF062: _init_weights calls torch.nn.init.zeros_. Use init.zeros_ from the transformers initialization module instead, imported as from ... import initialization as init (not from torch.nn import init).
  • src/transformers/models/gs1/modular_gs1.py:336 TRF055 — TRF055: generated modeling_gs1.py:256: GS1ForDecision.__init__ must annotate its config argument: config: GS1Config, matching the config attribute it inherits or overrides.

@jacklanda
jacklanda force-pushed the add-gs1-decision-model branch 2 times, most recently from ab4ce73 to adc2a64 Compare November 19, 2026 10:26
- Complete the GS1 modular model definitions and regenerate the matching modeling files.
- Correct GS1 config defaults, auto-mapping order, model metadata, imports, and initialization conventions.
- Add GS1 decision-loss regression coverage and document the public config and model classes.
@jacklanda
jacklanda force-pushed the add-gs1-decision-model branch from adc2a64 to 1103ce2 Compare November 19, 2026 10:49
@jacklanda

Copy link
Copy Markdown
Contributor Author

@vasqu @ArthurZucker @stevhliu Could you please provide a maintainer review for this GS1 decision-model integration and approve the required CI/docs checks if appropriate?

The repository consistency and code-quality checks are now green, and the test matrix has passed. The latest updates address the model-linter feedback, GS1 exports/configuration checks, documentation, and test coverage. Thank you!

@jacklanda jacklanda changed the title [WIP] Add GS1 decision model support Add GS1 decision model support Nov 19, 2026
@jacklanda

Copy link
Copy Markdown
Contributor Author

Fixed the repository-consistency failure in commit 50f18d91: refreshed docs/source/en/model_doc/gs1.md contribution date to the current PR commit date. The failing tests_torch shard 7 was isolated to an unrelated pre-existing video_llama_3 padding/image-feature mismatch (tokens: 2, features: 3), with no GS1 tests involved; the shard should be rerun after this documentation-only fix.

@jacklanda

Copy link
Copy Markdown
Contributor Author

@vasqu @ArthurZucker @stevhliu Could you please review the latest GS1 update at 50f18d91 and help approve/rerun the pending PR CI checks? Repository consistency was fixed by refreshing the GS1 documentation date; the remaining shard-7 failure is an unrelated video_llama_3 image-token mismatch. Thank you!

@jacklanda

Copy link
Copy Markdown
Contributor Author

@vasqu @ArthurZucker @stevhliu All required CI checks are now green, including repository consistency and every tests_torch shard. The PR is only waiting for maintainer review/approval now. Could you please take a look when available? Thank you!

@vasqu

vasqu commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Heya, sorry there are quite a lot of models in the pipeline right now so not sure when I get to this. I just wanted to write here that its not unseen but it's just not much bandwidth on our side

@jacklanda

Copy link
Copy Markdown
Contributor Author

Thanks for the update, @vasqu. @ArthurZucker, could you take a look at the GS1 decision-model integration when you have a chance? @stevhliu, could you approve the documentation build? PR CI is already running. Thank you!

Generate only the GS1 model code and reuse Qwen3.5 backbones through AutoModel. Share decision span pooling and use the standard activation checkpointing hook, with a hybrid-backbone regression test.

@stevhliu stevhliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the docs, would also be nice to add an usage example!

Comment thread docs/source/en/model_doc/gs1.md Resolved
Comment thread docs/source/en/model_doc/gs1.md Resolved
Comment thread docs/source/en/model_doc/gs1.md Resolved
Comment thread docs/source/en/model_doc/gs1.md Resolved
Comment thread docs/source/en/model_doc/gs1.md Resolved
Normalize the vision subconfig and convert legacy decision-head keys on load and save. Restore the default decision template and let the decision pipeline consume GS1 logits. Cover the published checkpoint and incorporate the documentation review.
@jacklanda
jacklanda requested a review from stevhliu November 24, 2026 17:04
@jacklanda

Copy link
Copy Markdown
Contributor Author

@ArthurZucker Could you take a look at the GS1 decision-model integration when you have a chance? @stevhliu Thanks for the docs feedback. The usage example now runs against the published GS1-0.8B checkpoint. Could you approve the latest documentation build? Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto, gs1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants