Commit c4a1601
committed
test: add comprehensive unit tests for nonuniform TP
- Moved test from nonuniform_tp.py to tests/unit_tests/distributed/
- Added TestNonuniformTPUtilities: tests for utility functions
- compute_uniform_tp_spares_with_parity (3 test cases)
- get_active_ranks_for_dp (2 test cases)
- Added TestNonuniformTPParameterResharding: tests for parameter resharding
- ntp_map for no spares, healthy ranks, unhealthy ranks
- ntp_init for layers with attention and MLP (4 test cases)
- Added TestNonuniformTPOptimizer: tests for optimizer wrapper
- attribute delegation, prepare_grads, contiguity handling (5 test cases)
- Added TestNonuniformTPIntegration: integration tests
- DDP initialization and backward hooks (2 test cases)
- Total: 17 test cases covering all major NTP functionality1 parent f9bc507 commit c4a1601
File tree
2 files changed
+361
-38
lines changed- megatron/core/distributed
- tests/unit_tests/distributed
2 files changed
+361
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
0 commit comments