bridge.models.ernie.modeling_ernie55#
ERNIE 5.5 modules built on Megatron-Core.
D layer: latent MQA + DSA with window and sink (
latent_mqa_attention,latent_mqa_core).H layer: Megatron-Core’s DSv4 hybrid attention at compress ratio 128 with the ERNIE output gate, VHA head mix, plain RoPE or YaRN and sink seeding (
hca_attention).MoE layer: Megatron-Core’s
MoELayerwith the split-feature router and fp32 latent projections (moe).Context parallelism: D layers run zigzag inside the contiguous DSv4 stack (
context_parallel).Hyper-connections with fp32 decoder streams: the eager fp32 mapping and mixing (
hyper_connection), downcasting pre-norms (norm) and the fp32 decoder stack (hybrid_stack).normalso holds the reference implementation’s RMSNorm arithmetic, behindernie_reference_rmsnorm.Multimax output head with its own gradient-norm group (
output_layer).The reference implementation’s Triton kernels for SiTU-GLU, multimax and the context-parallel local RoPE (
fused_ops), dispatched behindernie_fused_ops(fused_dispatch).SD-MTP, the MTP body sharing the last decoder layers’ parameters (
mtp), and the per-row MTP loss (mtp_loss).The model, which applies all of the above after Megatron-Core builds it (
model).
FlashMLA and the cuDNN DSA kernels are imported lazily by Megatron-Core, and Triton by
fused_ops on its first kernel launch, so importing this package needs none of them.
Submodules#
bridge.models.ernie.modeling_ernie55.context_parallelbridge.models.ernie.modeling_ernie55.fused_dispatchbridge.models.ernie.modeling_ernie55.hybrid_stackbridge.models.ernie.modeling_ernie55.mtp_lossbridge.models.ernie.modeling_ernie55.hca_attentionbridge.models.ernie.modeling_ernie55.moebridge.models.ernie.modeling_ernie55.output_layerbridge.models.ernie.modeling_ernie55.modelbridge.models.ernie.modeling_ernie55.hyper_connectionbridge.models.ernie.modeling_ernie55.mtpbridge.models.ernie.modeling_ernie55.stack_specbridge.models.ernie.modeling_ernie55.latent_mqa_corebridge.models.ernie.modeling_ernie55.latent_mqa_attentionbridge.models.ernie.modeling_ernie55.muonbridge.models.ernie.modeling_ernie55.normbridge.models.ernie.modeling_ernie55.opsbridge.models.ernie.modeling_ernie55.fused_ops
Package Contents#
Data#
API#
- bridge.models.ernie.modeling_ernie55.__all__#
[‘ERNIE55_ATTN_SINK_INIT_STD’, ‘ERNIE55_HCA_COMPRESS_RATIO’, ‘ERNIE55_HCA_ROPE_TYPES’, ‘INDEXER_SCOR…