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

when to use flagcxBarrier? #29

Closed
singer007 opened this issue Feb 6, 2025 · 4 comments
Closed

when to use flagcxBarrier? #29

singer007 opened this issue Feb 6, 2025 · 4 comments

Comments

@singer007
Copy link
Contributor

singer007 commented Feb 6, 2025

hi,

I have seen some code in this file
https://github.com/FlagOpen/FlagCX/blob/main/test/perf/test_sendrecv.cpp#70

        for(int i=0;i<num_iters;i++){
            flagcxGroupStart();
            flagcxSend(sendbuff, count, DATATYPE, sendPeer, comm, stream);
            flagcxRecv(recvbuff, count, DATATYPE, recvPeer, comm, stream);
            flagcxGroupEnd();
        }
        flagcxBarrier(comm, stream);

Is the flagcxBarrier here works the same as devHandle->streamSynchronize(steam) ?

why here use flagcxBarrier, It add more time when timing the performance of send/recv.

and what does flagcxBarrier used for ?

@MC952-arch
Copy link
Collaborator

Yep, you may use devHandle->streamSynchronize(stream) to achieve synchronization. Here flagcxBarrier is added to testify barrier op in all test cases.

Since flagcxBarrier introduces an extra allreduce operation, it will cause performance degradation for sure.

Thank you for your feedback. We will fix this issue as soon as possible.

@singer007
Copy link
Contributor Author

Hi, may I submit a PR to fix this issue?

@MC952-arch
Copy link
Collaborator

Hi, may I submit a PR to fix this issue?

Hi, this issue has already been fixed in the latest version.
If you encounter any other issues while using it, feel free to submit an issue and a PR.

@singer007
Copy link
Contributor Author

ok, thanks

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

No branches or pull requests

2 participants