#6836·trl

CI fails for slow tests on multiple GPUs: Fatal Python error: Segmentation fault

Author: albertvillanovaCreated Aug 20, 2026Updated Sep 30, 2026

CI fails for slow tests on multiple GPUs: https://github.com/huggingface/trl/actions/runs/32366421358/job/96416805091

Fatal Python error: Segmentation fault

pytest dies before printing the summary, so there is no short test summary info and no per-test traceback in the log. What the log does show:

collected 2662 items / 2564 deselected / 98 selected

tests/test_dpo_trainer.py s                                              [  1%]
tests/test_grpo_trainer.py FFFFFFFxss                                    [ 11%]
tests/test_kto_trainer.py s                                              [ 12%]
tests/test_sft_trainer.py s.F.F......FFFFFF......FFFFFF................. [ 59%]
Fatal Python error: Segmentation fault

Faulthandler stack of the crashing thread:

Current thread 0x00007f8766541740 (most recent call first):
  File ".../accelerate/utils/modeling.py", line 817 in get_max_memory
  File ".../transformers/integrations/accelerate.py", line 206 in get_max_memory
  File ".../transformers/integrations/accelerate.py", line 272 in get_balanced_memory
  File ".../transformers/integrations/accelerate.py", line 349 in _get_device_map
  File ".../transformers/modeling_utils.py", line 4328 in from_pretrained
  File "/__w/trl/trl/trl/trainer/utils.py", line 1174 in create_model_from_path
  File "/__w/trl/trl/trl/trainer/sft_trainer.py", line 977 in __init__
  File "/__w/trl/trl/tests/test_sft_trainer.py", line 2544 in test_train_offloading
Segmentation fault (core dumped)
make: *** [Makefile:15: slow_tests] Error 139

The job runs without xdist, so the progress characters map onto the collection order deterministically. The failures reported before the crash are:

python
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_train_with_liger_grpo_kernel[trl-internal-testing/tiny-LlamaForCausalLM-3.2]
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_train_with_liger_grpo_kernel[trl-internal-testing/tiny-MistralForCausalLM-0.2]
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_train_with_liger_grpo_kernel_and_peft[trl-internal-testing/tiny-LlamaForCausalLM-3.2]
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_train_with_liger_grpo_kernel_and_peft[trl-internal-testing/tiny-MistralForCausalLM-0.2]
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_liger_grpo_kernel_importance_sampling
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_train_with_transformers_continuous_batching[trl-internal-testing/tiny-LlamaForCausalLM-3.2]
tests/test_grpo_trainer.py::TestGRPOTrainerSlow::test_train_with_transformers_continuous_batching[trl-internal-testing/tiny-MistralForCausalLM-0.2]
tests/test_sft_trainer.py::TestSFTTrainerSlow::test_sft_trainer_transformers_mp[trl-internal-testing/tiny-LlamaForCausalLM-3.2-False]
tests/test_sft_trainer.py::TestSFTTrainerSlow::test_sft_trainer_transformers_mp[trl-internal-testing/tiny-MistralForCausalLM-0.2-False]
tests/test_sft_trainer.py::TestSFTTrainerSlow::test_sft_trainer_transformers_mp_gc_device_map[trl-internal-testing/tiny-LlamaForCausalLM-3.2-False-*]  (6 params)
tests/test_sft_trainer.py::TestSFTTrainerSlow::test_sft_trainer_transformers_mp_gc_device_map[trl-internal-testing/tiny-MistralForCausalLM-0.2-False-*]  (6 params)

The last selected items, from test_sft_trainer_with_liger[trl-internal-testing/tiny-LlamaForCausalLM-3.2-False] onwards, never reported an outcome because the process died inside test_train_offloading.

Notes:

  • The two test_train_with_transformers_continuous_batching failures are #6834, addressed by #6835. All the others are specific to running on more than one GPU: they pass in the single-GPU job at the same commit (https://github.com/huggingface/trl/actions/runs/32366421358/job/96416805348), where test_sft_trainer_transformers_mp_gc_device_map is additionally skipped by require_torch_multi_accelerator.
  • Every packing=False variant fails while its packing=True counterpart passes, in both test_sft_trainer_transformers_mp and test_sft_trainer_transformers_mp_gc_device_map.
  • This is the first run in which this job actually used two GPUs. It was pinned to the single-GPU runner group while setting CUDA_VISIBLE_DEVICES: "0,1" until #6741 pointed it at the multi-GPU group, so require_torch_multi_accelerator used to skip and everything else ran on one GPU.