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.

Tests: fix the two spoof-safety lint failures on main (#15454)

Daniel Hana4e651e8160b
diff --git a/tests/test_fsdp2_bnb_optim_sync.py b/tests/test_fsdp2_bnb_optim_sync.py
index e3e3ecdf7ff..559b70e2cba 100644
--- a/tests/test_fsdp2_bnb_optim_sync.py
+++ b/tests/test_fsdp2_bnb_optim_sync.py
@@ -10,6 +10,7 @@ import warnings
import pytest
import torch
+from real_accelerator import has_real_cuda
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from test_fsdp2_native_units import _load_native # noqa: E402
@@ -92,7 +93,7 @@ def test_paged_local_shard_step_keeps_bitsandbytes_fences(sync_calls):
assert torch.equal(a, b)
[email protected](not torch.cuda.is_available(), reason = "needs a CUDA side stream")
[email protected](not has_real_cuda(), reason = "needs a CUDA side stream")
def test_local_shard_step_on_a_side_stream_keeps_every_fence(monkeypatch):
"""Off the default stream the per-parameter fences stay; on it none are taken."""
bnb = pytest.importorskip("bitsandbytes")
diff --git a/tests/test_tp_replica_gloo.py b/tests/test_tp_replica_gloo.py
index c50554a38fc..3680a94730b 100644
--- a/tests/test_tp_replica_gloo.py
+++ b/tests/test_tp_replica_gloo.py
@@ -254,7 +254,7 @@ def _case_save(rank, world, tmp):
from peft import PeftModel
base = build(LLAMA, lora = False)
- reloaded = PeftModel.from_pretrained(base, tp_dir)
+ reloaded = PeftModel.from_pretrained(base, tp_dir, torch_device = "cpu")
with torch.no_grad():
out["reload_err"] = float(
(reloaded(input_ids = ids).logits - ref(input_ids = ids).logits).abs().max()