convert-hf-to-te
Convert a Hugging Face model to Transformer Engine
Use the project's requested entry point or add a model-family module such as te_llama.py.
Replace compatible building blocks of the Hugging Face (HF) model with Transformer Engine (TE)
modules and load the original checkpoint into them. The building block is the whole transformer
layer, as for Llama and Gemma, or else the attention
(MHA, linear attention) and MLP or MoE blocks inside it. A partial conversion can also replace
a single operation inside an HF block. For a review or plan, stop after the requested feasibility,
boundary or weight-mapping decision in Steps 1–3. For a local implementation, Step 4 ends at the
first BF16 forward comparison. Use Step 5 for requested training checks, integration or performance
measurements at the scope the user specified.
In this skill te means transformer_engine.pytorch.
In a plan or implementation handoff, lead with the chosen replacement boundary and weight map.
Not for JAX or inference serving (vLLM, TensorRT-LLM). For Megatron-LM or another PyTorch framework, the TE implementation can serve as a reference for which TE modules to use and how the weights map.