Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Repair the three CI checks #16407 left red on main (#16446)

Daniel Hanee6640a7cf57
diff --git a/tests/test_muon_dtensor_gloo.py b/tests/test_optim_muon_dtensor_gloo.py
similarity index 100%
rename from tests/test_muon_dtensor_gloo.py
rename to tests/test_optim_muon_dtensor_gloo.py
diff --git a/tests/test_parallel_env.py b/tests/test_parallel_env.py
index e41e9806b1f..0ab2e547cdc 100644
--- a/tests/test_parallel_env.py
+++ b/tests/test_parallel_env.py
@@ -629,7 +629,7 @@ def test_every_cell_carries_three_kinds_of_evidence_that_exist():
assert cell.match["compile"] == ("eager",), cell.name
continue
path, name = re.match(r"(tests/[\w.]+\.py)::(\w+)", ref).groups()
- with open(os.path.join(os.path.dirname(here), path)) as f:
+ with open(os.path.join(os.path.dirname(here), path), encoding = "utf-8") as f:
assert f"def {name}(" in f.read(), ref
assert caps.markdown_table("cells").count("\n") == len(caps.CELLS) + 1
@@ -805,7 +805,7 @@ def test_a_shard_unaware_muon_is_refused_on_fsdp2_and_tp_shards():
):
caps.refuse_shard_unaware_optimizer(muon, what)
caps.refuse_shard_unaware_optimizer(adamw, what)
- # torch.optim.Muon steps DTensor shards as whole matrices (tests/test_muon_dtensor_gloo.py), as before.
+ # torch.optim.Muon steps DTensor shards as whole matrices (tests/test_optim_muon_dtensor_gloo.py), as before.
caps.refuse_shard_unaware_optimizer(torch_muon, what)
caps.check(_q(dp = 2, optim = "muon")) # DDP holds whole matrices
from unsloth.models import fsdp2_native
diff --git a/tests/utils/test_packing.py b/tests/utils/test_packing.py
index 8908a1a7d75..aeade56214a 100644
--- a/tests/utils/test_packing.py
+++ b/tests/utils/test_packing.py
@@ -2167,7 +2167,12 @@ def test_packing_skip_warning_keeps_custom_collator_reason(monkeypatch, caplog):
assert "UNSLOTH_RETURN_LOGITS" not in messages[0]
-def test_context_parallel_disables_eval_packing(monkeypatch):
+# Ring cannot keep packed rows apart, so it turns packing off. Ulysses keeps them, and 'auto' (the default
+# since #16407) resolves to Ulysses unless the heads cannot be split over cp.
+ "backend, packs", [("ring", False), ("ulysses", True), ("auto", True), (None, True)]
+)
+def test_context_parallel_disables_eval_packing(monkeypatch, backend, packs):
monkeypatch.delenv("UNSLOTH_RETURN_LOGITS", raising = False)
fake_trainer = _patch_fake_sft_trainer()
config = SimpleNamespace(
@@ -2176,13 +2181,14 @@ def test_context_parallel_disables_eval_packing(monkeypatch):
padding_free = None,
remove_unused_columns = True,
context_parallel_size = 2,
+ context_parallel_backend = backend,
)
fake_trainer(
model = _warn_text_model(),
args = config,
train_dataset = Dataset.from_dict({"text": ["sample"]}),
)
- assert config.packing is False and config.eval_packing is False
+ assert config.packing is packs and config.eval_packing is packs
# Fused-CE paths shift internally, so they mask boundaries on unshifted labels.