Skip to content

Commit 8d0b75f

Browse files
MC952-archchencjcj
authored andcommitted
Fix several bugs and update v0.5 release notes (flagos-ai#264)
1 parent c3de63d commit 8d0b75f

6 files changed

Lines changed: 40 additions & 30 deletions

File tree

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[<img src="docs/images/flagopen.png">](https://flagopen.baai.ac.cn/)
22

33
## Latest News
4+
- **[2025/09]** Released [v0.5](https://github.com/FlagOpen/FlagCX/tree/release/v0.5):
5+
- Adds AMD support (hipAdaptor and rcclAdaptor).
6+
- Introduces flagcxNetAdaptor to unify network backends, currently supporting SOCKET, IBRC, UCX and IBUC (experimently).
7+
- Enables zero-copy device-buffer RDMA (user-buffer RDMA) to boost small-message performance.
8+
- Supports automatic tuning in homogeneous scenarios via flagcxTuner.
9+
- Integrates automated PyTorch API tests into CI/CD.
410
- **[2025/08]** Released [v0.4](https://github.com/FlagOpen/FlagCX/tree/release/v0.4):
511
- Supports heterogeneous training of ERNIE4.5 on Nvidia and Iluvatar GPUs with Paddle + FlagCX.
612
- Enables more robust and flexible deployments with full support of heterogeneous communication across arbitrary NIC configurations (bug fixes).
@@ -92,7 +98,7 @@ FlagCX also integrates with upper-layer applications such as PyTorch and PaddleP
9298
2. Build the library with different flags targeting to different platforms:
9399
```sh
94100
cd FlagCX
95-
make [USE_NVIDIA/USE_ILUVATAR_COREX/USE_CAMBRICON/USE_GLOO/USE_MPI/USE_METAX/USE_MUSA/USE_KUNLUNXIN/USE_DU/USE_ASCEND]=1
101+
make [USE_NVIDIA/USE_ILUVATAR_COREX/USE_CAMBRICON/USE_GLOO/USE_MPI/USE_METAX/USE_MUSA/USE_KUNLUNXIN/USE_DU/USE_ASCEND/USE_AMD]=1
96102
```
97103
The default install path is set to `build/`, you can manually set `BUILDDIR` to specify the build path. You may also define `DEVICE_HOME` and `CCL_HOME` to indicate the install paths of device runtime and communication libraries.
98104

@@ -117,6 +123,9 @@ All tests support the same set of arguments:
117123
* Performance
118124
* `-w, <warmup iteration count>` number of warmup iterations (not timed). Default: 5.
119125
* `-n, <iteration count>` number of iterations. Default: 20.
126+
* Test Operation
127+
* `-R, <0/1>` enable local buffer registration on send/recv buffers. Default: 0.
128+
* `-s, <OCT/DEC/HEX>` specify MPI communication split mode. Default: 0
120129
* Utils
121130
* `-p, <0/1>` print buffer info. Default: 0.
122131
* `-h` print help message. Default: disabled.

flagcx/core/flagcx_tuner.cc

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,13 @@ struct flagcxTunerContext {
114114
};
115115

116116
static struct flagcxEnvConfig config1 = {
117-
.commTag = "defaultConfig1",
118-
.envCount = 1,
119-
.envs = {{.type = FLAGCX_ENV_TYPE_CREATION,
120-
.name = "NCCL_P2P_NVL_CHUNKSIZE",
121-
.value = "1024",
122-
.defaultValue = "524288"}}};
123-
117+
"defaultConfig1",
118+
1,
119+
{FLAGCX_ENV_TYPE_COLL, "NCCL_P2P_NVL_CHUNKSIZE", "1024", "524288"}};
124120
static struct flagcxEnvConfig config2 = {
125-
.commTag = "defaultConfig2",
126-
.envCount = 1,
127-
.envs = {{.type = FLAGCX_ENV_TYPE_CREATION,
128-
.name = "NCCL_P2P_NVL_CHUNKSIZE",
129-
.value = "524288",
130-
.defaultValue = "524288"}}};
121+
"defaultConfig2",
122+
1,
123+
{FLAGCX_ENV_TYPE_COLL, "NCCL_P2P_NVL_CHUNKSIZE", "524288", "524288"}};
131124

132125
bool operator<(const struct flagcxCommTag &lhs,
133126
const struct flagcxCommTag &rhs) {

flagcx/core/flagcx_tuner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extern flagcxTuner_t internalTuner;
100100
do { \
101101
comm->tunerInnerComm = nullptr; \
102102
size_t nBytes = count * getFlagcxDataTypeSize(datatype); \
103-
struct flagcxCommTag tag = {.tag = ""}; \
103+
struct flagcxCommTag tag = {""}; \
104104
FLAGCXCHECK(comm->tuner->getCollInfo(comm->tunerContext, commOp, nBytes, \
105105
0, NULL, 0, &tag)); \
106106
const auto it = comm->homoCommMap.find(tag); \

flagcx/core/net.cc

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,14 @@ flagcxResult_t flagcxSendProxyFree(sendNetResources *resources) {
344344
FLAGCXCHECK(deviceAdaptor->eventDestroy(resources->cpEvents[s]));
345345
}
346346
FLAGCXCHECK(deviceAdaptor->streamDestroy(resources->cpStream));
347-
FLAGCXCHECK(resources->netAdaptor->deregMr(resources->netSendComm,
348-
resources->mhandles[0]));
349-
FLAGCXCHECK(resources->netAdaptor->closeSend(resources->netSendComm));
350-
FLAGCXCHECK(deviceAdaptor->gdrMemFree(resources->buffers[0], NULL));
347+
resources->netAdaptor->deregMr(resources->netSendComm,
348+
resources->mhandles[0]);
349+
resources->netAdaptor->closeSend(resources->netSendComm);
350+
if (resources->netAdaptor == getUnifiedNetAdaptor(SOCKET)) {
351+
free(resources->buffers[0]);
352+
} else if (resources->netAdaptor == getUnifiedNetAdaptor(IBRC)) {
353+
FLAGCXCHECK(deviceAdaptor->gdrMemFree(resources->buffers[0], NULL));
354+
}
351355
return flagcxSuccess;
352356
}
353357

@@ -356,11 +360,15 @@ flagcxResult_t flagcxRecvProxyFree(recvNetResources *resources) {
356360
FLAGCXCHECK(deviceAdaptor->eventDestroy(resources->cpEvents[s]));
357361
}
358362
FLAGCXCHECK(deviceAdaptor->streamDestroy(resources->cpStream));
359-
FLAGCXCHECK(resources->netAdaptor->deregMr(resources->netRecvComm,
360-
resources->mhandles[0]));
361-
FLAGCXCHECK(resources->netAdaptor->closeRecv(resources->netRecvComm));
362-
FLAGCXCHECK(resources->netAdaptor->closeListen(resources->netListenComm));
363-
FLAGCXCHECK(deviceAdaptor->gdrMemFree(resources->buffers[0], NULL));
363+
resources->netAdaptor->deregMr(resources->netRecvComm,
364+
resources->mhandles[0]);
365+
resources->netAdaptor->closeRecv(resources->netRecvComm);
366+
resources->netAdaptor->closeListen(resources->netListenComm);
367+
if (resources->netAdaptor == getUnifiedNetAdaptor(SOCKET)) {
368+
free(resources->buffers[0]);
369+
} else if (resources->netAdaptor == getUnifiedNetAdaptor(IBRC)) {
370+
FLAGCXCHECK(deviceAdaptor->gdrMemFree(resources->buffers[0], NULL));
371+
}
364372
return flagcxSuccess;
365373
}
366374

flagcx/flagcx.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ flagcxResult_t flagcxCommInitRank(flagcxComm_t *comm, int nranks,
434434
(*comm)->homoCommMap.clear();
435435
// Note: The tuner only support homo comm optimization for now
436436
for (uint32_t i = 0; i < nConfigs; ++i) {
437-
struct flagcxCommTag tag = {.tag = ""};
437+
struct flagcxCommTag tag = {""};
438438
FLAGCXCHECK((*comm)->tuner->setCandidate((*comm)->tunerContext, i, &tag));
439439
INFO(FLAGCX_INIT, "start to prepare communicator tag=%s(%u/%u)", tag.tag,
440440
i, nConfigs);

test/perf/tools.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ parser::parser(int argc, char **argv) {
9898
{"iters", required_argument, 0, 'n'},
9999
{"print_buffer", required_argument, 0, 'p'},
100100
{"root", required_argument, 0, 'r'},
101-
{"split_mask", required_argument, 0, 'm'},
101+
{"split_mask", required_argument, 0, 's'},
102102
{"local_register", required_argument, 0, 'R'},
103103
// {"op", required_argument, 0, 'o'},
104104
// {"datatype", required_argument, 0, 'd'},
@@ -107,7 +107,7 @@ parser::parser(int argc, char **argv) {
107107

108108
while (1) {
109109
int c;
110-
c = getopt_long(argc, argv, "b:e:f:w:n:p:r:m:R:h", longOpts, &longIndex);
110+
c = getopt_long(argc, argv, "b:e:f:w:n:p:r:s:R:h", longOpts, &longIndex);
111111

112112
if (c == -1)
113113
break;
@@ -164,7 +164,7 @@ parser::parser(int argc, char **argv) {
164164
exit(1);
165165
}
166166
break;
167-
case 'm':
167+
case 's':
168168
splitMask = strtoul(optarg, NULL, 0);
169169
break;
170170
case 'R':
@@ -187,12 +187,12 @@ parser::parser(int argc, char **argv) {
187187
"[-n <iters>] \n\t"
188188
"[-p <printbuffer 0/1>] \n\t"
189189
"[-r <root>] \n\t"
190-
"[-m <splitmask OCT/DEC/HEX>] \n\t"
190+
"[-s <splitmask OCT/DEC/HEX>] \n\t"
191191
"[-R <localregister 0/1>] \n\t"
192192
"[-h\n",
193193
basename(argv[0]));
194194
printf("Use default values with -b 1M -e 1G -f 2 -w 5 -n 20 -p 0 -r 0 "
195-
"-m 0 -R 0\n");
195+
"-s 0 -R 0\n");
196196
break;
197197
}
198198
}

0 commit comments

Comments
 (0)