Skip to content

build: use Pixi as the sole GPU provider - #29254

Merged
XuPeng-SH merged 21 commits into
matrixorigin:mainfrom
aunjgr:feature/28966-optional-gpu-toolchain
Sep 28, 2026
Merged

XuPeng-SH merged 21 commits into
matrixorigin:mainfrom
aunjgr:feature/28966-optional-gpu-toolchain

Conversation

@aunjgr

@aunjgr aunjgr commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Refs #28966. This prerequisite does not close the migration issue.

Review notes

  • The owner superseded the earlier optional-manifest decision: Pixi is the sole GPU build provider in the final embedded shape; CPU-only builds remain Pixi-free.
  • GPU toolchain design v2 at this head describes the provider, native provenance, and upgrade contract. Sirius Add compare #22 removed its duplicate exporter; draft MO feat: add bounded native Sirius CGo bridge #29203 owns shared-prefix enforcement and combined runtime packaging.
  • MO GPU-only builds retain a small standalone Pixi lock. Combined MO/Sirius builds use Sirius's single mo prefix. The upgrade helper aligns shared direct constraints from Sirius's locked mo manifest and lets Pixi resolve MO's own lock; it does not copy Sirius's multi-environment lock.
  • @cpegeric is a CODEOWNER for cgo/cuda and cgo/cuvs; CODEOWNER and independent design review remain required.

Current-head validation at 3ee87c0426: required MO CI passed, including UT, Coverage, SCA, native-contract checks, and active multi-CN BVT lanes. Both GPU Dockerfiles built at this head with rootless Podman; their final runtime images passed the 333-ELF loader, dangling-link, driver-stub, and outside-Pixi audit (evidence). XuPeng-SH approved this exact design and implementation head. Sirius #22 has merged at 6adc9c0; the combined MO/Sirius CGo bridge remains separate draft #29203. CODEOWNER cpegeric's formal change request is still outstanding. Earlier failed or pending CI runs belong to superseded heads.

What this PR does / why we need it:

Make Pixi the sole provider for MatrixOne GPU builds while keeping CPU-only builds independent of Pixi. Derive CUDA/cuVS inputs from the activated frozen environment, rebuild native thirdparties when its lock changes, and package GPU runtime libraries without dangling links, conflicting basenames, or driver stubs. Remove the system CUDA/Conda path and separate toolchain manifest, retain both GPU Dockerfiles, and provide a safe upgrade helper for MO's standalone Pixi lock. Both Dockerfiles now produce the same 2.67 GB final runtime image, about 70% smaller than the historically reported 8.97 GB CUDA/Conda image.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@fengttt fengttt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add @cpegeric as code owner of cgo/cuda, cgo/cuvs, and include him as required reviewer.

@fengttt

fengttt commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

This PR needs approval from @cpegeric

@aunjgr

aunjgr commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

@cpegeric @fengttt Addressing the two new reviews on 2a32561972:

  • The copied go_cuda-133_arch-x86_64.yaml is deleted by this PR. There is no YAML-to-Pixi conversion step on a cuVS upgrade: optools/gpu/pixi.toml and its lock own MO GPU-only builds. Update compatible CUDA/cuVS/RMM constraints and regenerate the affected Pixi lock(s), then validate those builds. The upgrade procedure is now in the design and README.
  • For a combined MO/Sirius binary, MO is built under Sirius's mo Pixi environment, not under MO's separate standalone lock. Both profiles currently pin libcuvs==26.08.01 and CUDA 13.3; the combined build consumes the one Sirius prefix. The local full MO GPU build and the new CUDA XCall regression passed using that actual prefix after merging current main. Draft MO feat: add bounded native Sirius CGo bridge #29203 verifies the shared prefix and packages the observed ELF closure; it remains unpushed until its prerequisites merge.

The design also now says precisely where provider identity lives: Sirius link.json records verified compilers and link inputs; the bridge's prepared provenance records the active Pixi prefix and lock digest. No separate GPU manifest is exported. Linux and macOS native-contract CI passed on the previous head; CI for this merged-main head is running. Please re-review the updated diff and the CODEOWNER scope.

@aunjgr
aunjgr requested review from cpegeric and fengttt September 24, 2026 03:17
@aunjgr

