| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 14 天前 | ||
| 12 天前 | ||
| 1 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 个月前 |
Tests Usage
-
Install
mindspeedpip install -e . -
Copy the entire
tests_extendto the root path ofMegatron-LMcp -r tests_extend {PATH_TO_MEGATRON_LM} -
Run a single test by pytest command line under
Megatron-LMroot pathcd {PATH_TO_MEGATRON_LM} pytest tests_extend/unit_tests/megatron/test_distrib_optimizer.py -
Run the default CI unit tests
cd {PATH_TO_MEGATRON_LM} pytest tests_extend/unit_tests -
Run the complete unit test suite, including slow tests
cd {PATH_TO_MEGATRON_LM} pytest tests_extend/unit_tests --run-all
Marking Slow Unit Tests
The default CI gate skips tests marked with pytest.mark.slow. The complete
suite runs them when --run-all is specified.
Mark a test as slow when it is intended for full regression rather than the default CI gate. Typical examples include large tensor shapes, long sequences, repeated parameter combinations, and expensive distributed or integration scenarios. Keep at least one representative smoke case in the default CI gate when possible.
Mark a whole test file as slow:
import pytest
pytestmark = pytest.mark.slow
Mark a single test as slow:
@pytest.mark.slow
def test_large_shape():
...
Mark only selected parameter combinations as slow:
@pytest.mark.parametrize(
"seq_len",
[
1024,
pytest.param(32768, marks=pytest.mark.slow),
],
)
def test_attention(seq_len):
...
All tests under tests_extend/unit_tests/ops/triton are marked as slow
automatically. New Triton tests do not need to add the marker explicitly.