-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Symbols]Exporting openceus for streaming outside #22526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mwtian CC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exposing opencensus symbols from Ray seems wrong. Previously, we have been running into issues when grpc symbols are exported. Can we change the test so they don’t depend on ray’s open census symbols? Alternatively, can we rename those symbols so they became Ray specific?
DO NOT USE ray deps sounds reasonable to us. But there is one exception : we must keep one same static var with ray if both ray and outside library use it. Actually opencensus have many static variables so we have to export them to other cpp library. |
Agree with Chen, non-Ray symbols should not be exported by Ray. Since opencensus symbols are not exported by Ray, it should be ok for mobius to statically link against the opencensus library on its own. |
Did you truly know why these symobls should be exported? U __ZN10opencensus4tags6TagKey8RegisterENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE
U __ZN10opencensus5stats13StatsExporter10RemoveViewENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE none of them are used in mobius, but why we need and export them to other module? The deep reason is there are ton of misuse of static variables in ray header files.
we would be milking a bull if tried to settle the problem just let outside project imports library by self. |
I don't know the structure of Mobius very well, but not finding the opencensus symbols could be a result of reusing Ray's stats lib via build object, instead of bazel dependency. What is the reason to depend on There definitely can be issues in Ray usage of global variables. Would you be willing to make a fix for them and see if they fix Mobius' issue as well? |
It was and is this style to use it. |
It's static link to use @com_github_ray_project_ray//:stats_lib that create differents static varabiles between mobius and ray. Ray can not find any static varibles if mobius use in it own static link. For example, there is A static var with 0 by default in opencensus. opencensus::A = 10
``` in source code anywhere.
But ray still gets opencesnus::A equals to 0. |
If this is calling into Ray instead of reusing code from Ray, the 2nd approach of cleaning up |
Code polished for cleaning static variables misusing is long term issue, which is not my changes can do it. According to common external usage guidelines, all of cpp symbols should be published via ray internal namespace that has been created in my previous PR. |
Then can the |
Opencensus exporting should be removed definitely if ray stats lib hidens all of opencensus static symbols. |
Here are some of the issues Ray had with exporting non-Ray symbols: #18870, #20132. Ray needs to avoid similar issues as much as possible.
@jovany-wang you may have more context here. What is your recommendation on this? |
I just wanna to keep macos same with linux exported whatever decision ray main repo would make and how to manage library or exported api. This topic is out of scope of these changes. Actually it might not be done in this PR. |
@ashione is making efforts on hiding non Ray symbols as well, but it should take some time. And I prefer to merge this PR as it doesn't introduce any new symbol. |
I understand |
@jovany-wang I fully understand this blocks the streaming work, but we also risk our user running into ABI incompatibility issues (again), which harms the project in the long run. cc @iycheng @rkooo567 to get a quorum |
Yeah the failure mode here is this pr will fix the issue and we won’t fix the root cause since we resolve the immediate issue. We should use all these issues as a chance to fix bad things in ray. I am also fine merging it, but it’d be great to know concrete timeline regarding when you guys plan to fix the underlying problem |
@jovany-wang @mwtian @scv119 @rkooo567 Any updates for it? |
I'll work on removing exporting opencensus symbols. Perhaps it would be finished in next week. |
Thank you guys, and I'm merging this. |
Opencenus symobls haven been exported in linux version of libcore_worker_library_java.so, but deleted from ray_exported_symbols.lds, which makes streaming macos test case failed. This pr add this exporting record and rename *ray*streaming* stuff to *ray*internal* that's a united entry to ray cpp. Co-authored-by: 林濯 <[email protected]>
To hidden symbols of thirdparty library, this pull request reuses internal namespace that can be imported by any external native projects without side effects. Besides, we suggest all of contributors to make sure it'd better use thirdparty library in ray scopes/namspaces and only ray::internal should be exported. More details in #22526 Mobius has applied this change in ray-project/mobius#28. Co-authored-by: 林濯 <[email protected]>
Why are these changes needed?
Opencenus symobls haven been exported in linux version of libcore_worker_library_java.so, but deleted from ray_exported_symbols.lds, which makes streaming macos test case failed.
This pr add this exporting record and rename raystreaming* stuff to rayinternal* that's a united entry to ray cpp.
Related issue number
ray-project/mobius#26
Checks
scripts/format.sh
to lint the changes in this PR.