-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JAX] Test_multiprocessing_encoder with process spawn in bash (#1394)
* add test_multiprocessing_encoder with processing spawning in bash --------- Signed-off-by: Phuong Nguyen <[email protected]>
- Loading branch information
Showing
5 changed files
with
67 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# See LICENSE for license information. | ||
|
||
"""config for test_multiprocessing_encoder""" | ||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
"""Pytest hook for test_multiprocessing_encoder""" | ||
parser.addoption("--num-process", action="store", default=0) | ||
parser.addoption("--process-id", action="store", default=0) | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def multiprocessing_parses(request): | ||
"""Fixture for querying num-process and process-id""" | ||
if request.cls: | ||
request.cls.num_process = int(request.config.getoption("--num-process")) | ||
request.cls.process_id = int(request.config.getoption("--process-id")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# See LICENSE for license information. | ||
|
||
NUM_GPUS=${NUM_GPUS:-$(nvidia-smi -L | wc -l)} | ||
|
||
for i in $(seq 0 $(($NUM_GPUS-1))) | ||
do | ||
pytest -c $TE_PATH/tests/jax/pytest.ini -v $TE_PATH/examples/jax/encoder/test_multiprocessing_encoder.py::TestEncoder::test_te_bf16 --num-process=$NUM_GPUS --process-id=$i & | ||
done | ||
wait | ||
|
||
for i in $(seq 0 $(($NUM_GPUS-1))) | ||
do | ||
pytest -c $TE_PATH/tests/jax/pytest.ini -v $TE_PATH/examples/jax/encoder/test_multiprocessing_encoder.py::TestEncoder::test_te_fp8 --num-process=$NUM_GPUS --process-id=$i & | ||
done | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters