bridge.diffusion.conversion.llada15.llada15_bridge#
Megatron Bridge for LLaDA1.5 (GSAI-ML/LLaDA-*) masked-diffusion LLMs.
Converts between the trust_remote_code LLaDAModelLM HF class and a
Megatron-Core GPTModel. The model is a dense LLaMA-style block with
OLMo-style parameter naming and full RoPE.
Key mapping decisions, anchored to the reference implementation
(modeling_llada.py):
QKV is separate (
q_proj,k_proj,v_proj— seeLLaDALlamaBlock.__init__), not fused. Use :class:QKVMapping, not- class:
ConcatenatedQKVMapping.
The SwiGLU MLP computes
act(ff_proj(x)) * up_proj(x)(seeLLaDALlamaBlock.forward), soff_projis the gate andup_projis the up input for Megatron’s fusedlinear_fc1.The LM head is
model.transformer.ff_out(LLaDA1.5 hasweight_tying: false).Attention output projection is named
attn_out, noto_proj.Layer norms are
attn_norm(pre-attention) andff_norm(pre-MLP), fused into Megatron’s TElinear_qkv/linear_fc1layer_norm_weight.
Module Contents#
Classes#
HF |
API#
- class bridge.diffusion.conversion.llada15.llada15_bridge.LLaDA15Bridge#
Bases:
megatron.bridge.models.conversion.model_bridge.MegatronModelBridgeHF
LLaDAModelLM↔ MegatronGPTModelbridge.- provider_bridge(
- hf_pretrained: megatron.bridge.models.hf_pretrained.causal_lm.PreTrainedCausalLM,
- mapping_registry() megatron.bridge.models.conversion.mapping_registry.MegatronMappingRegistry#