aunjgr commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

@XuPeng-SH Your earlier review correctly required a traceable design decision. The optional-manifest implementation and its specific Make/stub findings have been removed. The owner-directed Pixi-only decision is recorded on #28966, and the current technical design is blob be35cc55c570a17e4a7eac7e61e8c955413d733e.

Please review that exact v2 design independently, especially the MO GPU-only lock versus the single Sirius mo prefix for combined builds, cuVS upgrade procedure, native provenance, and runtime driver/stub boundary, and record a design decision or specific blocking invariant. I am not treating the owner scope decision as technical design approval. The combined host build and two-stream coexistence test passed locally on the refreshed draft bridge; #29254's full CI is still running.

@aunjgr

aunjgr commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

CI follow-up for head 2a32561972, run 35950625144, without code or test changes:

  • Attempt 1: TestAffectedRows failed while creating its database after HAKeeper ID allocation timed out; the separate Coverage job exhausted GitHub HTTP 503 retries fetching this PR's .diff.
  • Attempt 2: Coverage passed. The broad UT job failed in different embedded-cluster tests (TestIssue26114CrossAccountBranchQuotaAndOwnership and TestV408LoginRepairsTenantCreatedAfterUpgradeSnapshot), with log-service timeouts, slow WAL commits, and a reset local connection. These failures have not been proven pre-existing or attributed to this PR.
  • Attempt 3: Coverage passed, but the UT rerun was cancelled when marking this PR ready triggered a newer same-head workflow through CI concurrency. The replacement run 36032257372 now owns the active UT result. No green-CI claim is made while it runs.

The PR is ready for independent Pixi-only design/CODEOWNER review while the replacement CI result is pending.
Update after head aa39e16e42: the prior same-head replacement run failed in both multi-CN Compose lanes before MO started because Quay denied anonymous pulls of minio/minio and minio/mc. This is shared with main. The independently validated repair #29370 has merged; I merged the newest main into this branch and pushed it. New run 36035510648 is in progress. No green-CI claim yet.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep review of aa39e16e426b9028d34705dd96c86417f5b81c5b: I verified two actionable issues below. The exact-lock CUDA package reproduces the Docker staging failure; a focused native provenance fixture reproduces the stale thirdparty reuse. Please address both before merge.

Comment thread optools/images/gpu/Dockerfile Resolved
Comment thread cgo/mo-native-provenance Resolved

@cpegeric cpegeric left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

provide tools to extract sirius pixi.lock into our own pixi.loc.

Comment thread optools/gpu/pixi.lock Resolved
@aunjgr

aunjgr commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor Author

CI triage for head e78d170047: run 36261865274 failed in UT Coverage on TestIssue28012And28013AcceptedCommitDuringStandaloneShutdown; Coverage and CI Required then failed because the UT producer was incomplete. The diagnostic artifact shows the restarted embedded cluster waited 2m15s for shared admission, while the test reused a 2-minute pre-shutdown SQL context. Its first post-restart PingContext received context deadline exceeded. The test and its admission behavior are on main; this is not a GPU build/runtime failure. I fixed the test's phase-local context ownership in separate #29398, validated exact focused coverage/race and the owning package locally. #29254 remains red until that PR merges and this branch takes the fix; no green-CI claim yet.

Update: #29398 merged as 9dfe5c1be9. I merged newest main into #29254 and pushed head 4bffa2ee2f; run 36324588745 is the new exact-head CI. The earlier red checks remain historical until this run finishes.

Update on head 4bffa2ee2f, run 36324588745: UT Coverage, Coverage, SCA, native checks, shared build, and both active multi-CN BVT lanes passed. The broad UT job timed out at its 122-minute outer limit; two tests reported cleanup-context deadlines under that run. Its light phase took ~50 minutes and embedded prebuild ~34 minutes, versus ~13 and ~16 minutes in the passing near-main #29234 UT run on the same 8c/16GB runner class. #29254 changes no Go files and its UT-script change is GPU-only. This does not prove the failures are pre-existing or transient, so no product/test timeout was changed. A failed-only rerun, attempt 2, is queued at the same SHA.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

