[v1] add dp & mp mesh (#9611)

This commit is contained in:
Yaowei Zheng
2025-12-13 01:44:28 +08:00
committed by GitHub
parent 203069e11c
commit 110d21713e
3 changed files with 158 additions and 55 deletions

View File

@@ -20,5 +20,7 @@ from llamafactory.v1.accelerator.interface import DistributedInterface, Distribu
def test_distributed_interface():
DistributedInterface(DistributedStrategy())
assert DistributedInterface.rank == int(os.getenv("RANK", "0"))
assert DistributedInterface.world_size == int(os.getenv("WORLD_SIZE", "1"))
assert DistributedInterface.get_rank() == int(os.getenv("RANK", "0"))
assert DistributedInterface.get_world_size() == int(os.getenv("WORLD_SIZE", "1"))
assert DistributedInterface.get_local_rank() == int(os.getenv("LOCAL_RANK", "0"))
assert DistributedInterface.get_local_world_size() == int(os.getenv("LOCAL_WORLD_SIZE", "1"))