Conversation
Co-authored-by: Ihor Indyk <iindyk@google.com>
oss/build_whl.sh
Outdated
| # Install ArrayRecord from the wheel and run smoke tests. | ||
| # TF is not available on Python 3.13 and above. | ||
| if (( "${PYTHON_MINOR_VERSION}" < 13 )); then | ||
| $PYTHON_BIN -m pip install --find-links=/tmp/grain/all_dist --pre array-record |
There was a problem hiding this comment.
/tmp/grain/all_dist -> /tmp/array_record/all_dist
I think in the workflow run you shared it still installed AR from pypi: https://github.com/mtsokol/array_record/actions/runs/16147213833/job/45569132362#step:7:7181
There was a problem hiding this comment.
Ah right, it took a bit more work but all linux wheels are build now:
https://github.com/mtsokol/array_record/actions/runs/16167375237
for MacOS arm64 it fails on import with:
+ /Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin/python oss/test_with_grain.py
libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
/tmp/array_record/oss/build_whl.sh: line 15: 12619 Abort trap: 6 $PYTHON_BIN oss/test_with_grain.py
Is it the error that you meant?
There was a problem hiding this comment.
I think this is something similar to: apache/arrow#40088, apache/arrow#40088 (comment)
There was a problem hiding this comment.
After some research it looks like the reason for this mutex issue are different protobuf versions that ArrayRecord uses and Grain requires.
Grain requires protobuf 24.4 and ArrayRecord similarly, but the ArrayRecord was missing:
write_to_bazelrc "common --check_direct_dependencies=error"and the actual protobuf installed by ArrayRecord in the current main is 29.0.rc2 (!). I tried reducing versions in ArrayRecord but unfortunately eigen is holding on protobuf here, and tampering with its version leads to compilation errors.
I'm not sure what is the best option right now. The intuition tells me that ArrayRecord now requires 29.0 and the next release should uphold it and Grain should now also upgrade (But I remember that you said it's a painful process for Grain).
On the other hand dragging an ArrayRecord fork which is 35 commits behind also sounds cumbersome, especially that for conda-forge we need an official release that is available on github, we can't rely on a fork.
How painful would be to upgrade protobuf for Grain?
There was a problem hiding this comment.
yeah, I also think this is because of the protobuf version. The problem here is not so much in grain, but tensorflow -- updating protobuf in grain is easy, but if both AR and Grain have higher protobuf version than TF, then import with TF will fail the same way. This is how we found out in the first place about this -- TF is not a dependency, but is often installed in the same ecosystem.
I think protobuf version was updated in TF main: tensorflow/tensorflow#92241. So now, hopefully with the next release of TF we can update it too.
There was a problem hiding this comment.
Could we try solve this by using TensorFlow nightly in our test? Some in https://pypi.org/project/tf-nightly/#history should already use newer protobuf, right?
There was a problem hiding this comment.
yes for tests, but our users wouldn't be using nightly most likely: https://github.com/google-research/kauldron/blob/8537718c703ab606a545eee6daf89238d8def55f/pyproject.toml#L41
33913a7 to
c9d4a11
Compare
928465e to
36c467e
Compare
| version = "0.7.3", | ||
| repo_name = "com_google_array_record", | ||
| ) | ||
|
|
There was a problem hiding this comment.
Let's use actual bazel_dep(name = "protobuf", version = ...) here and enforce errors if different is picked:
write_to_bazelrc "common --check_direct_dependencies=error"
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 781211931
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 781211931
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 781211931
dryman
left a comment
There was a problem hiding this comment.
Please add a small document on how to run the new workflows. Thanks.
MODULE.bazel
Outdated
| ignore_root_user_error = True, # Required for our containerized CI environments. | ||
| python_version = PYTHON_VERSION, | ||
| http_archive( | ||
| name = "pybind11", |
There was a problem hiding this comment.
Why adding an extra pybind11 rule here?
There was a problem hiding this comment.
TBH I mostly followed Grain setup as that's the repo we're mainly working with: https://github.com/google/grain/blob/3bc1d2582dffdddf00b0d436a24b6313b69c617d/MODULE.bazel#L31
I can check it without it that one - and remove it if it also builds successfully.
There was a problem hiding this comment.
AR is using pybind11 through pybind_bazel already. So it should work without http_archive pulled pybind11.
There was a problem hiding this comment.
Done! Removed pybind11 rule from here.
Done! I also enforced direct dependencies versions and fixed protobuf version to the one used by TF nightly: #162 (comment) Here's a workflow with passing jobs: https://github.com/mtsokol/array_record/actions/runs/16217754006 |
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 781211931
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 781211931
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 781211931
This PR cleans up the wheel build process for array_record and migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead of main. Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833 Ported from #162 PiperOrigin-RevId: 783082302
|
submitted in #163 |
Hi @iindyk,
This PR cleans up the wheel build process for
array_recordand migrates changes present in https://github.com/iindyk/array_record/tree/main 20 commits ahead ofmain.Here's a job that I ran for it: https://github.com/mtsokol/array_record/actions/runs/16147213833