Make sure FlagCX can be compiled on non-NVIDIA platforms#479
Open
tengqm wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a build failure on non-NVIDIA platforms by ensuring flagcxInnerWindow has a concrete definition available when the NVIDIA adaptor headers are not present.
Changes:
- Add a fallback
struct flagcxInnerWindow { int winFlags; }definition insym_heap.hbehind aFLAGCX_INNER_WINDOW_DEFINEDmacro guard. - Define
FLAGCX_INNER_WINDOW_DEFINEDinnvidia_adaptor.hto prevent the fallback definition from being used when building with the NVIDIA adaptor.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| flagcx/core/include/sym_heap.h | Adds a guarded fallback definition of flagcxInnerWindow for non-vendor/non-NVIDIA builds. |
| flagcx/adaptor/include/nvidia_adaptor.h | Defines a macro intended to suppress the fallback flagcxInnerWindow definition when NVIDIA adaptor types are used. |
Comments suppressed due to low confidence (1)
flagcx/adaptor/include/nvidia_adaptor.h:32
FLAGCX_INNER_WINDOW_DEFINEDis defined unconditionally here, but the actualflagcxInnerWindowlayout differs from the fallback definition added insym_heap.hwhenNCCL_VERSION_CODE > 2.27(this header placesbasebeforewinFlags). Any TU that sees the fallback definition (because it includedsym_heap.hbefore this header, or never includes this header) but later receives avendorBaseallocated with the NVIDIA layout will misinterpretwinFlags.
Consider making winFlags the first member in the NVIDIA flagcxInnerWindow as well (so generic code can safely access it), and/or guarding the macro/struct definition so the type cannot be defined inconsistently depending on include order.
#define FLAGCX_INNER_WINDOW_DEFINED
#if NCCL_VERSION_CODE > NCCL_VERSION(2, 27, 0)
struct flagcxInnerWindow {
ncclWindow_t base;
int winFlags;
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+17
to
+19
| struct flagcxInnerWindow { | ||
| int winFlags; | ||
| }; |
Collaborator
|
Please rebase the code |
This file contains hidden or 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
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.
PR Category
Others
PR Types
Bug Fix
PR Description
When compiling FlagCX on non-NVIDIA platforms, there is an error about the
flagcxInnerWindownot defined. This PR fixes the problem.