Skip to content

Segfault loading LLaDA-8B-Instruct under transformers >= 5 (new core_model_loading path) — works with <5 pin #133

Description

Symptom: AutoModel.from_pretrained("GSAI-ML/LLaDA-8B-Instruct", trust_remote_code=True, ...) hard-segfaults (no Python exception) during weight loading under transformers 5.x. Checkpoint integrity verified first (all six safetensors shards full-size; re-download did not change the behavior).

Environment: transformers 5.12.1, torch 2.11.0+cu128, Python 3.10, Windows 11, RTX 5060 Ti 16 GB. Crash occurs with and without 4-bit quantization (bitsandbytes 0.49.2).

Faulthandler stack at the crash (transformers' new weight-loading path):

Current thread (most recent call first):
  ...\torch\storage.py", line 471 in __getitem__
  ...\transformers\core_model_loading.py", line 989 in _materialize_copy
  ...\transformers\core_model_loading.py", line 1005 in _job
  ...\transformers\core_model_loading.py", line 797 in materialize_tensors
  ...\transformers\core_model_loading.py", line 830 in convert
  ...\transformers\core_model_loading.py", line 1466 in convert_and_load_state_dict_in_model
  ...\transformers\modeling_utils.py", line 4457 in _load_pretrained_model
  ...\transformers\modeling_utils.py", line 4327 in from_pretrained

Notes: standard architectures (e.g. the gemma-2 family) load fine in the same environment under transformers 5.12, so this looks specific to the interaction between LLaDA's trust_remote_code modeling files and the transformers ≥5 loader rewrite, rather than a general environment problem. Reproduces 3/3 attempts.

Workaround that fully resolves it: pin transformers>=4.46,<5 — the same environment then loads and generates normally (verified end-to-end, 4-bit on a 16 GB consumer GPU).

Might be worth a note in the README/model card until the remote code is updated for the v5 loader. Happy to provide more details or test a fix. Also reported on the Hugging Face model page's community tab. (Context: we use LLaDA in a public research episode on text-diffusion emergence — write-up with the documented pin here.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions