Skip to content

Remove NeMoAutoModelForTokenClassification backport shim once the Automodel pin exports it #2948

Open

Description

@fujial-code

Background

nemo_rl/models/automodel/setup.py contains a local backport shim that
defines NeMoAutoModelForTokenClassification when the pinned Automodel
submodule does not export it. The currently pinned Automodel commit
(24b47e8) predates upstream commit e1a2f915, which added
NeMoAutoModelForTokenClassification as a one-line subclass (mirroring
NeMoAutoModelForSequenceClassification). The value-model path with
reward_model_type='regression' needs this class, so we replicate it
locally instead of bumping the submodule.

Action

  • Once the Automodel pin is bumped past e1a2f915 (so it exports
    NeMoAutoModelForTokenClassification), delete the try/except/else
    backport shim in nemo_rl/models/automodel/setup.py.

Tripwire

The else: raise RuntimeError(...) branch in that try/except fails loudly
the moment Automodel starts exporting the symbol, signaling that this shim
can be removed. (Optionally complemented by a unit test under
tests/unit/models/automodel/ asserting the symbol is still missing.)

Activity

  1. added
    bug
    on Jun 26, 2026
  2. four1er commented on Nov 23, 2026

    @four1er

    Working on this: checking whether the current Automodel pin already exports NeMoAutoModelForTokenClassification (i.e. is past upstream e1a2f915), and will open a PR to remove the backport shim in nemo_rl/models/automodel/setup.py if so.

  3. four1er commented on Nov 23, 2026

    @four1er

    Update: checked current main — this is already done, so no PR from me.

    • The Automodel pin is now b916107a, which is 645 commits ahead of upstream e1a2f915 (merge-base is e1a2f915 itself), and nemo_automodel/__init__.py at that pin exports NeMoAutoModelForTokenClassification.
    • nemo_rl/models/automodel/setup.py on main (HEAD da067f1) imports the symbol directly from nemo_automodel; the try/except/else backport shim and the RuntimeError tripwire are gone, and no backport string remains in nemo_rl/ or tests/.
    • The removal landed in build(automodel): bump Automodel to r0.6.0 #3498 (c158373bea, 2026-08-29, "build(automodel): bump Automodel to r0.6.0"), which bumped the pin 24b47e8 → 1814c6c and deleted the shim in setup.py (37+/97-). That PR did not reference this issue, which is likely why it stayed open.

    Suggest closing this as completed by #3498.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions