Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for macOS #24

Closed
wants to merge 10 commits into from
Closed

Support for macOS #24

wants to merge 10 commits into from

Conversation

lifeiteng
Copy link
Contributor

@lifeiteng lifeiteng commented Nov 21, 2020

  1. Pass reverb/cc/...
//reverb/cc:chunk_store_test                                    (cached) PASSED in 0.5s
//reverb/cc:client_test                                         (cached) PASSED in 0.1s
//reverb/cc:rate_limiter_test                                   (cached) PASSED in 1.5s
//reverb/cc:reverb_service_impl_test                            (cached) PASSED in 0.6s
//reverb/cc:sampler_test                                        (cached) PASSED in 4.2s
//reverb/cc:table_test                                          (cached) PASSED in 3.1s
//reverb/cc:tensor_compression_test                             (cached) PASSED in 0.2s
//reverb/cc:writer_test                                         (cached) PASSED in 1.2s
//reverb/cc/platform:net_test                                   (cached) PASSED in 0.2s
//reverb/cc/platform:server_test                                (cached) PASSED in 0.3s
//reverb/cc/platform:tfrecord_checkpointer_test                 (cached) PASSED in 1.7s
//reverb/cc/platform:thread_test                                (cached) PASSED in 0.2s
//reverb/cc/selectors:fifo_test                                 (cached) PASSED in 0.2s
//reverb/cc/selectors:heap_test                                 (cached) PASSED in 0.2s
//reverb/cc/selectors:lifo_test                                 (cached) PASSED in 0.2s
//reverb/cc/selectors:prioritized_test                          (cached) PASSED in 0.3s
//reverb/cc/selectors:uniform_test                              (cached) PASSED in 0.2s
//reverb/cc/support:cleanup_test                                (cached) PASSED in 0.2s
//reverb/cc/support:intrusive_heap_test                         (cached) PASSED in 0.4s
//reverb/cc/support:periodic_closure_test                       (cached) PASSED in 0.3s
//reverb/cc/support:queue_test                                  (cached) PASSED in 0.2s
  1. Fix py bind

  2. Fix all tests

  3. Final

@lifeiteng
Copy link
Contributor Author

#11

@lifeiteng
Copy link
Contributor Author

I'm trying to Fix python tests

$ bash oss_build.sh --python 3.7

####=======Testing reverb//client_test.py=======####
Traceback (most recent call last):
  File "reverb//client_test.py", line 24, in <module>
    from reverb import client
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/__init__.py", line 27, in <module>
    from reverb import item_selectors as selectors
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/item_selectors.py", line 19, in <module>
    from reverb import pybind
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/pybind.py", line 1, in <module>
    import tensorflow as _tf; from .libpybind import *; del _tf
ImportError: dlopen(/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so, 2): Library not loaded: @loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Creverb_Uservice_Ucc_Uproto___Ureverb_Scc/libreverb_service_cc_proto.so
  Referenced from: /Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so
  Reason: image not found
FAIL: reverb//client_test.py

===========Error Summary============
FAIL: reverb//platform/checkpointers_lib_test.py
FAIL: reverb//dataset_test.py
FAIL: reverb//tf_client_test.py
FAIL: reverb//pybind_test.py
FAIL: reverb//server_test.py
FAIL: reverb//rate_limiters_test.py
FAIL: reverb//client_test.py

@ebrevdo
Copy link
Collaborator

ebrevdo commented Dec 2, 2020

I'm trying to Fix python tests

$ bash oss_build.sh --python 3.7

####=======Testing reverb//client_test.py=======####
Traceback (most recent call last):
  File "reverb//client_test.py", line 24, in <module>
    from reverb import client
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/__init__.py", line 27, in <module>
    from reverb import item_selectors as selectors
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/item_selectors.py", line 19, in <module>
    from reverb import pybind
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/pybind.py", line 1, in <module>
    import tensorflow as _tf; from .libpybind import *; del _tf
ImportError: dlopen(/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so, 2): Library not loaded: @loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Creverb_Uservice_Ucc_Uproto___Ureverb_Scc/libreverb_service_cc_proto.so
  Referenced from: /Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so
  Reason: image not found
FAIL: reverb//client_test.py

