Diff Coverage

Diff: origin/master...HEAD, staged and unstaged changes

Source File Diff Coverage (%) Missing Lines
hyper_parallel/auto_parallel/_layer_census.py 100%  
hyper_parallel/auto_parallel/_npu_contracts.py 100%  
hyper_parallel/auto_parallel/_spec_census.py 100%  
hyper_parallel/components/checkpoint/conversion_ops.py 100%  
hyper_parallel/components/checkpoint/dcp_checkpointer.py 100%  
hyper_parallel/components/checkpoint/huggingface_checkpointer.py 100%  
hyper_parallel/components/checkpoint/region_tensor.py 100%  
hyper_parallel/components/functional/aggregate_hidden.py 0.0% 19
hyper_parallel/components/functional/attention_rescale.py 100%  
hyper_parallel/components/functional/aux_loss.py 100%  
hyper_parallel/components/functional/dsa_dense.py 100%  
hyper_parallel/components/functional/dsa_indexer.py 100%  
hyper_parallel/components/functional/dsa_kl_loss.py 100%  
hyper_parallel/components/functional/dsa_sparse_attention.py 66.7% 215
hyper_parallel/components/functional/dsa_sparse_attention_rescale.py 100%  
hyper_parallel/components/functional/grouped_matmul.py 100%  
hyper_parallel/components/functional/lightning_indexer.py 100%  
hyper_parallel/components/functional/mhc_post.py 100%  
hyper_parallel/components/functional/mhc_pre.py 100%  
hyper_parallel/components/functional/moe_token_permute.py 100%  
hyper_parallel/components/functional/moe_token_unpermute.py 100%  
hyper_parallel/components/functional/npu_fusion_attention.py 100%  
hyper_parallel/components/functional/rms_norm.py 100%  
hyper_parallel/components/functional/rotary_embedding.py 100%  
hyper_parallel/components/functional/sink_attention.py 0.0% 19
hyper_parallel/components/functional/sinkhorn.py 100%  
hyper_parallel/components/functional/sparse_flash_mla.py 100%  
hyper_parallel/components/functional/sparse_lightning_indexer_kl_loss_grad.py 100%  
hyper_parallel/components/functional/swiglu.py 100%  
hyper_parallel/components/modules/dsa_attention.py 0.0% 23,55
hyper_parallel/components/modules/engram.py 100%  
hyper_parallel/components/modules/gated_mla.py 100%  
hyper_parallel/components/modules/gdn_triton.py 100%  
hyper_parallel/components/modules/gqa_attention.py 100%  
hyper_parallel/components/modules/grouped_experts.py 100%  
hyper_parallel/components/modules/linear.py 100%  
hyper_parallel/components/modules/low_precision_grouped_experts.py 100%  
hyper_parallel/components/modules/mhc.py 100%  
hyper_parallel/components/modules/mla_attention.py 100%  
hyper_parallel/components/modules/mxfp8_grouped_swiglu.py 100%  
hyper_parallel/components/modules/rms_norm.py 100%  
hyper_parallel/components/modules/shared_compressed_dsa_attention.py 100%  
hyper_parallel/components/modules/shared_expert.py 0.0% 23-24
hyper_parallel/components/modules/swiglu_mlp.py 100%  
hyper_parallel/components/optim/builders.py 100%  
hyper_parallel/components/optim/mixed_precision_optimizer.py 100%  
hyper_parallel/components/optim/parameter_groups.py 100%  
hyper_parallel/components/quantization/functional/_saved_quantized.py 100%  
hyper_parallel/components/quantization/functional/base_gmm_func.py 100%  
hyper_parallel/components/quantization/functional/base_linear_func.py 100%  
hyper_parallel/components/quantization/functional/fake_w4a8_gmm_func.py 100%  
hyper_parallel/components/quantization/functional/hifloat8_gmm_func.py 100%  
hyper_parallel/components/quantization/functional/hifloat8_linear_func.py 100%  
hyper_parallel/components/quantization/functional/mxfp8_fused_grouped_swiglu.py 100%  
hyper_parallel/components/quantization/functional/mxfp8_gmm_func.py 100%  
hyper_parallel/components/quantization/functional/mxfp8_linear_func.py 100%  
hyper_parallel/components/quantization/functional/w4a8_gmm_func.py 100%  
hyper_parallel/components/quantization/modules/grouped_experts.py 100%  
hyper_parallel/components/quantization/modules/linear.py 100%  
hyper_parallel/components/quantization/modules/replacement.py 100%  
hyper_parallel/components/quantization/ops/npu_fake_w4a8.py 100%  
hyper_parallel/components/quantization/ops/npu_hifloat8.py 100%  
hyper_parallel/components/quantization/ops/npu_mxfp8.py 100%  
hyper_parallel/components/quantization/ops/npu_w4a8.py 100%  
hyper_parallel/components/quantization/quantizers/base.py 100%  
hyper_parallel/components/quantization/quantizers/fake_w4a8.py 100%  
hyper_parallel/components/quantization/quantizers/hifloat8.py 100%  
hyper_parallel/components/quantization/quantizers/mxfp8.py 100%  
hyper_parallel/components/quantization/quantizers/w4a8.py 100%  
hyper_parallel/components/quantization/tensor/hifloat8_tensor.py 100%  
hyper_parallel/components/quantization/tensor/mxfp8_tensor.py 100%  
hyper_parallel/components/quantization/tensor/quantized_tensor.py 100%  
hyper_parallel/components/quantization/tensor/w4a8_tensor.py 100%  
hyper_parallel/core/optimizer/muon.py 100%  
hyper_parallel/core/optimizer/sinkhorn.py 100%  
hyper_parallel/core/optimizer/swap_optimizer_base.py 100%  
hyper_parallel/core/shard/ops/parallel_getitem.py 100%  
hyper_parallel/data/batching/build_collate_fn.py 100%  
hyper_parallel/data/batching/build_dataloader.py 100%  
hyper_parallel/data/omni/omni_transform.py 100%  
hyper_parallel/data/online/iterable.py 100%  
hyper_parallel/data/parallel/batch_parallel.py 100%  
hyper_parallel/distributed/context_parallel/collectives.py 100%  
hyper_parallel/distributed/context_parallel/compressed_document.py 100%  
hyper_parallel/distributed/context_parallel/gated_mla_backward_overlap.py 100%  
hyper_parallel/distributed/context_parallel/gated_mla_context_parallel.py 100%  
hyper_parallel/distributed/context_parallel/indexer_balance.py 100%  
hyper_parallel/distributed/context_parallel/mla_backward_overlap.py 100%  
hyper_parallel/distributed/context_parallel/mla_context_parallel.py 100%  
hyper_parallel/distributed/context_parallel/sequence_dispatch.py 100%  
hyper_parallel/distributed/context_parallel/wrappers.py 100%  
hyper_parallel/distributed/encoder_parallel/contracts.py 100%  
hyper_parallel/distributed/encoder_parallel/exchange.py 100%  
hyper_parallel/distributed/encoder_parallel/planning.py 100%  
hyper_parallel/distributed/encoder_parallel/runtime.py 100%  
hyper_parallel/distributed_data/api.py 100%  
hyper_parallel/distributed_data/dataset_reader.py 100%  
hyper_parallel/distributed_data/device_prefetch.py 100%  
hyper_parallel/distributed_data/distributed_dataloader.py 100%  
hyper_parallel/distributed_data/indexed_text.py 100%  
hyper_parallel/distributed_data/locality.py 100%  
hyper_parallel/distributed_data/metadata.py 100%  
hyper_parallel/distributed_data/model_batch.py 100%  
hyper_parallel/distributed_data/packed_balancing.py 100%  
hyper_parallel/distributed_data/topology.py 100%  
hyper_parallel/distributed_data/transport.py 100%  
hyper_parallel/tools/model_integration/evidence_store.py 100%  
hyper_parallel/trainer/callbacks/checkpoint_callback.py 100%  
hyper_parallel/trainer/callbacks/profiler_callback.py 100%  
hyper_parallel/trainer/callbacks/stress_detect_callback.py 100%  
hyper_parallel/trainer/config/optimization.py 100%  
hyper_parallel/trainer/config/parallelism.py 100%  
hyper_parallel/trainer/runtime/metrics.py 100%  
hyper_parallel/trainer/text_trainer.py 100%  
hyper_parallel/trainer/vlm_trainer.py 100%  
hyper_parallel/components/functional/aggregate_hidden.py
15
16
17
18
19
20
21
22
23
"""Masked hidden-state aggregation function."""

