Cpp_api_parity failure: _pickle.UnpicklingError: pickle data was truncated

I’m running PyTorch tests on a non-Intel computer (IBM Z). Many tests in cpp_api_parity produced the following failure message:

ERROR: test_torch_nn_functional_interpolate_nearest_1d (__main__.TestCppApiParity)
Traceback (most recent call last):
  File "/home/linux1/src/pytorch-38/test/cpp_api_parity/functional_impl_check.py", line 203, in test_fn
  File "/home/linux1/src/pytorch-38/test/cpp_api_parity/functional_impl_check.py", line 110, in test_forward
  File "/home/linux1/src/pytorch-38/test/cpp_api_parity/functional_impl_check.py", line 103, in run_cpp_test_fn_and_check_output
    cpp_output = torch.load(forward_output_file_path)
  File "/home/linux1/src/pytorch-38/torch/serialization.py", line 592, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/home/linux1/src/pytorch-38/torch/serialization.py", line 867, in _load
    result = unpickler.load()
_pickle.UnpicklingError: pickle data was truncated

I copied out these generated pickle data, but I couldn’t load them on an Intel system either.

I can successfully build PyTorch and pass all tests on an equivalent setup on Intel CPU. Additionally, I can use torch.save() and torch.load() outside of the tests with no problem. I can also save on an Intel system and load on Z with no problem.

I’m wondering what could have gone wrong in this situation? I’m attaching a link to one of these pt files at https://ibm.box.com/s/t5inwc30e4f237sg9v7eoq7l59psmp0j . Any help and suggestion are welcome. Thank you in advance.

Probably easiest to start minimizing the test case, and then maybe look at the actual pickle opcodes and see where it is malformed. It’s possible pickle doesn’t work at all on your computer, some tests might tell you one way or another there too.