Add Hf Model

Add support for a HuggingFace model in XTuner so it can be trained with the full set of parallelism strategies and optimization switches. The user can provide a HuggingFace Hub repo id, a local model directory, or a model family already supported by `transformers`. This skill walks through the full path: locating the reference implementation, classifying the model, splitting new code across the model / module / ops layers, implementing the XTuner model class and config, registering the entry point, validating bitwise numerical parity with HuggingFace, writing regression tests, and enabling the training optimizations (EP/SP, micro-batch, torch.compile, fp8, activation offload).

InternLM ab06691 40.1 KB Updated

File contents

internlm/xtuner/tree/main/.claude/skills/add_hf_model commit ab06691d68

Frequently asked questions

npx skillmds@latest add internlm/add-hf-model