===========Error Summary============
FAIL: reverb//platform/checkpointers_lib_test.py
FAIL: reverb//dataset_test.py
FAIL: reverb//tf_client_test.py
FAIL: reverb//pybind_test.py
FAIL: reverb//server_test.py
FAIL: reverb//rate_limiters_test.py
FAIL: reverb//client_test.py

Looks like you added some proper dylib renaming. Is this still an issue?

oss_build.sh Outdated Show resolved Hide resolved
oss_build.sh Outdated Show resolved Hide resolved
oss_build.sh Outdated Show resolved Hide resolved
oss_build.sh Outdated Show resolved Hide resolved
oss_build.sh Outdated Show resolved Hide resolved
@lifeiteng
Copy link
Contributor Author

I'm trying to Fix python tests

$ bash oss_build.sh --python 3.7

####=======Testing reverb//client_test.py=======####
Traceback (most recent call last):
  File "reverb//client_test.py", line 24, in <module>
    from reverb import client
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/__init__.py", line 27, in <module>
    from reverb import item_selectors as selectors
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/item_selectors.py", line 19, in <module>
    from reverb import pybind
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/pybind.py", line 1, in <module>
    import tensorflow as _tf; from .libpybind import *; del _tf
ImportError: dlopen(/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so, 2): Library not loaded: @loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Creverb_Uservice_Ucc_Uproto___Ureverb_Scc/libreverb_service_cc_proto.so
  Referenced from: /Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so
  Reason: image not found
FAIL: reverb//client_test.py

===========Error Summary============
FAIL: reverb//platform/checkpointers_lib_test.py
FAIL: reverb//dataset_test.py
FAIL: reverb//tf_client_test.py
FAIL: reverb//pybind_test.py
FAIL: reverb//server_test.py
FAIL: reverb//rate_limiters_test.py
FAIL: reverb//client_test.py

Looks like you added some proper dylib renaming. Is this still an issue?

I think I did a dirty fix lifeiteng#1

@lifeiteng
Copy link
Contributor Author

I'm trying to Fix python tests

$ bash oss_build.sh --python 3.7

####=======Testing reverb//client_test.py=======####
Traceback (most recent call last):
  File "reverb//client_test.py", line 24, in <module>
    from reverb import client
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/__init__.py", line 27, in <module>
    from reverb import item_selectors as selectors
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/item_selectors.py", line 19, in <module>
    from reverb import pybind
  File "/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/pybind.py", line 1, in <module>
    import tensorflow as _tf; from .libpybind import *; del _tf
ImportError: dlopen(/Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so, 2): Library not loaded: @loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Creverb_Uservice_Ucc_Uproto___Ureverb_Scc/libreverb_service_cc_proto.so
  Referenced from: /Users/feiteng/opt/anaconda3/lib/python3.7/site-packages/reverb/libpybind.so
  Reason: image not found
FAIL: reverb//client_test.py

===========Error Summary============
FAIL: reverb//platform/checkpointers_lib_test.py
FAIL: reverb//dataset_test.py
FAIL: reverb//tf_client_test.py
FAIL: reverb//pybind_test.py
FAIL: reverb//server_test.py
FAIL: reverb//rate_limiters_test.py
FAIL: reverb//client_test.py

Looks like you added some proper dylib renaming. Is this still an issue?

Fix it in 32c3441

@lifeiteng
Copy link
Contributor Author

bash oss_build.sh --python 3.6

Run Python tests...
===========Running Python tests============
####=======Testing reverb//platform/checkpointers_lib_test.py=======####
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: reverb/cc/schema.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
run_python_tests.sh: line 32:  7580 Abort trap: 6           ${PYTHON_BIN_PATH} "${test_file}"
FAIL: reverb//platform/checkpointers_lib_test.py
####=======Testing reverb//dataset_test.py=======####
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: reverb/cc/schema.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
run_python_tests.sh: line 32:  7585 Abort trap: 6           ${PYTHON_BIN_PATH} "${test_file}"
FAIL: reverb//dataset_test.py
####=======Testing reverb//tf_client_test.py=======####
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: reverb/cc/schema.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
run_python_tests.sh: line 32:  7588 Abort trap: 6           ${PYTHON_BIN_PATH} "${test_file}"
FAIL: reverb//tf_client_test.py
...
===========Error Summary============
FAIL: reverb//platform/checkpointers_lib_test.py
FAIL: reverb//dataset_test.py
FAIL: reverb//tf_client_test.py
FAIL: reverb//pybind_test.py
FAIL: reverb//server_test.py
FAIL: reverb//rate_limiters_test.py
FAIL: reverb//client_test.py

