Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 34 additions & 45 deletions tests/integration/defs/cpp/test_multi_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,67 +44,43 @@ def get_multi_gpu_env(kv_cache_type=KVCacheType.NONE, llama_multi_gpu=False):
return env


def run_simple_multi_gpu_tests(build_dir: _pl.Path, timeout=1500):
def run_mpi_utils_tests(build_dir, timeout=300):

tests_dir = build_dir / "tests"
cpp_env = {**_os.environ}
# Utils tests
mgpu_env = get_multi_gpu_env()

mpi_utils_test = [
"mpirun",
"-n",
"4",
"--allow-run-as-root",
"mpiUtilsTest",
]
_cpp.run_command(mpi_utils_test, cwd=tests_dir, env=cpp_env, timeout=300)
_cpp.run_command(mpi_utils_test,
cwd=tests_dir,
env=mgpu_env,
timeout=timeout)

# Cache transceiver MPI tests
new_env = get_multi_gpu_env(kv_cache_type=KVCacheType.MPI)

cache_trans_test = [
"mpirun",
"-n",
"2",
"--allow-run-as-root",
"batch_manager/cacheTransceiverTest",
]
_cpp.run_command(cache_trans_test, cwd=tests_dir, env=new_env, timeout=300)

cache_trans_test_8_proc = [
"mpirun",
"-n",
"8",
"--allow-run-as-root",
"batch_manager/cacheTransceiverTest",
]
_cpp.run_command(cache_trans_test_8_proc,
cwd=tests_dir,
env=new_env,
timeout=600)
def run_cache_transceiver_tests(build_dir: _pl.Path,
nprocs=2,
kv_cache_type=KVCacheType.MPI,
timeout=600):

# Cache transceiver tests with UCX
new_env = get_multi_gpu_env(kv_cache_type=KVCacheType.UCX)
tests_dir = build_dir / "tests"
mgpu_env = get_multi_gpu_env(kv_cache_type=kv_cache_type)

cache_trans_test = [
"mpirun",
"-n",
"2",
"--allow-run-as-root",
"batch_manager/cacheTransceiverTest",
]
_cpp.run_command(cache_trans_test, cwd=tests_dir, env=new_env, timeout=300)

# Cache transceiver tests
cache_trans_test_8_proc = [
"mpirun",
"-n",
"8",
f"{nprocs}",
"--allow-run-as-root",
"batch_manager/cacheTransceiverTest",
]
_cpp.run_command(cache_trans_test_8_proc,
_cpp.run_command(cache_trans_test,
cwd=tests_dir,
env=new_env,
timeout=600)
env=mgpu_env,
timeout=timeout)


def run_llama_executor_leader_tests(build_dir: _pl.Path, timeout=1500):
Expand Down Expand Up @@ -447,12 +423,25 @@ def multi_gpu_model(request, prepare_model_multi_gpu):

@pytest.mark.parametrize("build_google_tests", ["80", "86", "89", "90"],
indirect=True)
def test_simple(build_google_tests, build_dir):
def test_mpi_utils(build_google_tests, build_dir):

if platform.system() != "Windows":
Comment thread
DomBrown marked this conversation as resolved.
run_mpi_utils_tests(build_dir, timeout=300)


@pytest.mark.parametrize("build_google_tests", ["80", "86", "89", "90"],
indirect=True)
@pytest.mark.parametrize("kvcache_type", [KVCacheType.MPI, KVCacheType.UCX],
ids=["mpi_kvcache", "ucx_kvcache"])
@pytest.mark.parametrize("nprocs", [2, 8], ids=["2proc", "8proc"])
def test_cache_transceiver(build_google_tests, nprocs, kvcache_type, build_dir):

if platform.system() != "Windows":

run_simple_multi_gpu_tests(build_dir=build_dir,
timeout=_cpp.default_test_timeout)
run_cache_transceiver_tests(build_dir=build_dir,
nprocs=nprocs,
kv_cache_type=kvcache_type,
timeout=600)


@pytest.mark.parametrize("build_google_tests", ["80", "86", "89", "90"],
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/test_lists/test-db/l0_dgx_h100.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ l0_dgx_h100:
auto_trigger: others
tests:
# ------------- CPP tests ---------------
- cpp/test_multi_gpu.py::test_simple[90]
- cpp/test_multi_gpu.py::test_mpi_utils[90]
- cpp/test_multi_gpu.py::test_cache_transceiver[2proc-mpi_kvcache-90]
- cpp/test_multi_gpu.py::test_cache_transceiver[2proc-ucx_kvcache-90]
- cpp/test_multi_gpu.py::test_cache_transceiver[8proc-mpi_kvcache-90]
- cpp/test_multi_gpu.py::test_cache_transceiver[8proc-ucx_kvcache-90]
- cpp/test_multi_gpu.py::test_enc_dec[t5-90]
- cpp/test_multi_gpu.py::test_llama_executor[llama-orchestrator-90]
- cpp/test_multi_gpu.py::test_llama_executor[llama-leader-90]
Expand Down