Skip to content

Conversation

@jeynmann
Copy link

@jeynmann jeynmann commented Oct 23, 2025

What?

Stub headers for gdaki.

Why?

Ucx device app may build failed if ucx-ib-mlx5-gda not installed,
because ucx device api include gdaki's header directly.

How?

Add stub dir to ucx include path.
The stub dir has low prior so compiler can find real impl header if related package is installed.

Summary by CodeRabbit

  • New Features

    • Added fallback stub implementations for GPU-accelerated operations when optional GDAKI package is unavailable, improving build flexibility and compatibility.
  • Chores

    • Updated build system and configuration files to properly include and install stub headers as part of the library distribution.

@jeynmann jeynmann changed the title stubs: stub for gdaki BUILD: stub for gdaki Oct 23, 2025
@jeynmann jeynmann changed the title BUILD: stub for gdaki BUILD: Add stub include path for gdaki Oct 23, 2025
@@ -0,0 +1,101 @@
/**
* Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

no need this space



typedef struct {
uct_device_ep_t super;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think only uct_rc_gda_completion_t is needed and it might be empty

@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

A new stubs directory is integrated into the UCX build system with fallback stub headers for GDAKI GPU operations. The build configuration is updated to recognize and include these stubs, and template-based stub functions return unsupported status or perform no-ops when the DOCA GPUNetIO package is unavailable.

Changes

Cohort / File(s) Change Summary
Build system integration
Makefile.am, configure.ac
Added stubs directory to build SUBDIRS and configured stubs/Makefile generation.
Compiler flags configuration
config/m4/cuda.m4, ucx.pc.in
Introduced STUB_CFLAGS macro substitution to expose stub include paths in build and pkg-config.
Stub package configuration
stubs/Makefile.am
Defined stub header installation rules with stubincludedir and nobase_stubinclude_HEADERS.
Stub header implementations
stubs/uct/ib/mlx5/gdaki/gdaki.cuh, stubs/uct/ib/mlx5/gdaki/gdaki_dev.h
New stub headers providing template functions for GDAKI operations and type definitions; functions return UCS_ERR_UNSUPPORTED or are no-ops.
Package manifest
ucx.spec.in
Added %{_includedir}/stubs to the devel package file list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify GDAKI function signatures align with expected DOCA GPUNetIO interfaces
  • Confirm stub header include paths and installation directories are correct
  • Ensure stubs directory integration does not interfere with existing build workflows

Poem

🐰 When DOCA is away, stubs come out to play,
Template functions standing guard throughout the day,
With UCS_ERR_UNSUPPORTED and functions that rest,
The build system's fallbacks put portability to the test! ✨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'BUILD: Add stub include path for gdaki' accurately reflects the main change: adding stub headers for GDAKI via build configuration modifications. The title is clear, concise, and directly summarizes the core objective.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 122348a and 1bd1628.

📒 Files selected for processing (8)
  • Makefile.am (1 hunks)
  • config/m4/cuda.m4 (1 hunks)
  • configure.ac (1 hunks)
  • stubs/Makefile.am (1 hunks)
  • stubs/uct/ib/mlx5/gdaki/gdaki.cuh (1 hunks)
  • stubs/uct/ib/mlx5/gdaki/gdaki_dev.h (1 hunks)
  • ucx.pc.in (1 hunks)
  • ucx.spec.in (1 hunks)
🧰 Additional context used
🪛 Clang (14.0.6)
stubs/uct/ib/mlx5/gdaki/gdaki_dev.h

[error] 9-9: 'uct/api/device/uct_device_types.h' file not found

(clang-diagnostic-error)

🔇 Additional comments (8)
Makefile.am (1)

44-45: LGTM! Stub directory properly integrated into build system.

The addition of the stubs directory to SUBDIRS is correct and properly formatted with continuation.

stubs/uct/ib/mlx5/gdaki/gdaki_dev.h (1)

1-14: LGTM! Stub header correctly implements empty completion type.

The empty struct typedef for uct_rc_gda_completion_t aligns with the past review feedback and is appropriate for a stub implementation.

Note: The static analysis error about the missing header file is a false positive due to sandbox environment limitations. The header uct/api/device/uct_device_types.h will be available during actual compilation.

stubs/Makefile.am (1)

1-13: LGTM! Stub header installation correctly configured.

The use of nobase_stubinclude_HEADERS correctly preserves the directory structure, ensuring stub headers are installed to ${includedir}/stubs/uct/ib/mlx5/gdaki/ and can be found via the -I${includedir}/stubs flag added to STUB_CFLAGS.

config/m4/cuda.m4 (1)

235-239: LGTM! STUB_CFLAGS correctly configured for fallback mechanism.

The stub include path is properly positioned to have lower priority than real package headers. The clear comment explains the purpose, and the AC_SUBST makes it available for substitution in pkg-config and other configuration files.

stubs/uct/ib/mlx5/gdaki/gdaki.cuh (1)

1-100: LGTM! Stub implementations appropriately return unsupported status.

The template-based stub functions correctly:

  • Return UCS_ERR_UNSUPPORTED for operations when GDAKI is unavailable
  • Implement uct_rc_mlx5_gda_ep_progress as a no-op (appropriate for progress function)
  • Use proper device function annotations (UCS_F_DEVICE)
  • Include clear documentation explaining the fallback mechanism

The implementation provides a clean fallback when DOCA GPUNetIO is not installed while ensuring compilation succeeds.

ucx.spec.in (1)

169-169: LGTM! Stub directory correctly added to devel package.

The stub headers are appropriately included in the devel package file list, ensuring they're available when the ucx-devel package is installed.

configure.ac (1)

370-370: LGTM! Stub Makefile correctly added to configuration.

Adding stubs/Makefile to AC_CONFIG_FILES ensures the stub build system is properly generated during configuration.

ucx.pc.in (1)

16-16: LGTM! Stub include path correctly propagated to pkg-config.

The addition of @STUB_CFLAGS@ ensures that packages using UCX via pkg-config will find the stub headers as a fallback when DOCA GPUNetIO is not installed. The ordering (main includedir before stubs) correctly implements the priority mechanism where real implementation headers are preferred.


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

4 participants