@lifeiteng
Copy link
Contributor Author

bazel_config=""
bazel test -c opt --copt=-mavx ${bazel_config} --test_output=errors //reverb/...
INFO: 8 processes: 8 darwin-sandbox.
INFO: Build completed successfully, 9 total actions
//reverb/cc:chunk_store_test                                    (cached) PASSED in 0.4s
//reverb/cc:client_test                                         (cached) PASSED in 0.2s
//reverb/cc:rate_limiter_test                                   (cached) PASSED in 1.5s
//reverb/cc:reverb_service_impl_test                            (cached) PASSED in 0.7s
//reverb/cc:sampler_test                                        (cached) PASSED in 3.9s
//reverb/cc:table_test                                          (cached) PASSED in 2.7s
//reverb/cc:tensor_compression_test                             (cached) PASSED in 0.1s
//reverb/cc:writer_test                                         (cached) PASSED in 1.2s
//reverb/cc/platform:net_test                                   (cached) PASSED in 0.1s
//reverb/cc/platform:server_test                                (cached) PASSED in 0.2s
//reverb/cc/platform:tfrecord_checkpointer_test                 (cached) PASSED in 1.1s
//reverb/cc/platform:thread_test                                (cached) PASSED in 0.1s
//reverb/cc/selectors:fifo_test                                 (cached) PASSED in 0.2s
//reverb/cc/selectors:heap_test                                 (cached) PASSED in 0.2s
//reverb/cc/selectors:lifo_test                                 (cached) PASSED in 0.2s
//reverb/cc/selectors:prioritized_test                          (cached) PASSED in 0.3s
//reverb/cc/selectors:uniform_test                              (cached) PASSED in 0.2s
//reverb/cc/support:cleanup_test                                (cached) PASSED in 0.1s
//reverb/cc/support:intrusive_heap_test                         (cached) PASSED in 0.1s
//reverb/cc/support:periodic_closure_test                       (cached) PASSED in 0.3s
//reverb/cc/support:queue_test                                  (cached) PASSED in 0.1s
//reverb:dataset_test                                                    PASSED in 20.0s
//reverb:pybind_test                                                     PASSED in 7.2s
//reverb:rate_limiters_test                                              PASSED in 6.9s
//reverb:server_test                                                     PASSED in 7.2s
//reverb:tf_client_test                                                  PASSED in 7.4s
//reverb/platform:checkpointers_lib_test                                 PASSED in 6.8s
//reverb:client_test                                                     PASSED in 8.9s
  Stats over 2 runs: max = 8.9s, min = 8.7s, avg = 8.8s, dev = 0.1s

INFO: Build completed successfully, 9 total actions

but bash oss_build.sh --python 3.6 still has many errors (python tests)

@lifeiteng
Copy link
Contributor Author

bash oss_build.sh --python 3.6

Run Python tests...
===========Running Python tests============
####=======Testing reverb//platform/checkpointers_lib_test.py=======####
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: reverb/cc/schema.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
run_python_tests.sh: line 32:  7580 Abort trap: 6           ${PYTHON_BIN_PATH} "${test_file}"
FAIL: reverb//platform/checkpointers_lib_test.py
####=======Testing reverb//dataset_test.py=======####
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: reverb/cc/schema.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
run_python_tests.sh: line 32:  7585 Abort trap: 6           ${PYTHON_BIN_PATH} "${test_file}"
FAIL: reverb//dataset_test.py
####=======Testing reverb//tf_client_test.py=======####
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: reverb/cc/schema.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
run_python_tests.sh: line 32:  7588 Abort trap: 6           ${PYTHON_BIN_PATH} "${test_file}"
FAIL: reverb//tf_client_test.py
...
===========Error Summary============
FAIL: reverb//platform/checkpointers_lib_test.py
FAIL: reverb//dataset_test.py
FAIL: reverb//tf_client_test.py
FAIL: reverb//pybind_test.py
FAIL: reverb//server_test.py
FAIL: reverb//rate_limiters_test.py
FAIL: reverb//client_test.py

