mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 20:07:41 +08:00
Use pickle by default for serialization (#5978)
This commit is contained in:
+15
-1
@@ -5,12 +5,26 @@ from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
|
||||
# MUST add pickle5 to the import path because it will be imported by some
|
||||
# raylet modules.
|
||||
|
||||
if "pickle5" in sys.modules:
|
||||
raise ImportError("Ray must be imported before pickle5 because Ray "
|
||||
"requires a specific version of pickle5 (which is "
|
||||
"packaged along with Ray).")
|
||||
|
||||
# Add the directory containing pickle5 to the Python path so that we find the
|
||||
# pickle5 version packaged with ray and not a pre-existing pickle5.
|
||||
pickle5_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(__file__)), "pickle5_files")
|
||||
sys.path.insert(0, pickle5_path)
|
||||
|
||||
# MUST import ray._raylet before pyarrow to initialize some global variables.
|
||||
# It seems the library related to memory allocation in pyarrow will destroy the
|
||||
# initialization of grpc if we import pyarrow at first.
|
||||
# NOTE(JoeyJiang): See https://github.com/ray-project/ray/issues/5219 for more
|
||||
# details.
|
||||
import ray._raylet
|
||||
import ray._raylet # noqa: E402
|
||||
|
||||
if "pyarrow" in sys.modules:
|
||||
raise ImportError("Ray must be imported before pyarrow because Ray "
|
||||
|
||||
Reference in New Issue
Block a user