REQUEST_CHANGES: I do not recommend approval yet. Both GPU image recipes were changed, but no actual GPU image build has been run; the Dockerfile CI job only validates the ordinary CPU Dockerfile. This leaves the delivery path that previously failed during CUDA runtime library staging unverified. Please build both optools/images/gpu/Dockerfile and Dockerfile.dev at this revision, then verify the resulting runtime image has no dangling links or packaged driver stubs and resolves its user-space dependencies without the Pixi build prefix. The four inline threads are resolved, and I found the symlink staging and same-prefix lock provenance fixes with focused regression tests. The current CI is green, but those checks do not build these GPU images. The CODEOWNER approval from @cpegeric is also still pending; the existing @fengttt approval predates the latest fixes. Design direction looks sound; I found no need for an additional provider branch.

@aunjgr

aunjgr commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

GPU image delivery verification at 3ee87c0 (linux/amd64, rootless Podman):

  • Built both final images from the repository root: podman build --format docker --file optools/images/gpu/Dockerfile --tag localhost/mo-gpu-29254:prod . and the same command with Dockerfile.dev / :dev.
  • Ran sh optools/images/gpu/verify-runtime-image.sh podman IMAGE for each final image. Both passed: 333 packaged ELF files checked; no dangling runtime-library symlinks, packaged NVIDIA driver libraries or stubs, Pixi build prefix, or unresolved user-space dependencies. Host-supplied libcuda.so.1 is the explicit exception.
  • Both final builds produced image ID 5fb07e0125887fb913c8a193daaf998d35fcf02b6c26639efe411338966b4291 (2,674,027,261 bytes); the recipe test also checks final-stage parity.
  • The first real build exposed rootless tar ownership and nested GNU Make jobserver failures. The corrected recipes built successfully. The first runtime audit exposed missing libX11.so.6, now supplied by the runtime OS package in both images. The dev recipe is retained, uses frozen Pixi with repository-root context, and has a named development stage.
  • Focused GPU image/staging contract suite: 9/9 passed; shell syntax and diff checks passed. Fresh CI has started at this SHA and is not yet claimed green.

These checks validate packaging and loader closure without a Pixi build prefix; they do not claim GPU execution on this host.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

APPROVE — deep re-review of 3ee87c0426bf02c0de57e0fcabea6ce57a0a2b9f against main/merge-base b9013dc6bb058ec74935a62ac3a35f57d13c2f98. No remaining blocking finding in this PR's standalone GPU-toolchain/delivery scope. Reviewed without subagents; isolated review worktree remained clean.

Design decision

PASS for GPU toolchain design v2 at the reviewed head, document blob a708387f2e648c99879bf827acb0498c0257c530. The design gate applies because the provider/compatibility contract crosses native builds, Go test consumers, and delivery. The design was considered separately from implementation details.

Accepted tradeoffs: one frozen Pixi provider for GPU builds, no extra manifest/provider framework, CPU-only builds remain independent, NVIDIA drivers remain host-owned, and combined MO/Sirius uses one Sirius mo prefix. Synchronizing shared direct constraints and letting Pixi resolve the standalone MO graph is preferable to copying/subsetting Sirius's multi-environment lock; it deliberately does not promise identical standalone transitive locks. Legacy system-CUDA/Conda GPU build commands must migrate. Combined bridge enforcement and GPU coexistence execution remain acceptance gates for the bridge PR, not claims made by this prerequisite. No material implementation deviation found.

Coverage and historical closure

Closure Review result
Make/CGo/test consumers, activated prefix and lock CPU isolation, explicit compiler ownership, missing/wrong activation, missing inputs, link-only stubs, and clean-vs-build behavior checked. The superseded optional-manifest selector/fallback implementation is gone.
Native provenance and reuse Lock digest now participates in common provenance: same-prefix compiler/sysroot upgrades rebuild thirdparties and CGo. Accelerator-only flag changes retain the narrower rebuild. Failure/interruption and subsequent-generation checks passed.
Standalone lock and upgrade helper YAML conversion ambiguity removed; documented helper validates the Sirius lock, detects constraint drift, preserves MO-only dependencies, and stops for an explicit CUDA virtual-platform change. This addresses the upgrade-maintenance request without introducing another resolver.
GPU runtime delivery Shared staging resolves cross-directory CUDA aliases, accepts identical bytes, rejects conflicting basenames, dangling/out-of-prefix links, driver/stub libraries, and nonempty output. Both final recipes package the fatbin/dictionary and equivalent runtime stages; dev also retains an explicit development target.
CI/docs/ownership New contracts selected in CI; CPU native builds and active UT/BVT/SCA checks pass at this head. Requested CUDA/cuVS CODEOWNERS added.

