Skip to content

Commit

Permalink
Try fix ray
Browse files Browse the repository at this point in the history
  • Loading branch information
wjsi committed Oct 28, 2023
1 parent 624fb5a commit 326ef43
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/platform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ jobs:
./ci/install-hadoop.sh
echo "import coverage; coverage.process_startup()" > \
$(python -c "import site; print(site.getsitepackages()[-1])")/coverage.pth
conda install -n test --quiet --yes -c conda-forge python=$PYTHON skein libffi conda-pack
conda install -n test --quiet --yes -c conda-forge python=$PYTHON skein libffi \
conda-pack gxx_linux-64\>=11.1.0
fi
if [ -n "$WITH_VINEYARD" ]; then
pip install vineyard -i https://pypi.org/simple
Expand All @@ -105,7 +106,7 @@ jobs:
fi
if [ -n "$WITH_RAY" ] || [ -n "$WITH_RAY_DAG" ] || [ -n "$WITH_RAY_DEPLOY" ]; then
pip install "ray>=1.8.0,<2.4.0"
pip install "xgboost_ray<0.1.14" "protobuf<4"
pip install xgboost_ray "protobuf<4"
# Ray Datasets need pyarrow>=6.0.1
pip install "pyarrow>=6.0.1"
pip install lightgbm
Expand Down
3 changes: 2 additions & 1 deletion mars/dataframe/contrib/raydataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import operator
from functools import reduce

from ....utils import lazy_import
from ....utils import lazy_import, lazy_import_on_load
from .mldataset import _rechunk_if_needed
from typing import Dict, List

Expand Down
6 changes: 1 addition & 5 deletions mars/dataframe/contrib/raydataset/tests/test_mldataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@

ray = lazy_import("ray")
ml_dataset = lazy_import("ray.util.data", rename="ml_dataset")

try:
import xgboost_ray
except ImportError: # pragma: no cover
xgboost_ray = None
xgboost_ray = lazy_import("xgboost_ray")
try:
import sklearn
except ImportError: # pragma: no cover
Expand Down
12 changes: 12 additions & 0 deletions mars/dataframe/datasource/read_raydataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,21 @@ def read_ray_dataset(ds, columns=None, incremental_index=False, **kwargs):
from ray.data.impl.pandas_block import PandasBlockSchema
except ImportError: # pragma: no cover
PandasBlockSchema = type(None)
try:
from ray.data.dataset import Schema as RayDatasetSchema
except ImportError:
RayDatasetSchema = type(None)

Check warning on line 129 in mars/dataframe/datasource/read_raydataset.py

View check run for this annotation

Codecov / codecov/patch

mars/dataframe/datasource/read_raydataset.py#L126-L129

Added lines #L126 - L129 were not covered by tests

if isinstance(schema, PandasBlockSchema):
dtypes = pd.Series(schema.types, index=schema.names)
elif isinstance(schema, RayDatasetSchema):
dtypes = pd.Series(
[
t.to_pandas_dtype() if t is not object else np.dtype("O")
for t in schema.types
],
index=schema.names,
)
elif isinstance(schema, pa.Schema):
dtypes = schema.empty_table().to_pandas().dtypes
else:
Expand Down
10 changes: 5 additions & 5 deletions mars/storage/vineyard.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ async def setup(cls, **kwargs) -> Tuple[Dict, Dict]:
vineyard_store = None
else:
vineyard_store = vineyard.deploy.local.start_vineyardd(
etcd_endpoints,
etcd_prefix,
vineyardd_path,
vineyard_size,
vineyard_socket,
etcd_endpoints=etcd_endpoints,
etcd_prefix=etcd_prefix,
vineyardd_path=vineyardd_path,
size=vineyard_size,
socket=vineyard_socket,
rpc=False,
)
vineyard_socket = (
Expand Down
2 changes: 2 additions & 0 deletions mars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ def __getattr__(self, item):
elif locals is not None:
locals[rename] = real_mod
ret = getattr(real_mod, item)

for on_load_func in self._on_loads:
on_load_func()

# make sure on_load hooks only executed once
self._on_loads = []
return ret
Expand Down

0 comments on commit 326ef43

Please sign in to comment.