Skip to content

test(kunlunxin): add generic IPC memory handle validation#516

Open
yangchaoss wants to merge 3 commits into
flagos-ai:mainfrom
yangchaoss:feat/kunlunxin-ipc-memory-handle
Open

test(kunlunxin): add generic IPC memory handle validation#516
yangchaoss wants to merge 3 commits into
flagos-ai:mainfrom
yangchaoss:feat/kunlunxin-ipc-memory-handle

Conversation

@yangchaoss

@yangchaoss yangchaoss commented Jul 16, 2026

Copy link
Copy Markdown

PR Category

PAL (Portable Abstraction Layer)

PR Types

Test Case

PR Description

This PR adds generic IPC memory handle validation for the device adaptor,
based on FlagCX v0.13.0 (0beba7aa).

Changes:

  • Add argument validation and allocation error propagation to the KunlunXin
    ipcMemHandleCreate implementation.
  • Add backend-agnostic unit tests for ipcMemHandleCreate,
    ipcMemHandleGet, and ipcMemHandleClose.
  • Manage opaque IPC handles only through the public adaptor APIs.
  • Remove KunlunXin-specific conditional compilation and private-header
    dependencies from the adaptor tests.
  • Add a two-rank, same-host MPI test covering:
    Create -> Get -> transfer -> Open -> data validation -> Close -> Free.
  • Add KunlunXin and MPI build support for the adaptor tests.

Validation:

  • 3 generic IPC adaptor unit tests passed.
  • The two-rank same-host MPI IPC lifecycle test passed on both ranks.
  • git diff --check passed.

Notes:

  • Device IPC handles are host-local. The MPI lifecycle test must run with
    both ranks on the same host and does not support cross-node handle transfer.
  • Runtime validation was completed on KunlunXin. Other device backends were
    not runtime-tested in this environment; unsupported IPC implementations
    are skipped at runtime.
  • DeviceAdaptorTest.StreamWaitEvent still fails in the full adaptor suite
    in this environment and is not modified by this PR.

@CLAassistant

CLAassistant commented Jul 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

#include "flagcx.h"
#include "topo.h"

#ifdef USE_KUNLUNXIN_ADAPTOR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to not introduce branch compilation in unittest

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Removed the KunlunXin-specific compile guards and private-header
dependency from the adaptor tests. IPC handles are now managed through
the public adaptor APIs, and unsupported backends are skipped at runtime.
The changes were also rebased onto FlagCX v0.13.0 (0beba7a).

@yangchaoss
yangchaoss force-pushed the feat/kunlunxin-ipc-memory-handle branch from 9ae4ee0 to 4228e79 Compare July 22, 2026 13:17
@yangchaoss yangchaoss changed the title test(kunlunxin): add IPC memory handle validation test(kunlunxin): add generic IPC memory handle validation Jul 22, 2026
Comment thread test/unittest/adaptor/Makefile Outdated
MPI_OBJS := $(MPI_SRCS:%.cpp=$(OBJDIR)/%.o)
MPI_TARGET := $(BINDIR)/adaptor_mpi_tests
MPIRUN ?= mpirun
MPI_NP ?= 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MPI_NP ?= 8

Keep the IPC memory handle test explicitly two-rank and show the
command needed to run it with the required process count.
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

Successfully merging this pull request may close these issues.

3 participants