Skip to content

enhance: integrate Cardinal builds with resource admission - #1876

Merged
sre-ci-robot merged 1 commit into
zilliztech:mainfrom
marcelo-cjl:codex/cardinal-gpu-build
Oct 21, 2026
Merged

sre-ci-robot merged 1 commit into
zilliztech:mainfrom
marcelo-cjl:codex/cardinal-gpu-build

Conversation

@marcelo-cjl

@marcelo-cjl marcelo-cjl commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

issue: #1875

Summary

  • Integrate Cardinal GPU builds with explicit CUDA architectures and propagate build context and input options through wrappers.
  • Add backend resource reservations and a shared serial lane for builds without backend admission.

Cardinal pins will be updated after the companion v1/master adapter changes land.

Test Plan

Release integration build and Cohere 1M GPU Hybrid/PiPNN e2e passed with the workspace dependencies. Submission hooks passed.

/kind feature

@mergify mergify Bot added the dco-passed label Oct 13, 2026
@marcelo-cjl marcelo-cjl changed the title feat: integrate Cardinal GPU index builds enhance: integrate Cardinal GPU index builds Oct 13, 2026
@marcelo-cjl
marcelo-cjl force-pushed the codex/cardinal-gpu-build branch 2 times, most recently from 3bede70 to dd14fe9 Compare October 13, 2026 06:08
@mergify mergify Bot added the ci-passed label Oct 13, 2026
Comment thread include/knowhere/feature.h Outdated
// This flag indicates that the index will be lazy loaded
constexpr uint64_t LAZY_LOAD = 1UL << 22;
// The compiled backend can use GPU construction when requested by gpu_build.
constexpr uint64_t GPU_BUILD = 1UL << 23;

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.

why is additional flag needed, given that the current code already can perform a GPU-based build using cuVS?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed the unnecessary flag.

@marcelo-cjl
marcelo-cjl force-pushed the codex/cardinal-gpu-build branch from dd14fe9 to c424743 Compare October 16, 2026 16:24
@mergify mergify Bot removed the ci-passed label Oct 16, 2026
@mergify

mergify Bot commented Oct 16, 2026

Copy link
Copy Markdown

@marcelo-cjl e2e jenkins job failed, comment /run-e2e can trigger the job again.

@marcelo-cjl
marcelo-cjl force-pushed the codex/cardinal-gpu-build branch from c424743 to 1581d0b Compare October 17, 2026 01:55
@mergify mergify Bot added the ci-passed label Oct 17, 2026

@liliu-z liliu-z left a comment

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.

Both pinned Cardinal adapters (v1 v2.5.112, v2 fd18410) still override Build/BuildAsync with the old signatures, so main won't compile with WITH_CARDINAL=ON after this lands, and CI here doesn't build Cardinal to catch it. Any Milvus knowhere bump or unrelated Cardinal pin bump in between would hit that. Could we bump both pins in this PR once the adapter changes (e.g. zilliztech/cardinal#985) are merged?

Comment thread CMakeLists.txt Outdated
if(WITH_CUVS OR (WITH_CARDINAL AND WITH_GPU))
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR CMAKE_CUDA_ARCHITECTURES STREQUAL "")
if(WITH_CARDINAL AND WITH_GPU)
set(CMAKE_CUDA_ARCHITECTURES native)

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.

Defaulting to native fails on build hosts without a GPU (most image builders), and otherwise ties the binary to whatever GPU the builder has. It also replaces RAPIDS for cuVS when both are on. Maybe just require CMAKE_CUDA_ARCHITECTURES when WITH_GPU is on and fail fast if it's missing?

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.

Confirmed with a minimal CUDA target using this architecture-selection block: with no visible GPU, the default native setting failed to build (nvcc fatal: Unsupported gpu architecture 'compute_No CUDA devices found.' in my environment), while an explicit target architecture built successfully. Could we require CMAKE_CUDA_ARCHITECTURES for Cardinal GPU builds and report a clear configuration error when it is missing, or provide a documented set of supported target architectures? native could remain an explicit choice for local builds.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Cardinal GPU builds now require an explicit architecture, which may be native; cuVS-only still defaults to RAPIDS.


Status
Build(const DataSetPtr dataset, std::shared_ptr<Config> cfg, bool use_knowhere_build_pool) override;
Build(const DataSetPtr dataset, std::shared_ptr<Config> cfg, bool use_knowhere_build_pool,

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.

op_context is forwarded to the base node here, but TryReserveBuild isn't, so MRL always returns the default true. If the base is a Cardinal GPU node, the caller gets admitted without any reservation. Not sure that combination exists yet, but if it does, MRL should forward it with the prefix dim, same as Build.

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.

Please forward TryReserveBuild through both MRLIndexNode and IndexNodeDataMockWrapper. Both currently inherit the default implementation that returns true, so a wrapped backend requiring a reservation can be admitted without consulting its resource availability. MRL should use the same effective prefix dimension and configuration as the base build; the data-type wrapper should preserve the underlying build's shape/type contract. Reservation and construction must reach the same underlying node. Please also add a regression test with a fake backend that returns false: the wrapped call should reach that backend and propagate false rather than report admission.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

MRL and data-type wrappers now forward TryReserveBuild to the build node, with MRL using the prefix dimension.

float query_data[] = {0.0f, 0.0f, 0.0f, 0.0f};
auto base = knowhere::GenDataSet(2, kSourceDim, base_data);
auto query = knowhere::GenDataSet(1, kSourceDim, query_data);
milvus::OpContext op_context;

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.

These pass &op_context but nothing checks that it reaches the node, so they'd still pass if a layer like BuildEmbList or the mock wrapper dropped it. Maybe extend BaseFlatIndexNode in test_index_node.cc to record the op_context its Build receives, and check it through sync, async and emb-list builds?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added assertions that OpContext reaches the underlying node.

- Add backend build reservations and a shared serial lane for unreserved builds.
- Forward build context and input options through wrappers and asynchronous builds.
- Require explicit CUDA architectures for Cardinal while retaining cuVS-only RAPIDS defaults.
- Cover wrapper reservations and operation-context forwarding.

Signed-off-by: marcelo-cjl <marcelo.chen@zilliz.com>
@marcelo-cjl marcelo-cjl changed the title enhance: integrate Cardinal GPU index builds enhance: integrate Cardinal builds with resource admission Oct 20, 2026
@marcelo-cjl
marcelo-cjl force-pushed the codex/cardinal-gpu-build branch from 1581d0b to 2b500fb Compare October 20, 2026 11:58
@mergify mergify Bot removed the ci-passed label Oct 20, 2026
@marcelo-cjl

Copy link
Copy Markdown
Collaborator Author

@liliu-z Regarding the Cardinal dependency pins: once both adapter changes land, we will update both pins and verify the WITH_CARDINAL=ON build.

@mergify mergify Bot added the ci-passed label Oct 20, 2026

@foxspy foxspy left a comment

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.

/lgtm

@sre-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: foxspy, marcelo-cjl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot
sre-ci-robot merged commit 1c0ebeb into zilliztech:main Oct 21, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants