testing

Organize, run, and debug Megatron-LM unit and functional tests.

17.4k|4.3k|Updated Mar 21, 2019
One-click install
npx skills add https://github.com/NVIDIA/Megatron-LM --skill testing-nvidia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/NVIDIA/Megatron-LM/tree/main/skills/testing
Command: npx skills add https://github.com/NVIDIA/Megatron-LM --skill testing-nvidia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you understand, write, run, and troubleshoot Megatron-LM unit and functional tests so failures can be reproduced locally and corrected quickly.

Core Features & Use Cases

  • Test layout navigation: Understand the split between unit tests, functional end-to-end tests, and shared CI test utilities.
  • Recipe YAML authoring: Create and modify workload recipes, including product expansion, placeholders, and per-platform test configuration.
  • Golden values workflow: Download and update golden values to diagnose numerical regressions and maintain expected outputs.
  • CI parity and diagnostics: Reproduce CI behavior locally (torch.distributed.run, container mounts, rank logging rules, and artifact locations).
  • Marker filters and stability controls: Use pytest marker filters (e.g., flaky, experimental) and scope suffixing to disable tests without deleting them.

Quick Start

Use the testing skill to reproduce a CI bucket failure locally with the same unit or functional test invocation and then update golden values if the change is an intentional numerical shift.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I reproduce a Megatron-LM CI test failure locally?

To reproduce a Megatron-LM CI test failure locally, use the testing skill to match the CI bucket invocation with torch.distributed.run, container mounts, and rank logging rules for exact environmental parity.

How do I author recipe YAML workload matrices for functional testing?

Author recipe YAML workload matrices by defining product expansions, parsing placeholders, and configuring per-platform settings to generate functional testing workloads for Megatron-LM.

What is the workflow for updating golden values during numerical regression testing?

Updating golden values during numerical regression testing involves downloading expected outputs and replacing them when an intentional numerical shift occurs, ensuring deterministic validation passes.

How do pytest marker filters manage flaky or experimental tests in Megatron-LM?

Pytest marker filters manage flaky or experimental tests by applying scope suffixing to disable unstable tests without deleting them, maintaining test suite stability across CI runs.

Does nemo-run DockerExecutor parity affect local test debugging for torch.distributed execution?

Yes, nemo-run DockerExecutor parity affects local test debugging by requiring matching container mounts and artifact locations to accurately reproduce torch.distributed execution behavior.

When should I use unit tests versus functional end-to-end tests in Megatron-LM?

Use unit tests for isolated component validation and functional end-to-end tests for validating complete workload recipes, leveraging shared CI test utilities for both test layouts.