-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix a number of duplicate definition names #667
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot:aws:retest ... requested by Xin |
bot:aws:retest |
aws-nslick
reviewed
Oct 21, 2024
Prefix all symbols in the sendrecv interface with sendrecv_ to prevent naming conflicts with similar functions in the rdma protocol. We should update the rdma protocol as well, but this at least gets us out of violating C++'s ODR rules. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
The param implementation stamped out accessor functions in each compilation unit, which created obvious problems with C++'s naming rules. We know we want to rewrite this in the future, so for now just stamp out one implementation in nccl_ofi_param.c that everyone can call, and do some ugly macro hacking to make that a minimum required change. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
aws-nslick
previously approved these changes
Oct 21, 2024
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 but would prefer to see the diff minimized by just dropping the semicolons on these:
#define OFI_NCCL_PARAM_UINT(name, env, default_value) \
uint64_t ofi_nccl_##name(void);
#define OFI_NCCL_PARAM_INT(name, env, default_value) \
int64_t ofi_nccl_##name(void);
#define OFI_NCCL_PARAM_STR(name, env, default_value) \
const char *ofi_nccl_##name(void);
Then the definitions can remain untouched, unless i'm missing something.
bwbarrett
force-pushed
the
cleanup/silly-odr
branch
from
October 21, 2024 20:27
e268003
to
061d8ee
Compare
aws-nslick
approved these changes
Oct 21, 2024
bot:aws:retest
|
bot:aws:retest
and
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In preparation for moving to C++, make sure we're closer to following the One Definition Rule. There was one major offender, duplicate symbol names between the sendrecv and rdma transports. While we still need to clean up the naming in the rdma transport, this PR prefixes every private symbol in the sendrecv transport with
sendrecv_
.The other potential badness was the param code, if the compiler did not inline those functions. To work around that, we do some ugly hacking to put all the param access functions in a single
nccl_ofi_param.c
file, andnccl_ofi_param.h
only creates declarations most of the time. The implementation is ugly, but we want to rewrite this code anyway, so let's limp until we're using C++ and can write something better.Without this PR:
With this PR:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.