from typing import Any, Tuple

import torch
import omni_training_custom_ops  # noqa: F401  # pylint: disable=unused-import


class _AggregateHidden(torch.autograd.Function):
hyper_parallel/components/functional/dsa_sparse_attention.py
211
212
213
214
215
216
217
218
219
    key_rope_tnd = rearrange(key_rope, "b s n d -> (b s) n d")
    # Load only the selected optional backend so either can be used independently.
    # pylint: disable=import-outside-toplevel
    if backend == "cann":
        import torch_npu

        output, softmax_max, softmax_sum = _cann_sparse_attention(
            query_tnd,
            key_tnd,
hyper_parallel/components/functional/sink_attention.py
15
16
17
18
19
20
21
22
23
"""Parameter-sink attention function."""

from typing import Optional, Sequence

import torch
import omni_training_custom_ops  # noqa: F401  # pylint: disable=unused-import


def sink_attention(
hyper_parallel/components/modules/dsa_attention.py
19
20
21
22
23
24
25
26
from collections.abc import Mapping, Sequence
from typing import Any

# This package provides PyTorch-specific high-performance modules.
import torch
from torch import nn
from torch.nn import functional as F
from hyper_parallel.components.checkpoint.weight_conversion import WeightConverter
51
52
53
54
55
56
57
58
59
    query_ends, key_ends = (lengths.tolist() for lengths in sequence_lengths)
    q_flat, k_flat, v_flat = (tensor.flatten(0, 1) for tensor in (query, key, value))
    num_heads = q_flat.shape[1]
    causal_mask = torch.ones((2048, 2048), dtype=torch.bool, device=query.device).triu(diagonal=1)
    import torch_npu  # pylint: disable=import-outside-toplevel

    result = torch_npu.npu_fusion_attention(
        q_flat.contiguous(), k_flat.contiguous(), v_flat.contiguous(), num_heads, "TND",
        pse=None, padding_mask=None, atten_mask=causal_mask, scale=module.scaling,
hyper_parallel/components/modules/shared_expert.py
19
20
21
22
23
24
25
26
27
28
from collections.abc import Mapping
from functools import partial
from typing import Any, Optional

import torch
from torch import nn
from transformers.activations import ACT2FN
from hyper_parallel.components.checkpoint.weight_conversion import (
    WeightConverter,
    WeightRenaming,