The previous blocking delivery-evidence gap is closed by the author's exact-head image verification: both GPU Dockerfiles built with rootless Podman on linux/amd64 and both final-image audits passed over 333 ELF files without the Pixi build prefix, dangling links, packaged driver/stubs, or unresolved user-space dependencies. I inspected the corrected recipes and audit; this is reused author evidence, not a claim that I rebuilt those images locally. The ordinary Docker CI job alone was not used as GPU-image evidence.

All three review threads are resolved, and their underlying technical requests were checked rather than relying on the resolved flag. The two prior reproduced defects (CUDA symlink staging and same-prefix stale thirdparties) have concrete fixes and passing regressions. The upgrade helper addresses @cpegeric's request; only that reviewer can replace their outstanding formal CHANGES_REQUESTED decision. This approval does not waive it.

Validation and QA challenge

Locally passed at the reviewed head:

  • GPU provider contracts: 6 tests; Sirius synchronization helper: 5 tests; runtime staging/image-recipe contracts: 9 tests.
  • Eight additional independent boundary probes: missing lock in both consumers; command-line compiler substitution; mixed clean+build without activation; CPU with broken Pixi variables; empty staging roots; direct NVML-driver filename; identical basename duplicates; and an alias colliding with a different canonical library. All passed with explicit exit-status/content oracles.
  • mo-native-provenance-test, mo-native-build-contract-test, mo-cgo-test-tags-test, and mo-cgo-test-worktree-artifacts-test: all completed successfully.
  • Shell syntax and range whitespace checks passed.

Resource/state review is confined to build generations and staging: incomplete output fails the build, Docker layers are not published on a failed RUN, staging refuses dirty destinations, and provenance rejects incomplete/stale generations. No new server goroutine, queue, retry, SQL execution branch, catalog format, or tenant boundary is introduced, so server race/SQL benchmark gates are not inferred from this build-tooling change.

Performance and residual limits

No SQL throughput/latency improvement is established. Full native rebuild on a GPU lock change is an intentional correctness cost; unchanged generations and accelerator-only changes retain their tested reuse behavior. The reported final image size is 2,674,027,261 bytes, but a percentage reduction versus a historical image is not a controlled same-base benchmark. Packaging still conservatively includes the selected library roots rather than claiming a minimal dependency set.

Real GPU execution and combined cuVS/Sirius coexistence were not performed in this review and are not implied by loader closure. Non-blocking follow-up: consolidate the PR body's stale “no GPU image was built”/old pending-CI statements with the latest evidence, and consider an automated GPU-image build+audit lane so future recipe changes do not rely on a manual delivery check.

@aunjgr

aunjgr commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@cpegeric Following up on the request for a Sirius-to-MO Pixi-lock upgrade tool: #29254 now includes optools/gpu/sync_sirius_mo.py (added at 3556d12). It checks the Sirius mo lock, synchronizes the shared direct CUDA/cuVS/compiler constraints into the standalone MO manifest, and asks Pixi to re-resolve MO's own smaller lock. It deliberately does not copy or slice Sirius's multi-environment lock, which also contains packages and environments MO does not use. The helper has five focused contract tests and the upgrade procedure is in optools/gpu/README.md.

At head 3ee87c0, required MO CI and both final GPU image audits passed. Sirius #22 is merged at 6adc9c0; the combined same-prefix bridge remains a separate draft. Could you re-review the current #29254 contract and replace the outstanding formal change request if it addresses your concern?

@mergify

mergify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-28 13:14 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-28 13:37 UTC · at 84bf16d9dcaed09d635517e18df8c91c879aa70d

This pull request spent 22 minutes 4 seconds in the queue, with no time running CI.

Reason

Pull request #29254 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch had an error being deployed

1 failed deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Improvements or additions to documentation kind/enhancement kind/test-ci size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants