unsloth/tests/python
Daniel Han 741bebb36a Reuse the torch2.10 prebuilt accelerator wheels on torch 2.12
Studio already falls back to the torch2.10 flash-attn / causal-conv1d /
mamba-ssm wheels when it finds torch 2.11, because upstream publishes no
2.11-tagged builds. torch 2.12 is in exactly the same position, and the same
wheels work there, so a 2.12 install currently drops to a source build for no
reason.

Measured on a B200, python 3.12, fresh uv venv on torch 2.12.1+cu130, wheels
installed with --no-deps and torch verified unmoved afterwards, importing the
compiled .so directly rather than only the Python package:

  causal-conv1d 1.6.1   9412 passed / 3888 skipped / 0 failed
  mamba-ssm 2.3.1       tests/ops, 20 passed
  flash-attn 2.8.1      splitkv + qkvpacked subset, 848 passed

Against a torch 2.10 control the pass/fail/skip counts match and the failing
test-ID sets are byte identical.

The reuse window is bounded rather than open ended, so the comment now records
that. flash-attn v2.8.3.post1's torch2.9 wheel fails to import on torch 2.10
and on torch 2.12 alike, with an undefined symbol out of flash_attn_2_cuda:
torch broke extension ABI between 2.9 and 2.10 and has held it from 2.10
through 2.12. A wheel cannot skip a torch minor backwards, so torch 2.13 is
deliberately left out of the table until it is measured.

The torch2.10 flash-attn pin stays at 2.8.1. v2.8.3 looks like a free upgrade
but publishes only 2 of the 8 torch2.10 assets that v2.8.1 does, keeping just
cu13/cp312 for x86_64 and aarch64 and dropping every cu12 and every cp313
torch2.10 wheel, while v2.8.3.post1 dropped the torch2.10 assets entirely.
Bumping the pin would silently 404 most users back to a source build, so the
constant now carries that warning.

Tests cover the 2.12 mapping through both direct_wheel_url and the flash-attn
URL builder, that reuse only ever targets torch2.10, and that the selected
flash-attn version is never a .post release.
2026-07-27 10:42:37 +00:00
..
__init__.py Consolidate dual venvs and separate install from update (#4530) 2026-03-25 05:24:21 -07:00
conftest.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_change_system_message.py Reduce comments across recent fixes (#6776) 2026-06-30 23:13:36 -07:00
test_construct_chat_template_validation.py fix(chat_templates): bind loop_messages when default_system_message is None (#7199) 2026-07-19 06:33:48 -07:00
test_cpo_processor_text_tokenizer.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_cross_platform_parity.py AMD: CI coverage for recent fixes, plus three wrong gfx ids (#7431) 2026-07-25 18:58:02 -05:00
test_dpo_vision_processor_passthrough.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_e2e_no_torch_sandbox.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_fast_language_model_text_only.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_fast_model_config_passthrough.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_fast_sentence_transformer_embedding_parity.py Fix FastSentenceTransformer Qwen embedding preprocessing (#6939) 2026-07-09 01:46:22 -07:00
test_fast_sentence_transformer_redirect_lifecycle.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_flash_attn_install_python_stack.py Reuse the torch2.10 prebuilt accelerator wheels on torch 2.12 2026-07-27 10:42:37 +00:00
test_get_lora_parameters_bias_fp8_block_size.py Propagate fp8 block_size before the early return in get_lora_parameters_bias (#7189) 2026-07-17 16:30:45 -07:00
test_get_lora_parameters_fp8_block_size.py Propagate fp8 block_size before the early return in get_lora_parameters_bias (#7189) 2026-07-17 16:30:45 -07:00
test_gpu_init_ldconfig_guard.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_grpo_ddp_model_config.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_install_python_stack.py install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_install_uv_override_space.py Installer: make UV_OVERRIDE space-safe on Apple Silicon (#6503) (#6639) 2026-06-24 17:34:18 -07:00
test_mlx_public_trainer_api.py feat(mlx): route trainer callbacks (#6929) 2026-07-08 03:25:50 -07:00
test_no_torch_filtering.py Studio: remove OpenEnv and other unused packages (#6585) 2026-06-23 07:20:47 -07:00
test_orpo_processor_text_tokenizer.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_pad_token_fix.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_patch_trl_rl_trainers_defensive.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_remove_special_tokens_no_bos.py fix: guard remove_special_tokens against tokenizers without a BOS token (#7048) 2026-07-10 14:55:11 -03:00
test_studio_import_no_torch.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_to_sharegpt_optional_none.py Fix to_sharegpt optional block rendering "None" for missing extra columns (#6827) 2026-07-08 17:57:41 -03:00
test_tokenizers_and_torch_constraint.py Installer: allow torch 2.11.x on the CUDA install path (fresh install + studio) (#6959) 2026-07-19 06:19:29 -07:00
test_torchcodec_torch_compat.py fix: pin torchcodec for torch 2.10 and warn on ABI mismatch (#7299) 2026-07-23 19:12:52 -07:00
test_unsloth_run_tool_policy_resolver.py Keep server-side tools enabled under --secure (#6403) 2026-06-18 05:52:40 -07:00
test_v100_fullft_precision.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_vision_lora_targeting.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00