parity-testing

Verify weight parity between HF and MCore model conversions using Python scripts.

852|445|Updated May 21, 2025
One-click install
npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill parity-testing-nvidia-nemo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: parity-testing
Source: https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/skills/parity-testing
Command: npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill parity-testing-nvidia-nemo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill verifies the numerical parity of weights during HF to MCore model conversions, detecting discrepancies that could lead to inconsistencies or errors.

Core Features & Use Cases

  • Parity Verification: Checks weight consistency after conversion to ensure fidelity.
  • Troubleshooting Tool: Assists in debugging weight mismatch issues during model deployment or training.
  • Use Case: When converting a trained HF model to MCore format, use this Skill to verify all weights match, ensuring reliable inference.

Quick Start

Use the parity-testing Skill to run a round-trip weight verification for your model conversion process.

Frequently Asked Questions about parity-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify weight consistency after converting a Hugging Face model to Megatron Core?

To verify weight consistency after converting a Hugging Face model to Megatron Core, run a round-trip parity check using Python scripts like hf_megatron_roundtrip.py to compare weight tensors and detect numerical discrepancies.

What is numerical parity testing in model conversion workflows?

Numerical parity testing in model conversion workflows is the process of verifying that weight tensors remain mathematically consistent across formats. It prevents discrepancies and ensures precise model performance during deployment.

Why does my model performance degrade after converting weights from HF to MCore format?

Model performance degradation after converting weights from HF to MCore format often stems from numerical discrepancies in the tensors. Parity testing identifies these weight mismatches to ensure reliable inference and deployment.

Can I use Python scripts to debug checkpoint integrity during model deployment?

Yes, you can use Python scripts to debug checkpoint integrity during model deployment. This Skill facilitates troubleshooting by comparing weight tensors accurately to detect and resolve mismatch issues.

What's the best way to check weight tensors for discrepancies in HF to MCore conversions?

The best way to check weight tensors for discrepancies in HF to MCore conversions is executing a round-trip verification script. This tests weight fidelity directly to detect any numerical inconsistencies before deployment.