Skip to content

fix: correct DeepScaleR-1.5B 16bit mapping to its own repo - #7088

Merged
oobabooga merged 1 commit into
unslothai:mainfrom
anxkhn:patch-4
Jul 14, 2026
Merged

oobabooga merged 1 commit into
unslothai:mainfrom
anxkhn:patch-4

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

In unsloth/models/mapper.py, the __INT_TO_FLOAT_MAPPER entry keyed by
unsloth/DeepScaleR-1.5B-Preview-unsloth-bnb-4bit has its first tuple element
(the 16bit repo) set to an unrelated model:

"unsloth/DeepScaleR-1.5B-Preview-unsloth-bnb-4bit" : (
    "unsloth/DeepHermes-3-Llama-3-8B-Preview",   # <- wrong: unrelated 8B model
    "agentica-org/DeepScaleR-1.5B-Preview",
    "unsloth/DeepScaleR-1.5B-Preview-bnb-4bit",
),

The key and the other two elements are all DeepScaleR-1.5B, but the first element
is unsloth/DeepHermes-3-Llama-3-8B-Preview, a different NousResearch reasoning
model (Llama-3, 8B) that shares nothing with DeepScaleR-1.5B (Qwen2, ~1.8B). It
looks like a copy-paste from a neighboring entry; DeepHermes appears nowhere
else in the file.

For every other entry, that first element is the unsloth/<name> 16bit repo that
corresponds to the key. It is what the mapper build loop feeds into
INT_TO_FLOAT_MAPPER[key], and (because it starts with unsloth) into the
MAP_TO_UNSLOTH_16bit entries for both agentica-org/DeepScaleR-1.5B-Preview and
unsloth/DeepScaleR-1.5B-Preview-bnb-4bit. So get_model_name() silently resolves
DeepScaleR-1.5B (loaded non-4bit, or via the unsloth 16bit remap) to the DeepHermes
8B model, a different architecture roughly 5x the size.

Fix

Point that first element at unsloth/DeepScaleR-1.5B-Preview (which exists on the
Hub and is the 16bit repo of the key), matching the convention of every other
entry. One-line change; no signatures or control flow touched.

Test

Adds regression coverage to the existing tests/test_get_model_name.py:

  • Two end-to-end get_model_name cases for agentica-org/DeepScaleR-1.5B-Preview
    in test_resolution_matrix (the 16bit resolution and the 4bit resolution).
  • A direct MAP_TO_UNSLOTH_16bit["agentica-org/deepscaler-1.5b-preview"] assertion
    in test_static_mapper_contract.

The 16bit end-to-end case and the static-contract assertion both fail before the
fix (they resolve to DeepHermes) and pass after.

Notes

  • Single focused change.
  • Lint: ruff check on both files passes.
  • No linked issue exists; found while reading the model mapper.

The __INT_TO_FLOAT_MAPPER entry keyed by
"unsloth/DeepScaleR-1.5B-Preview-unsloth-bnb-4bit" had its first element
(the 16bit repo) set to "unsloth/DeepHermes-3-Llama-3-8B-Preview", an
unrelated 8B model, while the key and the other two elements are all
DeepScaleR-1.5B. That first element is what the mapper build loop uses for
INT_TO_FLOAT_MAPPER[key] and, since it starts with "unsloth", for the
MAP_TO_UNSLOTH_16bit entries of both "agentica-org/DeepScaleR-1.5B-Preview"
and "unsloth/DeepScaleR-1.5B-Preview-bnb-4bit".

As a result get_model_name() silently resolved DeepScaleR-1.5B (loaded
non-4bit, or via the unsloth 16bit remap) to the DeepHermes 8B model, a
different architecture and 5x the size. Point it at
"unsloth/DeepScaleR-1.5B-Preview" to match every other entry's convention.

Add regression coverage in tests/test_get_model_name.py: end-to-end
resolution cases for agentica-org/DeepScaleR-1.5B-Preview (4bit and 16bit)
and a direct MAP_TO_UNSLOTH_16bit contract assertion.

Signed-off-by: Anas Khan <[email protected]>
@anxkhn
anxkhn requested a review from danielhanchen as a code owner July 12, 2026 13:09

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request fixes a mapping error in unsloth/models/mapper.py where the 4-bit version of DeepScaleR-1.5B-Preview was incorrectly mapped to DeepHermes-3-Llama-3-8B-Preview instead of its own 16-bit repository. It also adds corresponding unit tests in tests/test_get_model_name.py to verify correct resolution and static mapper contract behavior. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@oobabooga

Copy link
Copy Markdown
Member

Verified the miswiring first-hand by importing the mapper from main and from your branch. MAP_TO_UNSLOTH_16bit["agentica-org/deepscaler-1.5b-preview"] returns unsloth/DeepHermes-3-Llama-3-8B-Preview on main and unsloth/DeepScaleR-1.5B-Preview with your fix, so DeepScaleR-1.5B really was resolving to an unrelated 8B model before this.

The Hub agrees: the new target is a public repo, the old DeepHermes value isn't publicly resolvable, and DeepHermes appears nowhere else in the mapper, so the copy-paste explanation holds. Your regression tests fail on main's mapper (the 16bit resolution and the static-contract assertion) and the full suite passes on the branch, 2 tests with 40 subtests.

Thanks @anxkhn. Merging.

@oobabooga
oobabooga merged commit 3b23589 into unslothai:main Jul 14, 2026
47 checks passed
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.

2 participants