question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dtype.byteorder is not consistent during cross platform joblib.load()

See original GitHub issue

dtype.byteorder is not consistent during cross platform joblib.load() ( big endian ) of file written in different platform (little endian)

On little endian machine -

Python 3.8.5 (default, Sep  4 2020, 07:30:14)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import joblib
>>> jb = joblib.load('joblib_0.11.0_pickle_py36_np111.pkl')
>>> jb[0].dtype
dtype('int64')
>>> jb[0].dtype.byteorder
'='
>>> jb1 = joblib.load('joblib_0.9.2_compressed_pickle_py34_np19.gz')
>>> jb1[0].dtype
dtype('int64')
>>> jb1[0].dtype.byteorder
'='
>>>

On Big Endian Machine (linux-s390x)

(sklearn-test2) [root@plexors1 data]# python
Python 3.7.4 (default, Oct  7 2020, 05:24:07)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import joblib
>>> jb = joblib.load('joblib_0.11.0_pickle_py36_np111.pkl')
>>> jb[0].dtype
dtype('<i8')
>>> jb[0].dtype.byteorder
'<'                ----------> This is probably because dtype is written as little endian on joblib_0.11.0_pickle_py36_np111.pkl

I think this is backward compatibility support- calling load_compatibility. At Big endian system, test expecting dtype ‘<i8’ byteorder but received ‘int64’.

>>> jb1 = joblib.load('joblib_0.9.2_compressed_pickle_py34_np19.gz')
>>> jb1[0].dtype
dtype('int64')
>>> jb1[0].dtype.byteorder
'='                
>>>

As result test_joblib_pickle_across_python_versions test is failing on s390x system.

Another question , after loading data from file (written in little endian order) into big endian system, in general dtype.byteorder stays with ‘<’ (little endian ) only. Pls do suggest , after joblib.load, dtype.byteorder should always be ‘=’ (if read correctly) - will this be more consistent approach or not.
Thank you !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
lestevecommented, Oct 7, 2021

Do we have any release plan known? Thanks much in advance @ogrisel @lesteve

FYI the 1.1.0 release has just been uploaded on PyPI.

1reaction
ginggscommented, Jul 22, 2021

@lesteve there’s no hurry from the Debian/Ubuntu side, we are carrying @pradghos 's fix as a patch and it will be included in the upcoming Debian 11 and Ubuntu 21.10 releases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing byte-order consistency/mismatch for cross-endian ...
Is there a way to store a pickle string obtained from a big endian machine and test that it can be loaded fine...
Read more >
joblib Documentation
Joblib addresses these problems while leaving your code and your flow control as unmodified as possible (no frame- work, no new paradigms). 3) ......
Read more >
joblib.load — joblib 1.3.0.dev0 documentation - Read the Docs
Reconstruct a Python object from a file persisted with joblib.dump. Read more in the User Guide. WARNING: joblib.load relies on the pickle module...
Read more >
Analysis Report numpy-1.18.2-cp37-cp37m-win_amd64.whl
Found dropped PE file which has not been started or loaded ... IS_PYPY = platform.python_implementation() == 'PyPy'..if (sys.byteorder == 'little'):.
Read more >
What's new - Nilearn
Fix plotting of background image in view_img when the background is not the MNI ... New module nilearn.interfaces to implement loading and saving...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found