Repository navigation
enhance: integrate Cardinal builds with resource admission - #1876
Conversation
3bede70 to
dd14fe9
Compare
| // 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; |
There was a problem hiding this comment.
why is additional flag needed, given that the current code already can perform a GPU-based build using cuVS?
There was a problem hiding this comment.
Removed the unnecessary flag.
dd14fe9 to
c424743
Compare
|
@marcelo-cjl e2e jenkins job failed, comment |
c424743 to
1581d0b
Compare
liliu-z
left a comment
There was a problem hiding this comment.
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?
| 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
1581d0b to
2b500fb
Compare
|
@liliu-z Regarding the Cardinal dependency pins: once both adapter changes land, we will update both pins and verify the WITH_CARDINAL=ON build. |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
issue: #1875
Summary
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