Skip to content

Inkling 2 parity test: reload the adapter on CPU explicitly - #19053

Merged
danielhanchen merged 1 commit into
mainfrom
fix/inkling2-parity-reload-device
Nov 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/inkling2-parity-reload-device

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, studio) fails on main since #18959:

tests/python/test_accelerator_skip_guards.py::test_no_test_lets_a_loader_infer_the_device_from_a_spoofed_probe
E   AssertionError: these calls let the library pick the device, and it picks it off a probe tests/_zoo_aggressive_cuda_spoof.py patches to True process-wide. ...
E       test_inkling2_lora_parity.py:378: PeftModel.from_pretrained() with no torch_device=

Root cause

The new test, not the guard. #18959 added tests/test_inkling2_lora_parity.py, which builds the model on CPU and then reloads the saved adapter with PeftModel.from_pretrained(...) without torch_device=. PEFT then picks the device from torch.cuda.is_available(), which the CPU runners' CUDA spoof patches to True, so the reload can dispatch to a CUDA backend that is not there. That is exactly what the guard is for.

Fix

Pass torch_device = "cpu" on the reload, matching where the model lives. tests/test_inkling2_lora_parity.py only.

Testing

  • tests/python/test_accelerator_skip_guards.py and tests/test_inkling2_lora_parity.py: 24 passed, 1 skipped (the guard failed on main without this change).

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T11:37:45.265487Z 8893a80 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 8893a80964

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 589bb2f into main Nov 23, 2026
@danielhanchen
danielhanchen deleted the fix/inkling2-parity-reload-device branch November 23, 2026 11:38
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.

1 participant