From 2cf21748cdf6c9bbe7228f156573ea92ccb9a472 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Mon, 19 Aug 2024 22:26:33 +0800 Subject: [PATCH] BLD: Fix self-hosted CI env (#102) --- .github/workflows/python.yaml | 12 ++++++++++-- python/xoscar/serialization/tests/test_serial.py | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index bfefb871..77bb4bae 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -70,6 +70,8 @@ jobs: needs: lint env: CONDA_ENV: xoscar-test + SELF_HOST_PYTHON: /root/miniconda3/envs/xoscar-test/bin/python + SELF_HOST_CONDA: /root/miniconda3/condabin/conda defaults: run: shell: bash -l {0} @@ -85,7 +87,7 @@ jobs: - { os: windows-latest, python-version: 3.9} - { os: windows-latest, python-version: 3.10} include: - - { os: self-hosted, module: gpu, python-version: 3.9} + - { os: self-hosted, module: gpu, python-version: 3.11} steps: - name: Check out code @@ -131,7 +133,12 @@ jobs: - name: Install on GPU if: ${{ matrix.module == 'gpu' }} run: | - python setup.py build_ext -i + source activate ${{ env.CONDA_ENV }} + conda install -y conda-forge::nccl=2.22.3 + pip install --extra-index-url=https://pypi.nvidia.com cudf-cu12 + pip install ucx-py-cu12 cloudpickle psutil tblib uvloop packaging "numpy<2.0.0" scipy cython coverage flaky + python setup.py clean --all + pip install -e ./ working-directory: ./python - name: Test with pytest @@ -143,6 +150,7 @@ jobs: -W ignore::PendingDeprecationWarning \ --cov-config=setup.cfg --cov-report=xml --cov=xoscar xoscar --capture=no else + source activate ${{ env.CONDA_ENV }} pytest -m cuda --cov-config=setup.cfg --cov-report=xml --cov=xoscar --capture=no fi working-directory: ./python diff --git a/python/xoscar/serialization/tests/test_serial.py b/python/xoscar/serialization/tests/test_serial.py index cc293640..236fb395 100644 --- a/python/xoscar/serialization/tests/test_serial.py +++ b/python/xoscar/serialization/tests/test_serial.py @@ -231,8 +231,9 @@ def test_cudf(): test_df = cudf.DataFrame(raw_df) cudf.testing.assert_frame_equal(test_df, deserialize(*serialize(test_df))) - raw_df.columns = pd.MultiIndex.from_tuples([("a", "a"), ("a", "b"), ("b", "c")]) - test_df = cudf.DataFrame(raw_df) + multi_index = pd.MultiIndex.from_tuples([("a", "a"), ("a", "b"), ("b", "c")]) + raw_df.columns = multi_index + test_df = cudf.DataFrame(raw_df, columns=multi_index) cudf.testing.assert_frame_equal(test_df, deserialize(*serialize(test_df)))