Skip to content

Tests: name the encoding in the gloo export guard, and treat a bare device index as CUDA in the YaRN load check - #15351

Merged
danielhanchen merged 1 commit into
mainfrom
ci-rest-encoding-yarn-int-device
Oct 26, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-rest-encoding-yarn-int-device

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Two tests in the Repo tests (CPU, rest) shard fail on main itself, so every PR based on it inherits them (seen on #15326 and #15339). Both are test bugs; the product code they guard is fine.

1. tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding

Pass encoding = "utf-8": ['tests/test_parallel_general_gloo.py:732: open()']

#15230 added test_every_whole_model_export_is_guarded, which reads unsloth/save.py with a bare open(...).read(). That uses the locale encoding, which on Windows is the ANSI codepage. The read now names encoding = "utf-8" and closes the file.

2. tests/test_yarn_rope_parameters_load.py::test_yarn_reaches_the_model[lang-*]

RuntimeError: Cannot access accelerator device when none is available.

#15214 added this subprocess check. It runs FastLanguageModel on a spoofed CUDA box and sends CUDA tensor allocations to the CPU through an _is_cuda(device) helper. The rotary embedding allocates with device = get_current_device(), which is a bare index (0). The helper called torch.device(0), and on CPU-only torch 2.10 that resolves the index through the accelerator and raises before the YaRN assertion is reached. The model cases passed only because that path does not allocate with a bare index. A bare int is now treated as a CUDA ordinal without asking torch, and strings and torch.device values go through torch.device(...) as before.

Verification

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T10:22:31.956530Z 471e09b 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: 471e09be88

ℹ️ 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 ba161f5 into main Oct 26, 2026
0 of 15 checks passed
@danielhanchen
danielhanchen deleted the ci-rest-encoding-yarn-int-device branch October 26, 2026 10:24
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