diff --git a/.github/workflows/ray_test.yml b/.github/workflows/ray_test.yml index 4548312..011ea3a 100644 --- a/.github/workflows/ray_test.yml +++ b/.github/workflows/ray_test.yml @@ -18,21 +18,15 @@ on: jobs: ray: - runs-on: self-host-gpu - strategy: - matrix: - python-version: ["3.12"] + runs-on: [self-hosted, gpu] # test if the enviroment is ready steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: - python-version: ${{ matrix.python-version }} - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install yapf - # pip install toml==0.10.2 + fetch-depth: 0 + - name: Install the current repository + run: | + pip install -e . - name: Running some ray test that only need 2 GPUs run: | + cd tests/ray pytest -s -x test_rvdz.py test_driverfunc_to_worker.py test_data_transfer.py test_colocated_workers.py test_check_worker_alive.py diff --git a/.github/workflows/yapf_format.yml b/.github/workflows/yapf_format.yml index 8788acb..c6d27c3 100644 --- a/.github/workflows/yapf_format.yml +++ b/.github/workflows/yapf_format.yml @@ -24,8 +24,13 @@ jobs: python-version: ["3.12"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ github.head_ref }} # Checkout the branch associated with the pull request + # - name: checkout + # run: | + # commits=${{ github.event.pull_request.commits }} + # if [[ -n "$commits" ]]; then + # # Prepare enough depth for diffs with main + # git fetch --depth="$(( commits + 1 ))" + # fi - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: diff --git a/tests/ray/check_worker_alive/main.py b/tests/ray/check_worker_alive/main.py index 8d2134d..9526f1b 100644 --- a/tests/ray/check_worker_alive/main.py +++ b/tests/ray/check_worker_alive/main.py @@ -42,7 +42,7 @@ def foo(self, wait_time): # test single-node-no-partition print(f"test single-node-no-partition") - resource_pool = RayResourcePool([8], use_gpu=True) + resource_pool = RayResourcePool([2], use_gpu=True) class_with_args = RayClassWithInitArgs(cls=TestActor) print("create worker group") diff --git a/tests/ray/test_data_transfer.py b/tests/ray/test_data_transfer.py index 34eddd3..480e576 100644 --- a/tests/ray/test_data_transfer.py +++ b/tests/ray/test_data_transfer.py @@ -52,7 +52,7 @@ def do_nothing(self, data): def test_data_transfer(): ray.init() # construct resource pool - resource_pool = RayResourcePool([8]) + resource_pool = RayResourcePool([2]) cls_with_init = RayClassWithInitArgs(cls=DummyWorker) # construct worker group wg = RayWorkerGroup(resource_pool, cls_with_init) diff --git a/tests/ray/test_driverfunc_to_worker.py b/tests/ray/test_driverfunc_to_worker.py index 94026a3..2c7007b 100644 --- a/tests/ray/test_driverfunc_to_worker.py +++ b/tests/ray/test_driverfunc_to_worker.py @@ -56,7 +56,7 @@ def test(): # construct model ray.init() - # create 8 workers, each hold a GPU + # create 2 workers, each hold a GPU resource_pool = RayResourcePool([2], use_gpu=True, name_prefix='a') class_with_args = RayClassWithInitArgs(cls=ModelActor) diff --git a/tests/ray/test_rvdz.py b/tests/ray/test_rvdz.py index ce94319..9eec1d7 100644 --- a/tests/ray/test_rvdz.py +++ b/tests/ray/test_rvdz.py @@ -38,14 +38,14 @@ def test_rvdz(): ray.init() group_name = "test_group" - world_size = 4 + world_size = 2 workers = [TestWorker.options(num_gpus=1).remote(rank, world_size, group_name) for rank in range(world_size)] - [worker.init.remote() for worker in workers] + ray.get([worker.init.remote() for worker in workers]) ranks = ray.get([worker.test.remote() for worker in workers]) - assert ranks == [0, 1, 2, 3], f"expecting [0, 1, 2, 3], got {ranks}" + assert ranks == [0, 1], f"expecting [0, 1], got {ranks}" ray.shutdown()