Those are caused by (link ../_solib_darwin/ schema_cc_proto.so twice)

# reverb/cc/checkpointing/BUILD
reverb_cc_proto_library(
    name = "checkpoint_cc_proto",
    srcs = ["checkpoint.proto"],
    deps = [
        "//reverb/cc:schema_cc_proto",
    ],
)


$ otool -L /Users/feiteng/opt/anaconda3/lib/python3.6/site-packages/reverb/libpybind.so

/Users/feiteng/opt/anaconda3/lib/python3.6/site-packages/reverb/libpybind.so:
	bazel-out/darwin-opt/bin/reverb/libpybind.so (compatibility version 0.0.0, current version 0.0.0)
	@loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Creverb_Uservice_Ucc_Uproto___Ureverb_Scc/libreverb_service_cc_proto.so (compatibility version 0.0.0, current version 0.0.0)
	@loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Scheckpointing_Ccheckpoint_Ucc_Uproto___Ureverb_Scc_Scheckpointing/libcheckpoint_cc_proto.so (compatibility version 0.0.0, current version 0.0.0)
	@loader_path/../_solib_darwin/_U_S_Sreverb_Scc_Cschema_Ucc_Uproto___Ureverb_Scc/libschema_cc_proto.so (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libtensorflow_framework.2.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1677.104.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1677.104.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

$ otool -L /Users/feiteng/opt/anaconda3/lib/python3.6/site-packages/_solib_darwin/_U_S_Sreverb_Scc_Scheckpointing_Ccheckpoint_Ucc_Uproto___Ureverb_Scc_Scheckpointing/libcheckpoint_cc_proto.so

/Users/feiteng/opt/anaconda3/lib/python3.6/site-packages/_solib_darwin/_U_S_Sreverb_Scc_Scheckpointing_Ccheckpoint_Ucc_Uproto___Ureverb_Scc_Scheckpointing/libcheckpoint_cc_proto.so:
	bazel-out/darwin-opt/bin/reverb/cc/checkpointing/libcheckpoint_cc_proto.so (compatibility version 0.0.0, current version 0.0.0)
	@loader_path/../../../_solib_darwin/_U_S_Sreverb_Scc_Cschema_Ucc_Uproto___Ureverb_Scc/libschema_cc_proto.so (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libtensorflow_framework.2.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

@lifeiteng
Copy link
Contributor Author

I'm busy a few weeks before the Spring Festival, and I will reply later.

@tfboyd
Copy link
Collaborator

tfboyd commented Feb 24, 2021

@lifeiteng We are not giving up on this item. We did not setup our system to sync PRs which is why it is taking a bit (ok a lot) more time than one might expect. This is a big thing we really want for Reverb.

This is just a note to let you or anyone seeing this know that this is still being tracked and worked on.

@lifeiteng
Copy link
Contributor Author

TF-Agents and ACME will work on OSX

yes, I have tested them.

@lifeiteng
Copy link
Contributor Author

Should we configure CI(run tests Darwin/Linux) for the repo?

@lifeiteng
Copy link
Contributor Author

@lifeiteng We are not giving up on this item. We did not setup our system to sync PRs which is why it is taking a bit (ok a lot) more time than one might expect. This is a big thing we really want for Reverb.

This is just a note to let you or anyone seeing this know that this is still being tracked and worked on.

OK, I'll replay review comments in 24 hours.

@KaleabTessera
Copy link

This would be an amazing feature to have!

@thisiscam
Copy link

@tfboyd is there still plan to merge this?

@andyk
Copy link

andyk commented Sep 27, 2021

Hi Reverb team, just wondering if you have any updates on a timeline for merging this?

@sabelaraga
Copy link
Collaborator

sabelaraga commented Sep 30, 2021

Hey, unfortunately, at the moment we don't have the bandwidth to merge and maintain the extra build for MacOSX.

One possible way forward would be to keep this in a fork. We would definitely add the link to it from the Reverb README.

@Robokan
Copy link

Robokan commented Mar 23, 2022

What is the status of this? Is it possible to try out the fork?

@lifeiteng
Copy link
Contributor Author

close this

@lifeiteng lifeiteng closed this Jan 13, 2023
@lifeiteng lifeiteng mentioned this pull request Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants