diff --git a/.github/workflows/gpu-engine.yml b/.github/workflows/gpu-engine.yml new file mode 100644 index 00000000..2da78357 --- /dev/null +++ b/.github/workflows/gpu-engine.yml @@ -0,0 +1,113 @@ +name: GPU engine from CUDA++ + +# Builds aien-serve-http with the GB10 engine (libomega_gpu.a) from aien-dev/CUDApp at cudapp.lock, on an arm64 +# runner. CUDA++ is the source of truth for the GPU stack (P0.4). The binary and its identity are uploaded so the +# chip gate on the GB10 (identical tokens on the golden prompts) runs on exactly what CI built. +# The cutover-reference job builds the same tree against the omega-mv commit the live server was built from +# (6de999da); it exists only for the cutover gate and is removed with omega-mv's GPU sources. +on: + pull_request: + paths: + - cudapp.lock + - native-artifacts.lock + - crates/aien-omega-*/** + - crates/aien-abi-conformance/** + - .github/workflows/gpu-engine.yml + push: + branches: [main] + paths: + - cudapp.lock + workflow_dispatch: + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: never + CUTOVER_OMEGA: 6de999da86efc6edd9c2554a87ee31f7fa9215ac + +jobs: + cudapp: + name: aien-serve-http (CUDA++ at cudapp.lock) + runs-on: ubuntu-24.04-arm + timeout-minutes: 90 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - name: Read cudapp.lock + id: pin + run: echo "sha=$(tr -d '[:space:]' < cudapp.lock)" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + repository: aien-dev/CUDApp + ref: ${{ steps.pin.outputs.sha }} + path: cudapp + persist-credentials: false + - name: Build + run: | + export AIEN_CUDAPP_DIR="$GITHUB_WORKSPACE/cudapp" CARGO_TARGET_DIR="$GITHUB_WORKSPACE/target" + cargo build --release --locked -p aien-serve-http + - name: Identity + run: | + mkdir -p out + cp target/release/aien-serve-http out/ + lib=$(find target/release/build -path '*cudapp-build/libomega_gpu.a' | head -1) + cp "$lib" out/ + { + echo "sc $GITHUB_SHA" + echo "cudapp ${{ steps.pin.outputs.sha }}" + echo "cc $(cc --version | head -1)" + echo "rustc $(rustc --version)" + } > out/BUILD.txt + (cd out && sha256sum aien-serve-http libomega_gpu.a | tee SHA256SUMS) + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: serve-cudapp-${{ github.sha }} + path: out/ + + cutover-reference: + name: aien-serve-http (cutover reference, omega-mv 6de999da) + runs-on: ubuntu-24.04-arm + timeout-minutes: 90 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + repository: aien-dev/omega-mv + ref: ${{ env.CUTOVER_OMEGA }} + path: omega + persist-credentials: false + - name: Read omega's physics.lock + id: phys + run: echo "sha=$(tr -d '[:space:]' < omega/physics.lock)" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + repository: aien-dev/physics-mv + ref: ${{ steps.phys.outputs.sha }} + path: physics + persist-credentials: false + - name: Build omega-mv libomega_gpu.a + run: make -C omega -j"$(nproc)" OUT_DIR="$GITHUB_WORKSPACE/omega-build" PHYSICS_DIR="$GITHUB_WORKSPACE/physics" "$GITHUB_WORKSPACE/omega-build/libomega_gpu.a" + - name: Build + run: | + export AIEN_OMEGA_GPU_LIB="$GITHUB_WORKSPACE/omega-build/libomega_gpu.a" CARGO_TARGET_DIR="$GITHUB_WORKSPACE/target" + export AIEN_OMEGA_GPU_LIB_SHA256=$(sha256sum "$AIEN_OMEGA_GPU_LIB" | cut -d' ' -f1) + cargo build --release --locked -p aien-serve-http + - name: Identity + run: | + mkdir -p out + cp target/release/aien-serve-http omega-build/libomega_gpu.a out/ + { + echo "sc $GITHUB_SHA" + echo "omega-mv $CUTOVER_OMEGA physics ${{ steps.phys.outputs.sha }}" + echo "cc $(cc --version | head -1)" + echo "rustc $(rustc --version)" + } > out/BUILD.txt + (cd out && sha256sum aien-serve-http libomega_gpu.a | tee SHA256SUMS) + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: serve-omega-${{ github.sha }} + path: out/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 672c1cdf..2a09dc2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,17 +45,29 @@ jobs: rustup toolchain install "$(sed -n 's/^channel *= *"\(.*\)"/\1/p' rust-toolchain.toml)" --profile minimal rustc --version - - name: Release gate (candidate named, omega.lock and Cargo.lock pins equal the candidate's) + - name: Release gate (candidate named, omega.lock, cudapp.lock and Cargo.lock pins equal the candidate's) id: gate continue-on-error: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} run: scripts/check-release-candidate.sh - - name: Read pins (omega.lock, then omega physics.lock) + - name: Read pins (omega.lock and cudapp.lock, then omega physics.lock) id: pins - run: echo "omega=$(tr -d '[:space:]' < omega.lock)" >> "$GITHUB_OUTPUT" + run: | + echo "omega=$(tr -d '[:space:]' < omega.lock)" >> "$GITHUB_OUTPUT" + echo "cudapp=$(tr -d '[:space:]' < cudapp.lock)" >> "$GITHUB_OUTPUT" # The native engine is linked only on the candidate target (linux aarch64, the GB10 host class). # Other targets build the CPU stub, are labelled as such in the release notes, and are not the candidate. + # The GPU engine (libomega_gpu.a) is built from CUDApp at cudapp.lock; omega supplies the composition library. + - name: Checkout CUDApp at cudapp.lock + if: matrix.native_engine + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + repository: aien-dev/CUDApp + ref: ${{ steps.pins.outputs.cudapp }} + path: cudapp + persist-credentials: false + - name: Checkout omega at omega.lock if: matrix.native_engine uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 @@ -97,7 +109,7 @@ jobs: run: | if command -v mojo >/dev/null 2>&1; then echo "mojo is on PATH; the candidate build runs without it" >&2; exit 1; fi if [ "${{ matrix.native_engine }}" = "true" ]; then - export AIEN_OMEGA_DIR="$GITHUB_WORKSPACE/omega" AIEN_PHYSICS_DIR="$GITHUB_WORKSPACE/physics" AIEN_AIENOS_LOCK_REPO="$GITHUB_WORKSPACE/aienos" + export AIEN_CUDAPP_DIR="$GITHUB_WORKSPACE/cudapp" AIEN_OMEGA_COMPOSE_DIR="$GITHUB_WORKSPACE/omega" AIEN_PHYSICS_DIR="$GITHUB_WORKSPACE/physics" AIEN_AIENOS_LOCK_REPO="$GITHUB_WORKSPACE/aienos" fi rm -rf "$CARGO_HOME" cargo fetch --locked @@ -246,7 +258,7 @@ jobs: echo echo "## aien-cli digests (compare with the candidate manifest [executables] aien-cli-native-release)" echo - echo "Columns: sha256 of target/release/aien-cli, archive, whether the native engine (omega at omega.lock) is linked. Only the native_engine=true linux-aarch64 row is the candidate binary." + echo "Columns: sha256 of target/release/aien-cli, archive, whether the native engine (CUDApp at cudapp.lock, composition from omega at omega.lock) is linked. Only the native_engine=true linux-aarch64 row is the candidate binary." echo echo '```' cat release-artifacts/aien-cli-digests.txt diff --git a/CONTEXT.md b/CONTEXT.md index 29314e15..7bc78263 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -22,7 +22,7 @@ _Avoid_: task, ticket The state folder holding the desk key and composition state (`AIEN_COMPOSE_DIR`, else under `AIEN_RUNTIME_STATE_DIR`, else XDG state, else `~/.local/state/aien-runtime/compose`). **Candidate**: -The release candidate this tree may be released as, named in `release/candidate.toml` with its model digests and source pins. `omega.lock` pins the omega commit that is linked. Changed only with aien-architecture's candidate manifest. +The release candidate this tree may be released as, named in `release/candidate.toml` with its model digests and source pins. `omega.lock` pins the omega commit whose composition library is linked; `cudapp.lock` pins the CUDApp commit the GPU engine is built from. Changed only with aien-architecture's candidate manifest. **Generation controller**: The one module that runs a generation for any model: it keeps the sequence ledger (history and position), reuses a prefix, rewinds, exports and restores the KV cache, picks each token, applies constraints, stops and streams. Written once; drives a forward pass through the `ForwardPass` trait (ADR 0004). Planned code: `aien-inference-abi`, type `GenerationController`. @@ -55,7 +55,7 @@ Runtime and inference - `aien-cli`: the `aien` command line and terminal agent harness. - `aien-inference-abi`, `aien-abi-core`, `aien-inference-runtime`, `aien-inference-service`: inference ABI, backend trait, weights loader, service protocols. - `aien-kv-cache`, `aien-scheduler`: paged KV cache and continuous-batching scheduler. -- `aien-omega-gpu`, `aien-omega-compose`: bindings to the omega GPU matmul engine and omega composition (pinned by `omega.lock`). +- `aien-omega-gpu` (and the other `aien-omega-*` GPU crates): bindings to the Omega GPU engine built from aien-dev/CUDApp (pinned by `cudapp.lock`). `aien-omega-compose`: binding to omega composition (pinned by `omega.lock`). - `aien-platform`, `aien-platform-linux`: platform ABI and the Linux / GB10 driver cell. Identity, memory, evidence diff --git a/README.md b/README.md index 63ae3a03..d8b8a74e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Rust workspace of the AIEN host runtime and its verification tooling, runnin What lives here: - **Host runtime.** The `aien` command line and the single-process runtime daemon (`crates/aien-cli`, `crates/aien-runtime`): model loading, the inference ABI (`crates/aien-inference-abi`), a unified-memory paged KV cache with copy-on-write branching (`crates/aien-kv-cache`, persistent form in `crates/aien-kv-store`), a continuous-batching scheduler with chunked prefill (`crates/aien-scheduler`), and an OpenAI-compatible HTTP door (`crates/aien-serve-http`). -- **GPU through our own kernels.** The `crates/aien-omega-*` crates bind the Omega GPU engine from the [omega](https://github.com/aien-spark/omega) repository, pinned by `omega.lock`: matmul, bf16 and FP8 GEMV, MoE routing, prefill and decode attention, and the one-command-list decode step for Qwen3-30B-A3B. No CUDA toolkit anywhere. +- **GPU through our own kernels.** The `crates/aien-omega-*` GPU crates bind the Omega GPU engine from the [CUDApp](https://github.com/aien-dev/CUDApp) repository, pinned by `cudapp.lock` (the composition library still comes from omega, pinned by `omega.lock`): matmul, bf16 and FP8 GEMV, MoE routing, prefill and decode attention, and the one-command-list decode step for Qwen3-30B-A3B. No CUDA toolkit anywhere. - **The judge.** `tools/aien-test` and `tools/aien-local-ci` are the AIEN verification pipeline ([ADR 0033](https://github.com/aien-spark/aien-architecture/blob/main/docs/adr/0033-aien-verification-pipeline.md)): gate manifests, verdicts, immutable evidence receipts and signed bundles. Every pull request in every AIEN repository is judged on the Spark by this code before it merges; GitHub-hosted runners only check the signed bundle. - **Releases.** `install.sh`, the release scripts and `docs/release/` build, sign, verify and install AIEN; `crates/aien-verify` and `crates/aien-campaign-verifier` check runs and evidence campaigns without linking the code under test. - **Identity and agents.** ALLEN, the persistent cognitive entity boundary ([ADR 0035](https://github.com/aien-spark/aien-architecture/blob/main/docs/adr/0035-persistent-cognitive-entity-boundary-allen.md)) in `crates/aien-allen*`; the agent harness, MCP, capability and switchboard crates. diff --git a/crates/aien-abi-conformance/src/build.rs b/crates/aien-abi-conformance/src/build.rs index b542a5b1..96e51ea0 100644 --- a/crates/aien-abi-conformance/src/build.rs +++ b/crates/aien-abi-conformance/src/build.rs @@ -27,9 +27,9 @@ use std::path::{Path, PathBuf}; pub enum Link { /// no native library (every native call returns Unavailable) Stub, - /// built from an omega checkout at the commit `omega.lock` pins + /// built from a source checkout (omega or CUDApp) at the commit its lock file pins PinnedSource, - /// built from an omega checkout at a developer-override commit (not qualifiable) + /// built from a source checkout at a developer-override commit (not qualifiable) DevOverride, /// a prebuilt archive given by path and expected digest (not qualifiable) Prebuilt, diff --git a/crates/aien-cli/tests/allen_concurrency_test.rs b/crates/aien-cli/tests/allen_concurrency_test.rs index d3d47bbb..c18c62ca 100644 --- a/crates/aien-cli/tests/allen_concurrency_test.rs +++ b/crates/aien-cli/tests/allen_concurrency_test.rs @@ -43,7 +43,7 @@ //! build the recovery matrix uses); run: //! //! ```text -//! env -u AIEN_OMEGA_DIR AIEN_OMEGA_COMPOSE_LIB= CARGO_TARGET_DIR= \ +//! env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR AIEN_OMEGA_COMPOSE_LIB= CARGO_TARGET_DIR= \ //! cargo test -p aien-cli --test allen_concurrency_test -- --ignored --nocapture //! ``` #[path = "../../aien-allen/tests/support/mod.rs"] @@ -133,6 +133,7 @@ impl Rig { .env("AIEN_REQUIRE_CHECKPOINT", "0"); for k in [ "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", "AIEN_OMEGA_GPU_LIB", "AIEN_REQUIRE_BLACKWELL", "AIEN_GPU_BACKEND", diff --git a/crates/aien-cli/tests/compose_memory_recall_test.rs b/crates/aien-cli/tests/compose_memory_recall_test.rs index a9af45ab..a4dc701b 100644 --- a/crates/aien-cli/tests/compose_memory_recall_test.rs +++ b/crates/aien-cli/tests/compose_memory_recall_test.rs @@ -26,7 +26,7 @@ //! No model is needed. Host CPU only. Needs a compose-linked `aien-cli`: //! //! ```text -//! env -u AIEN_OMEGA_DIR AIEN_OMEGA_COMPOSE_LIB= CARGO_TARGET_DIR= \ +//! env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR AIEN_OMEGA_COMPOSE_LIB= CARGO_TARGET_DIR= \ //! cargo test -p aien-cli --test compose_memory_recall_test -- --ignored --nocapture //! ``` #[path = "../../aien-allen/tests/support/mod.rs"] @@ -95,6 +95,7 @@ impl Rig { .env("AIEN_REQUIRE_CHECKPOINT", "0"); for k in [ "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", "AIEN_OMEGA_GPU_LIB", "AIEN_REQUIRE_BLACKWELL", "AIEN_GPU_BACKEND", diff --git a/crates/aien-cli/tests/desk_required_startup_test.rs b/crates/aien-cli/tests/desk_required_startup_test.rs index b7afe767..7c8d4d47 100644 --- a/crates/aien-cli/tests/desk_required_startup_test.rs +++ b/crates/aien-cli/tests/desk_required_startup_test.rs @@ -74,6 +74,7 @@ impl Rig { .env("AIEN_REQUIRE_CHECKPOINT", "0"); for k in [ "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", "AIEN_OMEGA_GPU_LIB", "AIEN_REQUIRE_BLACKWELL", "AIEN_GPU_BACKEND", diff --git a/crates/aien-cli/tests/provenance_link_live_test.rs b/crates/aien-cli/tests/provenance_link_live_test.rs index d870361d..e3395325 100644 --- a/crates/aien-cli/tests/provenance_link_live_test.rs +++ b/crates/aien-cli/tests/provenance_link_live_test.rs @@ -72,6 +72,7 @@ impl Rig { .env("AIEN_REQUIRE_CHECKPOINT", "1"); for k in [ "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", "AIEN_OMEGA_GPU_LIB", "AIEN_REQUIRE_BLACKWELL", "AIEN_GPU_BACKEND", diff --git a/crates/aien-cli/tests/recovery_matrix_test.rs b/crates/aien-cli/tests/recovery_matrix_test.rs index d3bd4664..862aab47 100644 --- a/crates/aien-cli/tests/recovery_matrix_test.rs +++ b/crates/aien-cli/tests/recovery_matrix_test.rs @@ -192,6 +192,7 @@ impl Rig { .env("AIEN_REQUIRE_CHECKPOINT", "0"); for k in [ "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", "AIEN_OMEGA_GPU_LIB", "AIEN_REQUIRE_BLACKWELL", "AIEN_GPU_BACKEND", diff --git a/crates/aien-inference-abi/src/qwen3_moe_omega.rs b/crates/aien-inference-abi/src/qwen3_moe_omega.rs index 1f5b048b..c2772217 100644 --- a/crates/aien-inference-abi/src/qwen3_moe_omega.rs +++ b/crates/aien-inference-abi/src/qwen3_moe_omega.rs @@ -55,7 +55,7 @@ pub mod kvio; /// Column tile of the engine's tile-major B layout: every expert window must start on one. pub const WINDOW_TILE: usize = aien_omega_moe::TILE_N; -/// Engine limits for one resident tensor (`omega_blackwell_matmul.h` at omega.lock). +/// Engine limits for one resident tensor (`omega_blackwell_matmul.h` in CUDApp at cudapp.lock). pub const MAX_RESIDENT_K: usize = 16384; pub const MAX_RESIDENT_N: usize = 262144; @@ -3857,7 +3857,7 @@ impl Qwen3MoeOmegaEngine { progress: &mut dyn FnMut(&str), ) -> Result<(Self, LoadReport), String> { if !aien_omega_gpu::is_native() { - return Err("this binary carries the CPU stub of the Omega engine (build with AIEN_OMEGA_DIR or AIEN_OMEGA_GPU_LIB)".into()); + return Err("this binary carries the CPU stub of the Omega engine (build with AIEN_CUDAPP_DIR or AIEN_OMEGA_GPU_LIB)".into()); } let (weights, report) = load_qwen3_moe_omega_paths(dir, &OmegaModelUploader, format, paths, progress)?; diff --git a/crates/aien-inference-abi/src/resident.rs b/crates/aien-inference-abi/src/resident.rs index 36afd39a..b8b19622 100644 --- a/crates/aien-inference-abi/src/resident.rs +++ b/crates/aien-inference-abi/src/resident.rs @@ -141,9 +141,9 @@ impl std::ops::Deref for MatrixWeight { } } -/// What omega's `omega_gpu_tensor_upload_f32` would store for the bf16 pattern `bits` after the -/// loader widened it to f32: its f32-to-bf16 step is `(__bf16)f` (src/omega_blackwell_matmul.c:98 -/// at omega.lock), which rounds to nearest even and sets the quiet bit of a NaN. Widening a bf16 +/// What the engine's `omega_gpu_tensor_upload_f32` would store for the bf16 pattern `bits` after the +/// loader widened it to f32: its f32-to-bf16 step is `(__bf16)f` (src/omega_blackwell_matmul.c:103 +/// in CUDApp at cudapp.lock), which rounds to nearest even and sets the quiet bit of a NaN. Widening a bf16 /// is exact, so every pattern comes back unchanged except the 126 signaling NaNs (exponent all /// ones, quiet bit clear, mantissa non-zero), which come back with the quiet bit set. Checked /// against the compiler's own cast for all 65536 patterns on this aarch64 host (see the test). diff --git a/crates/aien-inference-abi/tests/omega_backend_parity.rs b/crates/aien-inference-abi/tests/omega_backend_parity.rs index 8e4515a8..1140b8ef 100644 --- a/crates/aien-inference-abi/tests/omega_backend_parity.rs +++ b/crates/aien-inference-abi/tests/omega_backend_parity.rs @@ -18,7 +18,7 @@ //! Host test (runs everywhere, stub-aware): in a stub build the backend must //! report itself unavailable. Chip test (`#[ignore]`, run through the heavy //! queue with a native build): -//! AIEN_OMEGA_DIR=... AIEN_PHYSICS_DIR=... cargo test -p aien-inference-abi --release \ +//! AIEN_CUDAPP_DIR=... cargo test -p aien-inference-abi --release \ //! --test omega_backend_parity -- --ignored --nocapture //! //! Error metric: |chip - ref| divided by sum_i |x_i * w_i| (the accumulation diff --git a/crates/aien-omega-bf16/build.rs b/crates/aien-omega-bf16/build.rs index 56a8f7e2..4733ed4f 100644 --- a/crates/aien-omega-bf16/build.rs +++ b/crates/aien-omega-bf16/build.rs @@ -21,7 +21,8 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds `omega_gpu_bf16_gemv_f32` defined //! in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_bf16_gemv_api.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_bf16_gemv_api.h`. //! * otherwise: stub (every call returns `Unavailable`). //! //! `cfg(has_omega_bf16)` is set only when native. A stub never fails the build: the engine @@ -35,7 +36,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -51,13 +52,13 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_bf16_gemv_api.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { println!("cargo:rustc-cfg=has_omega_bf16"); } else { - println!("cargo:warning=aien-omega-bf16: {dir} has no src/omega_gpu_bf16_gemv_api.h (omega before OWN-30B cut 8); the bf16 lm_head GEMV is stubbed"); + println!("cargo:warning=aien-omega-bf16: {dir} has no src/omega_gpu_bf16_gemv_api.h; the bf16 lm_head GEMV is stubbed"); } } } diff --git a/crates/aien-omega-compose/README.md b/crates/aien-omega-compose/README.md index cbd7a8fb..f9cda4d2 100644 --- a/crates/aien-omega-compose/README.md +++ b/crates/aien-omega-compose/README.md @@ -7,11 +7,12 @@ in omega `mk/rx_compose_lib.mk`). NEXT-PHASE-1 cut 1b. ## Building against omega The library is built from an omega checkout whose HEAD must equal `omega.lock` -(the same pin aien-omega-gpu uses; since NEXT-PHASE-1 it is omega 62b6a28, which -contains `librx_compose.a`). Default build, no override: +(since NEXT-PHASE-1 the pin contains `librx_compose.a`). The GPU engine +(aien-omega-gpu) no longer builds from omega: it uses CUDApp at `cudapp.lock` +via `AIEN_CUDAPP_DIR`. Default build, no override: ```text -AIEN_OMEGA_DIR= +AIEN_OMEGA_COMPOSE_DIR= AIEN_PHYSICS_DIR= AIEN_AIENOS_LOCK_REPO= cargo test -p aien-omega-compose @@ -19,7 +20,7 @@ cargo test -p aien-omega-compose | Variable | Meaning | |----------|---------| -| `AIEN_OMEGA_DIR` | omega checkout at `omega.lock`; shared with aien-omega-gpu | +| `AIEN_OMEGA_DIR` | omega checkout at `omega.lock`; fallback when `AIEN_OMEGA_COMPOSE_DIR` is unset | | `AIEN_OMEGA_COMPOSE_DIR` | a different omega checkout for this crate only (takes precedence over `AIEN_OMEGA_DIR`) | | `AIEN_OMEGA_COMPOSE_SHA` | **developer override**: full 40-hex sha the checkout must be at instead of `omega.lock`, for building against an unmerged omega branch. Prints a build warning; never used for a release build or a campaign receipt. | | `AIEN_PHYSICS_DIR` | physics checkout at omega's `physics.lock` (default `/../physics`) | @@ -28,8 +29,7 @@ cargo test -p aien-omega-compose | `AIEN_FORCE_CPU_STUB=1` | stub: every call returns `ComposeError::Unavailable` (build time only; for a CPU-only run use `AIEN_BACKEND=cpu`, which makes the daemon refuse a GPU build) | With no checkout and no library set the crate builds the stub and prints a warning. -Use `AIEN_OMEGA_COMPOSE_DIR` together with `AIEN_OMEGA_COMPOSE_SHA`, so an override -never changes the checkout aien-omega-gpu checks against `omega.lock`. +Use `AIEN_OMEGA_COMPOSE_DIR` together with `AIEN_OMEGA_COMPOSE_SHA` for an override. The integration test (`tests/compose.rs`) is ignored in a stub build. diff --git a/crates/aien-omega-compose/build.rs b/crates/aien-omega-compose/build.rs index 89c269c4..4c17f14f 100644 --- a/crates/aien-omega-compose/build.rs +++ b/crates/aien-omega-compose/build.rs @@ -21,8 +21,8 @@ //! 2. `AIEN_OMEGA_COMPOSE_LIB=` -> link that prebuilt archive; `AIEN_OMEGA_COMPOSE_LIB_SHA256` //! must name its sha256 (checked) and it must define every function in the ABI manifest. //! A development override: its identity says `prebuilt` and it never qualifies. -//! 3. `AIEN_OMEGA_COMPOSE_DIR=`, else `AIEN_OMEGA_DIR` (the checkout -//! aien-omega-gpu builds from) -> its HEAD must equal omega.lock, then +//! 3. `AIEN_OMEGA_COMPOSE_DIR=`, else `AIEN_OMEGA_DIR` (fallback) +//! -> its HEAD must equal omega.lock, then //! `make /librx_compose.a` runs in it. `AIEN_OMEGA_COMPOSE_SHA=<40-hex>` //! replaces the expected sha: a documented developer override for building //! against an unmerged omega branch, never used for a release or a receipt. `AIEN_PHYSICS_DIR` (default `/../physics`) is passed @@ -30,8 +30,8 @@ //! omega's own lock checks still run. //! 4. otherwise -> stub, with a build warning. //! -//! `AIEN_OMEGA_COMPOSE_DIR` exists so a developer override never touches the -//! checkout aien-omega-gpu checks against omega.lock. +//! `AIEN_OMEGA_COMPOSE_DIR` is the checkout variable for this crate only; the GPU +//! engine (aien-omega-gpu) builds from CUDApp via `AIEN_CUDAPP_DIR`, not from omega. //! `cfg(has_omega_compose)` is set only when the real library is linked. //! //! Before linking a checkout build, `aien_abi_conformance::build::qualify_built` checks the diff --git a/crates/aien-omega-dattn/build.rs b/crates/aien-omega-dattn/build.rs index dbbafc67..d04f8ed9 100644 --- a/crates/aien-omega-dattn/build.rs +++ b/crates/aien-omega-dattn/build.rs @@ -21,7 +21,8 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds `omega_gpu_decode_attn` defined //! in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_decode_attn_api.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_decode_attn_api.h`. //! * otherwise: stub (every call returns `Unavailable`). //! //! `cfg(has_omega_dattn)` is set only when native. A stub never fails the build: the engine @@ -35,7 +36,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -51,13 +52,13 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_decode_attn_api.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { println!("cargo:rustc-cfg=has_omega_dattn"); } else { - println!("cargo:warning=aien-omega-dattn: {dir} has no src/omega_gpu_decode_attn_api.h (omega before OWN-30B cut 8); fused attention is stubbed"); + println!("cargo:warning=aien-omega-dattn: {dir} has no src/omega_gpu_decode_attn_api.h; fused attention is stubbed"); } } } diff --git a/crates/aien-omega-dgraph/build.rs b/crates/aien-omega-dgraph/build.rs index 67b98765..f3be36f4 100644 --- a/crates/aien-omega-dgraph/build.rs +++ b/crates/aien-omega-dgraph/build.rs @@ -21,7 +21,8 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds `omega_gpu_decode_graph_create` //! defined in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_decode_graph.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_decode_graph.h`. //! * otherwise: stub (every call returns `Unavailable`). //! //! `cfg(has_omega_dgraph)` is set only when native. A stub never fails the build: the engine @@ -34,7 +35,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -50,13 +51,13 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_decode_graph.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { println!("cargo:rustc-cfg=has_omega_dgraph"); } else { - println!("cargo:warning=aien-omega-dgraph: {dir} has no src/omega_gpu_decode_graph.h (omega before OWN-30B L2 cut 2); the one-list decode is stubbed"); + println!("cargo:warning=aien-omega-dgraph: {dir} has no src/omega_gpu_decode_graph.h; the one-list decode is stubbed"); } } } diff --git a/crates/aien-omega-fp8/build.rs b/crates/aien-omega-fp8/build.rs index af9f91d4..fee134c3 100644 --- a/crates/aien-omega-fp8/build.rs +++ b/crates/aien-omega-fp8/build.rs @@ -20,7 +20,8 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds //! `omega_gpu_fp8_gemv_grouped_f32` defined in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_fp8_api.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_fp8_api.h`. //! //! `cfg(has_omega_fp8gemm)` (the prefill grouped GEMM) is set when the archive defines //! `omega_gpu_fp8gemm_f32` or the checkout has `src/omega_gpu_fp8gemm_api.h`. @@ -41,7 +42,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -68,7 +69,7 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_fp8_api.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { @@ -91,7 +92,7 @@ fn main() { println!("cargo:rustc-cfg=has_omega_fp8_grouped_rule"); } } else { - println!("cargo:warning=aien-omega-fp8: {dir} has no src/omega_gpu_fp8_api.h (omega before OWN-30B cut 5); FP8 calls are stubbed"); + println!("cargo:warning=aien-omega-fp8: {dir} has no src/omega_gpu_fp8_api.h; FP8 calls are stubbed"); } } } diff --git a/crates/aien-omega-gpu/Cargo.toml b/crates/aien-omega-gpu/Cargo.toml index 3437059d..e43f0b31 100644 --- a/crates/aien-omega-gpu/Cargo.toml +++ b/crates/aien-omega-gpu/Cargo.toml @@ -3,7 +3,7 @@ name = "aien-omega-gpu" version = "0.1.0" edition = "2021" authors = ["Drake Stapleton "] -description = "FFI to the native (no CUDA) Omega GPU matmul engine, pinned by omega.lock" +description = "FFI to the native (no CUDA) Omega GPU matmul engine, built from CUDApp pinned by cudapp.lock" license.workspace = true build = "build.rs" diff --git a/crates/aien-omega-gpu/abi/omega_gpu.manifest b/crates/aien-omega-gpu/abi/omega_gpu.manifest index 06a41cb3..3a3423bc 100644 --- a/crates/aien-omega-gpu/abi/omega_gpu.manifest +++ b/crates/aien-omega-gpu/abi/omega_gpu.manifest @@ -3,7 +3,7 @@ # (pinned C headers, compiled layout probe, archive symbols). # Format: aien-abi-conformance src/manifest.rs. Regenerate the fact lines from Rust with # AIEN_ABI_BLESS=1 cargo test -p aien-omega-gpu --test abi_manifest -# only together with the omega.lock change that makes the C side agree. +# only together with the cudapp.lock change that makes the C side agree. abi omega_gpu 1 header src/omega_gpu_matmul_api.h header src/omega_gpu_session.h diff --git a/crates/aien-omega-gpu/build.rs b/crates/aien-omega-gpu/build.rs index cb9053f7..1debc3c6 100644 --- a/crates/aien-omega-gpu/build.rs +++ b/crates/aien-omega-gpu/build.rs @@ -13,7 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Links `libomega_gpu.a` from the omega commit pinned in `omega.lock`. +//! Links `libomega_gpu.a` from the CUDA++ commit (aien-dev/CUDApp) pinned in `cudapp.lock`. +//! CUDA++ is the source of truth for the GPU stack; omega-mv's GPU sources are superseded. //! //! Offline by design: nothing is downloaded and no CUDA/nvcc is used. Order: //! 1. `AIEN_FORCE_CPU_STUB=1` -> stub (CI without the chip). BUILD-TIME ONLY: a binary already @@ -23,9 +24,9 @@ //! 2. `AIEN_OMEGA_GPU_LIB=` -> link that prebuilt archive; `AIEN_OMEGA_GPU_LIB_SHA256` must //! name its sha256 (checked) and it must define every function in the ABI manifest. A //! development override: its identity says `prebuilt` and it never qualifies. -//! 3. `AIEN_OMEGA_DIR=` -> its HEAD must equal omega.lock; built with -//! `make libomega_gpu` into OUT_DIR. `AIEN_PHYSICS_DIR` (default `/../physics`) -//! is passed as PHYSICS_DIR; omega's own physics.lock check still runs. +//! 3. `AIEN_CUDAPP_DIR=` -> its HEAD must equal cudapp.lock; built with +//! `make libomega_gpu.a` into OUT_DIR. CUDA++ carries the driver client (m16/, nvrm/) +//! in-tree, so the checkout itself is PHYSICS_DIR. //! 4. otherwise -> stub, with a build warning. //! //! `cfg(has_omega_gpu)` is set only when the real library is linked. @@ -45,13 +46,12 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", - "AIEN_PHYSICS_DIR", + "AIEN_CUDAPP_DIR", "AIEN_REQUIRE_NATIVE_LIBS", ] { println!("cargo:rerun-if-env-changed={v}"); } - let lock_path = Path::new(&env("CARGO_MANIFEST_DIR")).join("../../omega.lock"); + let lock_path = Path::new(&env("CARGO_MANIFEST_DIR")).join("../../cudapp.lock"); println!("cargo:rerun-if-changed={}", lock_path.display()); let pinned = std::fs::read_to_string(&lock_path) .unwrap_or_else(|e| panic!("cannot read {}: {e}", lock_path.display())) @@ -59,9 +59,9 @@ fn main() { .to_string(); assert!( pinned.len() == 40 && pinned.bytes().all(|b| b.is_ascii_hexdigit()), - "omega.lock must hold one full 40-hex sha" + "cudapp.lock must hold one full 40-hex sha" ); - println!("cargo:rustc-env=AIEN_OMEGA_PINNED_SHA={pinned}"); + println!("cargo:rustc-env=AIEN_CUDAPP_PINNED_SHA={pinned}"); let root = PathBuf::from(env("CARGO_MANIFEST_DIR")); let manifest = root.join("abi/omega_gpu.manifest"); @@ -90,15 +90,15 @@ fn main() { link(&lib); return; } - let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") else { + let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") else { // AIEN_REQUIRE_NATIVE_LIBS=1 (set by scripts/pins.sh env.sh) turns the silent // stub fallback into a build error: a release or receipt build must never // discover at run time that it carries the CPU stub (sovereign-core #92). assert!( std::env::var("AIEN_REQUIRE_NATIVE_LIBS").as_deref() != Ok("1"), - "aien-omega-gpu: AIEN_REQUIRE_NATIVE_LIBS=1 but neither AIEN_OMEGA_DIR nor AIEN_OMEGA_GPU_LIB is set (run scripts/pins.sh --gpu and source target/pins/env.sh)" + "aien-omega-gpu: AIEN_REQUIRE_NATIVE_LIBS=1 but neither AIEN_CUDAPP_DIR nor AIEN_OMEGA_GPU_LIB is set (run scripts/pins.sh --gpu and source target/pins/env.sh)" ); - println!("cargo:warning=aien-omega-gpu: no AIEN_OMEGA_DIR or AIEN_OMEGA_GPU_LIB, building the CPU stub"); + println!("cargo:warning=aien-omega-gpu: no AIEN_CUDAPP_DIR or AIEN_OMEGA_GPU_LIB, building the CPU stub"); build::Identity::stub(&pinned).emit(PREFIX); return; }; @@ -114,15 +114,13 @@ fn main() { .unwrap_or_default(); assert!( head == pinned, - "omega checkout {} is at '{head}', omega.lock pins {pinned}", + "CUDA++ checkout {} is at '{head}', cudapp.lock pins {pinned}", dir.display() ); - let physics = std::env::var("AIEN_PHYSICS_DIR") - .map(PathBuf::from) - .unwrap_or_else(|_| dir.join("../physics")); - let out = PathBuf::from(env("OUT_DIR")).join("omega-build"); + let physics = dir.clone(); + let out = PathBuf::from(env("OUT_DIR")).join("cudapp-build"); if build::fresh_out_dir(&out, &pinned) { - println!("cargo:warning=aien-omega-gpu: build dir was for another omega commit, rebuilt from clean"); + println!("cargo:warning=aien-omega-gpu: build dir was for another CUDA++ commit, rebuilt from clean"); } let status = Command::new("make") .current_dir(&dir) diff --git a/crates/aien-omega-gpu/src/ffi.rs b/crates/aien-omega-gpu/src/ffi.rs index 1732e80c..1d23213a 100644 --- a/crates/aien-omega-gpu/src/ffi.rs +++ b/crates/aien-omega-gpu/src/ffi.rs @@ -13,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Raw declarations, written by hand from omega `src/omega_gpu_matmul_api.h`, +//! Raw declarations, written by hand from CUDApp `src/omega_gpu_matmul_api.h`, //! `omega_gpu_session.h`, `omega_gpu_serving.h`, `omega_gpu_elementwise_api.h` and -//! `omega_gpu_attention_api.h` at the commit pinned in `omega.lock`. Nothing generated. +//! `omega_gpu_attention_api.h` at the commit pinned in `cudapp.lock`. Nothing generated. //! //! Hand-written, but not unchecked: every mirrored constant, struct and function is declared //! through the `aien-abi-conformance` macros, and `abi/omega_gpu.manifest` is the contract. diff --git a/crates/aien-omega-gpu/src/lib.rs b/crates/aien-omega-gpu/src/lib.rs index 7c2d1920..2d62d6f2 100644 --- a/crates/aien-omega-gpu/src/lib.rs +++ b/crates/aien-omega-gpu/src/lib.rs @@ -30,8 +30,8 @@ use std::fmt; pub use ffi::OmegaGpuMatmulInfo; -/// Omega commit this crate was built against (from `omega.lock`). -pub const PINNED_OMEGA_SHA: &str = env!("AIEN_OMEGA_PINNED_SHA"); +/// CUDA++ (aien-dev/CUDApp) commit this crate was built against (from `cudapp.lock`). +pub const PINNED_CUDAPP_SHA: &str = env!("AIEN_CUDAPP_PINNED_SHA"); /// True when the real native library is linked (not the stub). pub const fn is_native() -> bool { diff --git a/crates/aien-omega-gpu/tests/parity.rs b/crates/aien-omega-gpu/tests/parity.rs index 30cf5a54..ca101688 100644 --- a/crates/aien-omega-gpu/tests/parity.rs +++ b/crates/aien-omega-gpu/tests/parity.rs @@ -51,9 +51,9 @@ fn reference(m: usize, k: usize, n: usize, a: &[f32], b: &[f32]) -> Vec { #[test] fn lock_is_full_sha() { - assert_eq!(PINNED_OMEGA_SHA.len(), 40); - // The build reads omega.lock; the constant must be exactly that file's sha. - assert_eq!(PINNED_OMEGA_SHA, include_str!("../../../omega.lock").trim()); + assert_eq!(PINNED_CUDAPP_SHA.len(), 40); + // The build reads cudapp.lock; the constant must be exactly that file's sha. + assert_eq!(PINNED_CUDAPP_SHA, include_str!("../../../cudapp.lock").trim()); } #[test] @@ -103,7 +103,7 @@ fn native_refuses_bad_args_without_chip() { fn chip_parity_f32_and_bf16() { assert!( is_native(), - "build with AIEN_OMEGA_DIR to link the chip library" + "build with AIEN_CUDAPP_DIR to link the chip library" ); let shapes = [ (16, 16, 16), diff --git a/crates/aien-omega-moe/build.rs b/crates/aien-omega-moe/build.rs index 195c873b..594a1196 100644 --- a/crates/aien-omega-moe/build.rs +++ b/crates/aien-omega-moe/build.rs @@ -20,7 +20,8 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds //! `omega_gpu_matmul_resident_windows_f32` defined in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_moe_api.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_moe_api.h`. //! * otherwise: stub (every call returns `Unavailable`). //! //! `cfg(has_omega_moe)` is set only when native. A stub never fails the build: the whole-tensor @@ -33,7 +34,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -49,13 +50,13 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_moe_api.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { println!("cargo:rustc-cfg=has_omega_moe"); } else { - println!("cargo:warning=aien-omega-moe: {dir} has no src/omega_gpu_moe_api.h (omega before OWN-30B cut 2); window calls are stubbed"); + println!("cargo:warning=aien-omega-moe: {dir} has no src/omega_gpu_moe_api.h; window calls are stubbed"); } } } diff --git a/crates/aien-omega-pf/build.rs b/crates/aien-omega-pf/build.rs index f7523a43..772bc8fb 100644 --- a/crates/aien-omega-pf/build.rs +++ b/crates/aien-omega-pf/build.rs @@ -19,7 +19,7 @@ //! the extra symbols, so the decision mirrors its inputs: //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: `nm` decides per symbol. -//! * `AIEN_OMEGA_DIR=`: the headers decide (`src/omega_gpu_prefill.h`, +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): the headers decide (`src/omega_gpu_prefill.h`, //! `src/omega_gpu_prefill_attn_api.h`). //! //! `cfg(has_omega_pf)`: `omega_gpu_pf_qgemm` defined (quantiser, QMMA grouped GEMM, pf buffers). @@ -37,7 +37,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -72,7 +72,7 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let pf = Path::new(&dir).join("src/omega_gpu_prefill.h"); let pa = Path::new(&dir).join("src/omega_gpu_prefill_attn_api.h"); println!("cargo:rerun-if-changed={}", pf.display()); diff --git a/crates/aien-omega-q38/build.rs b/crates/aien-omega-q38/build.rs index 44cbac24..b1e2f0b8 100644 --- a/crates/aien-omega-q38/build.rs +++ b/crates/aien-omega-q38/build.rs @@ -21,12 +21,13 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds `omega_gpu_q38_graph_create` //! defined in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_q38_graph.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_q38_graph.h`. //! * otherwise: stub (every call returns `Unavailable`). //! //! `cfg(has_omega_q38_prefill)` is set when, in addition, the prefill entries are linked //! (`omega_gpu_gdn_prefill` and `omega_gpu_prefill_attn256`, omega#543 / #545; with -//! `AIEN_OMEGA_DIR`, the header `src/omega_gpu_prefill_attn256_api.h`). +//! `AIEN_CUDAPP_DIR`, the header `src/omega_gpu_prefill_attn256_api.h`). //! //! `cfg(has_omega_q38)` is set only when native. A stub never fails the build: the Qwen3.8 //! engine reports itself unavailable, and `is_native()` says which one a binary carries. @@ -40,7 +41,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -64,7 +65,7 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_q38_graph.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { @@ -79,7 +80,7 @@ fn main() { println!("cargo:rustc-cfg=has_omega_q38_prefill"); } } else { - println!("cargo:warning=aien-omega-q38: {dir} has no src/omega_gpu_q38_graph.h (omega before sc #642); the Qwen3.8 decode is stubbed"); + println!("cargo:warning=aien-omega-q38: {dir} has no src/omega_gpu_q38_graph.h; the Qwen3.8 decode is stubbed"); } } } diff --git a/crates/aien-omega-router/build.rs b/crates/aien-omega-router/build.rs index 14cfe61a..3e5f7e5c 100644 --- a/crates/aien-omega-router/build.rs +++ b/crates/aien-omega-router/build.rs @@ -21,7 +21,8 @@ //! * `AIEN_FORCE_CPU_STUB=1`: stub. //! * `AIEN_OMEGA_GPU_LIB=`: native when `nm` finds `omega_gpu_router` defined //! in that archive. -//! * `AIEN_OMEGA_DIR=`: native when the checkout has `src/omega_gpu_router_api.h`. +//! * `AIEN_CUDAPP_DIR=` (CUDApp at `cudapp.lock`): native when the checkout has +//! `src/omega_gpu_router_api.h`. //! * otherwise: stub (every call returns `Unavailable`). //! //! `cfg(has_omega_router)` is set only when native. A stub never fails the build: the engine @@ -35,7 +36,7 @@ fn main() { for v in [ "AIEN_FORCE_CPU_STUB", "AIEN_OMEGA_GPU_LIB", - "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -51,13 +52,13 @@ fn main() { } return; } - if let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") { + if let Ok(dir) = std::env::var("AIEN_CUDAPP_DIR") { let header = Path::new(&dir).join("src/omega_gpu_router_api.h"); println!("cargo:rerun-if-changed={}", header.display()); if header.is_file() { println!("cargo:rustc-cfg=has_omega_router"); } else { - println!("cargo:warning=aien-omega-router: {dir} has no src/omega_gpu_router_api.h (omega before OWN-30B cut 8); the device router is stubbed"); + println!("cargo:warning=aien-omega-router: {dir} has no src/omega_gpu_router_api.h; the device router is stubbed"); } } } diff --git a/crates/aien-runtime/tests/prefill_e2e2.gate b/crates/aien-runtime/tests/prefill_e2e2.gate index 1ba21854..e6aa6771 100644 --- a/crates/aien-runtime/tests/prefill_e2e2.gate +++ b/crates/aien-runtime/tests/prefill_e2e2.gate @@ -15,10 +15,11 @@ inputs: - tools/ # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at # run time, two campaign files compiled in by include_str!, and omega.lock - # through a build script. + # and cudapp.lock through build scripts. - docs/campaigns/c1/ - docs/campaigns/next-phase-1/ - omega.lock + - cudapp.lock run: exec: crates/aien-runtime/tests/prefill_e2e2_run.sh args: ["main"] diff --git a/crates/aien-runtime/tests/prefill_e2e2_m1.gate b/crates/aien-runtime/tests/prefill_e2e2_m1.gate index b8f5143f..4944521d 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m1.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m1.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m2.gate b/crates/aien-runtime/tests/prefill_e2e2_m2.gate index 2cd31637..a65f284d 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m2.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m2.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m3.gate b/crates/aien-runtime/tests/prefill_e2e2_m3.gate index ed93be23..e1734c0a 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m3.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m3.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m4.gate b/crates/aien-runtime/tests/prefill_e2e2_m4.gate index 14db7303..a02256c5 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m4.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m4.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m5.gate b/crates/aien-runtime/tests/prefill_e2e2_m5.gate index 53a96042..4c77f09a 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m5.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m5.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m6.gate b/crates/aien-runtime/tests/prefill_e2e2_m6.gate index 960126e5..21f07848 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m6.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m6.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m7.gate b/crates/aien-runtime/tests/prefill_e2e2_m7.gate index 715ad1f2..5f36c2a3 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m7.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m7.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-runtime/tests/prefill_e2e2_m8.gate b/crates/aien-runtime/tests/prefill_e2e2_m8.gate index a42b5c33..4908160c 100644 --- a/crates/aien-runtime/tests/prefill_e2e2_m8.gate +++ b/crates/aien-runtime/tests/prefill_e2e2_m8.gate @@ -14,9 +14,10 @@ inputs: - Cargo.toml - Cargo.lock # Read outside crates/ (aien-audit-inputs, L335): the C1 acceptance file at - # run time and omega.lock through a build script. + # run time, and omega.lock and cudapp.lock through build scripts. - docs/campaigns/c1/ - omega.lock + - cudapp.lock - crates/aien-abi-conformance/ - crates/aien-abi-core/ - crates/aien-allen/ diff --git a/crates/aien-serve-http/build.rs b/crates/aien-serve-http/build.rs index e4e23fb0..2aafcb4d 100644 --- a/crates/aien-serve-http/build.rs +++ b/crates/aien-serve-http/build.rs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Build identity of the omega door for the persistent KV engine identity (sc#505, ADR 0003 +//! Build identity of the GPU engine for the persistent KV engine identity (sc#505, ADR 0003 //! section 1.2.2). Embedded at build time, read by `kv_persist::OmegaBuild::linked()`: //! //! - `AIEN_SERVE_HTTP_GIT_COMMIT`: the commit this crate was built from (`AIEN_BUILD_COMMIT` @@ -21,7 +21,8 @@ //! - `AIEN_SERVE_HTTP_GIT_DIRTY`: `1` when `git status` showed modified tracked files at build //! time, `0` when clean (or `AIEN_BUILD_COMMIT` given), `unknown` without git. Re-checked //! when HEAD or the index moves, not on every unstaged edit. -//! - `AIEN_SERVE_HTTP_OMEGA_LOCK`: the omega commit `omega.lock` pins. +//! - `AIEN_SERVE_HTTP_CUDAPP_LOCK`: the CUDApp commit `cudapp.lock` pins (the source of +//! `libomega_gpu.a`). //! - `AIEN_SERVE_HTTP_GPU_RECORDED_SHA256`: the `libomega_gpu.a` sha256 `native-artifacts.lock` //! records for that commit and this target, or `unrecorded`. use std::path::{Path, PathBuf}; @@ -88,17 +89,17 @@ fn main() { println!("cargo:rustc-env=AIEN_SERVE_HTTP_GIT_COMMIT={commit}"); println!("cargo:rustc-env=AIEN_SERVE_HTTP_GIT_DIRTY={dirty}"); - let lock_path = root.join("omega.lock"); + let lock_path = root.join("cudapp.lock"); println!("cargo:rerun-if-changed={}", lock_path.display()); - let omega = std::fs::read_to_string(&lock_path) + let cudapp = std::fs::read_to_string(&lock_path) .map(|s| s.trim().to_string()) .unwrap_or_default(); - let omega = if omega.is_empty() { + let cudapp = if cudapp.is_empty() { "unknown".to_string() } else { - omega + cudapp }; - println!("cargo:rustc-env=AIEN_SERVE_HTTP_OMEGA_LOCK={omega}"); + println!("cargo:rustc-env=AIEN_SERVE_HTTP_CUDAPP_LOCK={cudapp}"); let artifacts = root.join("native-artifacts.lock"); println!("cargo:rerun-if-changed={}", artifacts.display()); @@ -109,7 +110,7 @@ fn main() { .filter(|l| !l.trim_start().starts_with('#')) .find_map(|l| { let f: Vec<&str> = l.split_whitespace().collect(); - (f.len() >= 4 && f[0] == "libomega_gpu.a" && f[1] == omega && f[2] == target) + (f.len() >= 4 && f[0] == "libomega_gpu.a" && f[1] == cudapp && f[2] == target) .then(|| f[3].to_string()) }) }) diff --git a/crates/aien-serve-http/src/kv_persist.rs b/crates/aien-serve-http/src/kv_persist.rs index e87812f2..35086947 100644 --- a/crates/aien-serve-http/src/kv_persist.rs +++ b/crates/aien-serve-http/src/kv_persist.rs @@ -38,7 +38,7 @@ //! //! The namespace binds the checkpoint digest, the model shape, the bf16 pool layout, the chunk //! size, the sharing namespace and the engine identity of ADR 1.2.2 built by -//! [`OmegaKvIdentity::new`]: weight format as loaded, the build (omega commit, linked +//! [`OmegaKvIdentity::new`]: weight format as loaded, the build (CUDApp commit, linked //! `libomega_gpu.a` sha256, this crate's commit), a rounding class, and an engine config digest //! over the MoE shape and every run switch that can move a K/V byte. //! @@ -94,10 +94,11 @@ pub const NUMERIC_ENV: &[&str] = &[ pub const NEUTRAL_ENV: &[&str] = &[ "AIEN_OMEGA_SPIN_US", "AIEN_OMEGA_DIR", + "AIEN_CUDAPP_DIR", "AIEN_OMEGA_GPU", "AIEN_OMEGA_GPU_LIB", "AIEN_OMEGA_GPU_LIB_SHA256", - "AIEN_OMEGA_PINNED_SHA", + "AIEN_CUDAPP_PINNED_SHA", "AIEN_OMEGA_COMPOSE", "AIEN_OMEGA_COMPOSE_DIR", "AIEN_OMEGA_COMPOSE_LIB", @@ -113,8 +114,8 @@ pub const MUTANT_ENV: &[&str] = &["OWN30B_DECODE_GRAPH_MUTANT"]; /// The build of the engine that writes the K/V. #[derive(Debug, Clone, PartialEq, Eq)] pub struct OmegaBuild { - /// The omega commit `omega.lock` pins. - pub omega_commit: String, + /// The CUDApp commit `cudapp.lock` pins (the source `libomega_gpu.a` is built from). + pub cudapp_commit: String, /// How `libomega_gpu.a` was linked (`pinned-source`, `dev-override`, `prebuilt`, `stub`). pub gpu_link: String, /// sha256 of the linked `libomega_gpu.a`. @@ -143,9 +144,9 @@ impl OmegaBuild { } else { "mismatch" }; - let pin = env!("AIEN_SERVE_HTTP_OMEGA_LOCK"); + let pin = env!("AIEN_SERVE_HTTP_CUDAPP_LOCK"); Self { - omega_commit: pin.to_string(), + cudapp_commit: pin.to_string(), // A pinned-source archive built from another commit than the pin is not the pin. gpu_link: if id.link == "pinned-source" && id.source_sha != pin { "pinned-source-other-commit".into() @@ -160,13 +161,13 @@ impl OmegaBuild { } } - /// `omega:+libomega_gpu:+sc:`. Refused when any part is unknown or + /// `cudapp:+libomega_gpu:+sc:`. Refused when any part is unknown or /// cannot be trusted to name the bytes that run (fail closed). pub fn build_id(&self) -> Result { let hex = |s: &str, n: usize| s.len() == n && s.bytes().all(|b| b.is_ascii_hexdigit()); if self.gpu_link != "pinned-source" { return Err(format!( - "libomega_gpu.a is linked as {:?}, not built from the omega.lock pin", + "libomega_gpu.a is linked as {:?}, not built from the cudapp.lock pin", self.gpu_link )); } @@ -179,10 +180,10 @@ impl OmegaBuild { self.gpu_digest )); } - if !hex(&self.omega_commit, 40) { + if !hex(&self.cudapp_commit, 40) { return Err(format!( - "omega.lock commit {:?} is not a 40-hex commit", - self.omega_commit + "cudapp.lock commit {:?} is not a 40-hex commit", + self.cudapp_commit )); } if !(self.sc_commit.len() >= 7 @@ -201,8 +202,8 @@ impl OmegaBuild { return Err("the linked libomega_gpu.a has no target".into()); } Ok(format!( - "omega:{}+libomega_gpu:{}+sc:{}", - self.omega_commit, self.gpu_archive_sha256, self.sc_commit + "cudapp:{}+libomega_gpu:{}+sc:{}", + self.cudapp_commit, self.gpu_archive_sha256, self.sc_commit )) } } @@ -1390,7 +1391,7 @@ mod tests { fn build() -> OmegaBuild { OmegaBuild { - omega_commit: "d0889a944b02066f84fec71af7b9bbb92f5c986f".into(), + cudapp_commit: "d0889a944b02066f84fec71af7b9bbb92f5c986f".into(), gpu_link: "pinned-source".into(), gpu_archive_sha256: "ab".repeat(32), gpu_digest: "unrecorded".into(), @@ -1518,7 +1519,7 @@ mod tests { ("decode graph", |i| i.switches.decode_graph ^= true), ("lm head gemv", |i| i.switches.lm_head_gemv ^= true), ("trace layers", |i| i.switches.trace_layers ^= true), - ("omega commit", |i| i.build.omega_commit = "e".repeat(40)), + ("cudapp commit", |i| i.build.cudapp_commit = "e".repeat(40)), ("archive digest", |i| { i.build.gpu_archive_sha256 = "ef".repeat(32) }), @@ -1564,6 +1565,7 @@ mod tests { let mut i = base(); i.env.push(("AIEN_OMEGA_SPIN_US".into(), "50".into())); i.env.push(("AIEN_OMEGA_DIR".into(), "/x".into())); + i.env.push(("AIEN_CUDAPP_DIR".into(), "/x".into())); assert_eq!(ns(&i).unwrap(), b); } @@ -1580,8 +1582,8 @@ mod tests { ("digest mismatch", |i| { i.build.gpu_digest = "mismatch".into() }), - ("unknown omega commit", |i| { - i.build.omega_commit = "unknown".into() + ("unknown cudapp commit", |i| { + i.build.cudapp_commit = "unknown".into() }), ("unknown engine commit", |i| { i.build.sc_commit = "unknown".into() diff --git a/crates/aien-serve-http/src/main.rs b/crates/aien-serve-http/src/main.rs index 97022f2d..6c43e2ae 100644 --- a/crates/aien-serve-http/src/main.rs +++ b/crates/aien-serve-http/src/main.rs @@ -81,7 +81,7 @@ fn build_info() -> String { format!( "aien-serve-http {}\n\ sovereign-core commit: {} (dirty {})\n\ - omega.lock: {}\n\ + cudapp.lock: {}\n\ omega gpu engine: {} (link {}, abi {}, digest {}, archive sha256 {})\n\ qwen38 engine: {} (prefill {})\n\ release-grade native identity: {}\n\ @@ -89,7 +89,7 @@ fn build_info() -> String { env!("CARGO_PKG_VERSION"), env!("AIEN_SERVE_HTTP_GIT_COMMIT"), env!("AIEN_SERVE_HTTP_GIT_DIRTY"), - env!("AIEN_SERVE_HTTP_OMEGA_LOCK"), + env!("AIEN_SERVE_HTTP_CUDAPP_LOCK"), native(aien_omega_gpu::is_native()), gpu.link, gpu.abi, diff --git a/crates/aien-serve-http/tests/kv_persist.rs b/crates/aien-serve-http/tests/kv_persist.rs index 3b8cc6ad..30b06474 100644 --- a/crates/aien-serve-http/tests/kv_persist.rs +++ b/crates/aien-serve-http/tests/kv_persist.rs @@ -80,7 +80,7 @@ fn gen_key() -> String { fn test_build() -> OmegaBuild { OmegaBuild { - omega_commit: "d0889a944b02066f84fec71af7b9bbb92f5c986f".into(), + cudapp_commit: "d0889a944b02066f84fec71af7b9bbb92f5c986f".into(), gpu_link: "pinned-source".into(), gpu_archive_sha256: "11".repeat(32), gpu_digest: "unrecorded".into(), @@ -321,8 +321,8 @@ fn each_identity_input_changed_alone_is_never_served() { v.weights = WeightFormat::Bf16; variants.push(("weights bf16", v)); let mut v = base.clone(); - v.build.omega_commit = "e".repeat(40); - variants.push(("omega commit", v)); + v.build.cudapp_commit = "e".repeat(40); + variants.push(("cudapp commit", v)); let mut v = base.clone(); v.build.gpu_archive_sha256 = "33".repeat(32); variants.push(("gpu archive digest", v)); diff --git a/crates/aien-serve-http/tests/version.rs b/crates/aien-serve-http/tests/version.rs index 9c9dae28..d5fa1e28 100644 --- a/crates/aien-serve-http/tests/version.rs +++ b/crates/aien-serve-http/tests/version.rs @@ -29,7 +29,7 @@ fn version_prints_build_identity_and_exits_zero() { let text = String::from_utf8(out.stdout).unwrap(); for want in [ "aien-serve-http ", - "omega.lock: ", + "cudapp.lock: ", "omega gpu engine: ", "qwen38 engine: ", "default model dir: $HOME/models/qwen3.8-27b-fp8-017b9c7a", @@ -37,10 +37,10 @@ fn version_prints_build_identity_and_exits_zero() { assert!(text.contains(want), "missing {want:?} in:\n{text}"); } let pin = - std::fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/../../omega.lock")).unwrap(); + std::fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/../../cudapp.lock")).unwrap(); assert!( - text.contains(&format!("omega.lock: {}", pin.trim())), - "omega.lock line does not match the repository pin:\n{text}" + text.contains(&format!("cudapp.lock: {}", pin.trim())), + "cudapp.lock line does not match the repository pin:\n{text}" ); } diff --git a/cudapp.lock b/cudapp.lock new file mode 100644 index 00000000..9bef06eb --- /dev/null +++ b/cudapp.lock @@ -0,0 +1 @@ +c30c0be6222af7d13e38dd354a752fd17367adeb diff --git a/docs/qwen38/TRY_IT_ON_YOUR_SPARK.md b/docs/qwen38/TRY_IT_ON_YOUR_SPARK.md index 97cbf2d7..5596b9d3 100644 --- a/docs/qwen38/TRY_IT_ON_YOUR_SPARK.md +++ b/docs/qwen38/TRY_IT_ON_YOUR_SPARK.md @@ -84,10 +84,10 @@ What the installer does with `--with-server --with-model`, in order: free memory. Then free disk for the model (the block that starts with `[*] Model download: checking`). A failed check stops the installer before anything is cloned, built or downloaded and says what is wrong in plain words. -2. Fetches the pinned Omega, physics and aienos sources from GitHub into `target/pins/` - (`scripts/pins.sh --gpu`). The exact commits are in `omega.lock` and the lock files next to - it. -3. Builds the Omega GPU library from those sources and the server +2. Fetches the pinned CUDApp (the GPU engine), Omega, physics and aienos sources from GitHub + into `target/pins/` (`scripts/pins.sh --gpu`). The exact commits are in `cudapp.lock`, + `omega.lock` and the lock files inside the Omega checkout. +3. Builds the Omega GPU library from the CUDApp source and the server `aien-serve-http` against it (`cargo build --locked --release -p aien-serve-http`). This is the long step. 4. Runs `aien-serve-http --version` and refuses to install a binary that has only the CPU stub diff --git a/docs/release/BUILD_RECIPE.md b/docs/release/BUILD_RECIPE.md index 918f4dd2..d384124f 100644 --- a/docs/release/BUILD_RECIPE.md +++ b/docs/release/BUILD_RECIPE.md @@ -8,18 +8,20 @@ checks all use the same commands. One command materializes every pin a native build needs (sovereign-core #92, "clean checkout plus one command"): ``` -scripts/pins.sh --gpu # omega at omega.lock, physics and aienos at omega's locks, under target/pins -. target/pins/env.sh # AIEN_OMEGA_DIR, AIEN_OMEGA_COMPOSE_DIR, AIEN_PHYSICS_DIR, AIEN_AIENOS_LOCK_REPO, AIEN_REQUIRE_NATIVE_LIBS=1 +scripts/pins.sh --gpu # CUDApp at cudapp.lock, omega at omega.lock, physics and aienos at omega's locks, under target/pins +. target/pins/env.sh # AIEN_CUDAPP_DIR, AIEN_OMEGA_COMPOSE_DIR, AIEN_PHYSICS_DIR, AIEN_AIENOS_LOCK_REPO, AIEN_REQUIRE_NATIVE_LIBS=1 ``` -Without `--gpu` only the composition library is linked (the CI gate shape). `scripts/pins.sh --check` verifies the -three checkouts are at their pins without touching the network. `AIEN_REQUIRE_NATIVE_LIBS=1` makes a build that +Without `--gpu` only the composition library is linked (the CI gate shape). The GPU engine (`libomega_gpu.a`) is built +from aien-dev/CUDApp at `cudapp.lock`; CUDApp carries its driver client in-tree, so it needs no physics checkout. +`scripts/pins.sh --check` verifies the checkouts are at their pins without touching the network. `AIEN_REQUIRE_NATIVE_LIBS=1` makes a build that would silently fall back to a CPU stub fail instead; `scripts/golden_path.sh` sources `target/pins/env.sh` when present. `scripts/test-pins.sh` is the offline self-test (throwaway repositories, no network). `scripts/release-build.sh` (needs the pinned toolchain from `rust-toolchain.toml`, `cargo fetch --locked` into the -CARGO_HOME in use, and for the native engine `AIEN_OMEGA_DIR` at `omega.lock` and `AIEN_PHYSICS_DIR` at omega's -`physics.lock`; `AIEN_DEV_FALLBACK` and `AIEN_FORCE_CPU_STUB` unset, no mojo on PATH): +CARGO_HOME in use, for the native GPU engine `AIEN_CUDAPP_DIR` at `cudapp.lock`, and for the composition library +`AIEN_OMEGA_COMPOSE_DIR` at `omega.lock` and `AIEN_PHYSICS_DIR` at omega's `physics.lock`; `AIEN_DEV_FALLBACK` and +`AIEN_FORCE_CPU_STUB` unset, no mojo on PATH): 1. `scripts/repro-build.sh -p spark-cockpit-rs -p spark-inquisitor -p cortex-encoder-rs -p cortex-rs -p spark-supervisor -p spark-debugger` 2. `scripts/repro-build.sh -p aien-cli` @@ -37,16 +39,17 @@ package aien-proof or aien-test. - `scripts/package-release.sh ` runs the release gate itself and writes the candidate id and `[model]` table from `release/candidate.toml` into `release.toml`. A failing gate means no package (`AIEN_DRY_RUN=1` only labels it `NOT-RELEASABLE`, which the checks reject). -- `scripts/check-release-candidate.sh` (tree): candidate named, `omega.lock` equals `omega-commit`, `Cargo.lock` +- `scripts/check-release-candidate.sh` (tree): candidate named, `omega.lock` equals `omega-commit`, `cudapp.lock` + holds a full sha and equals `cudapp-commit` when the candidate names one, `Cargo.lock` holds exactly the `[pins]` revisions (aien-protocols, crumb-spec, spark-crumbs), `[model]` complete. - `scripts/check-release-candidate.sh --package A.tar.gz --native`: candidate id, `[model]` table (model id, safetensors, tokenizer, config, oracle fixture digests), `aien-cli-sha256` equals the digest of `bin/aien`, every - listed file, no unlisted file; `--native` is required (linux aarch64, omega linked): the digest must equal + listed file, no unlisted file; `--native` is required (linux aarch64, the GPU engine linked): the digest must equal `[executables] aien-cli-native-release`, and each helper binary must equal its `sc-` entry. A package without `--native` is refused (no candidate digest for that kind); the release matrix builds only the native target. - `scripts/verify-release-assets.sh `: signature on `SHA256SUMS.txt` valid for the pinned signer, every listed file matches, every `sovereign-*` archive is covered. - `scripts/release-publish-gate.sh `: the stage-3 publish decision (see `RELEASE_SIGNING.md`). -- `scripts/test-release-checks.sh` (also in CI) proves each of these rejects: wrong omega.lock or Cargo.lock pins, +- `scripts/test-release-checks.sh` (also in CI) proves each of these rejects: wrong omega.lock, cudapp.lock or Cargo.lock pins, executable digest mismatch, model input mismatch, missing, corrupt or foreign signature, tampered files. ## Release workflow modes diff --git a/install.sh b/install.sh index eff74d7a..1395e519 100755 --- a/install.sh +++ b/install.sh @@ -354,19 +354,20 @@ server_preflight() { echo "[+] Model server: machine checks passed" } -# server_build: fetch the pinned Omega sources, build aien-serve-http against the real GPU engine, -# refuse a CPU stub, install it and its start script. Runs from the source checkout. +# server_build: fetch the pinned CUDApp (GPU engine) and Omega (composition) sources, build +# aien-serve-http against the real GPU engine, refuse a CPU stub, install it and its start script. +# Runs from the source checkout. server_build() { local pins="${AIEN_PINS_DIR:-$SOURCE_ROOT/target/pins}" local out="${CARGO_TARGET_DIR:-$SOURCE_ROOT/target}/release/aien-serve-http" - echo "[*] Model server: fetching the pinned omega, physics and aienos sources into $pins" + echo "[*] Model server: fetching the pinned CUDApp, omega, physics and aienos sources into $pins" bash "$SOURCE_ROOT/scripts/pins.sh" --gpu "$pins" \ || server_die "scripts/pins.sh --gpu failed (see the lines above). Check the network and that git can reach github.com." [[ -f "$pins/env.sh" ]] || server_die "scripts/pins.sh did not write $pins/env.sh." # shellcheck disable=SC1091 . "$pins/env.sh" - [[ "${AIEN_REQUIRE_NATIVE_LIBS:-}" == 1 && -n "${AIEN_OMEGA_DIR:-}" ]] \ - || server_die "$pins/env.sh does not select the GPU engine (AIEN_OMEGA_DIR unset)." + [[ "${AIEN_REQUIRE_NATIVE_LIBS:-}" == 1 && -n "${AIEN_CUDAPP_DIR:-}" ]] \ + || server_die "$pins/env.sh does not select the GPU engine (AIEN_CUDAPP_DIR unset)." echo "[*] Model server: building aien-serve-http (release, links AIEN's Omega GPU library; this takes a while)" cargo build --locked --release -p aien-serve-http \ || server_die "cargo build of aien-serve-http failed (see the lines above)." diff --git a/native-artifacts.lock b/native-artifacts.lock index 8ca3b6b3..a6631497 100644 --- a/native-artifacts.lock +++ b/native-artifacts.lock @@ -1,6 +1,8 @@ -# Recorded digests of the omega archives sovereign-core links (aien-abi-conformance). -# One line per archive: -# A build from the pinned omega checkout for a listed target and compiler must produce exactly +# Recorded digests of the native archives sovereign-core links (aien-abi-conformance). +# One line per archive: +# The source sha is the omega commit for librx_compose.a. The libomega_gpu.a lines recorded so far name omega +# commits; since the GPU engine moved to CUDApp (cudapp.lock), new libomega_gpu.a lines name the CUDApp commit. +# A build from the pinned source checkout for a listed target and compiler must produce exactly # this digest, or build.rs fails. A combination not listed builds with a warning and its # native_identity() reports digest "unrecorded", which does not qualify. # Update only from a qualification run (scripts/abi-qualify.sh prints the lines to add). diff --git a/scripts/abi-qualify.sh b/scripts/abi-qualify.sh index 1d20f66e..07834d8d 100755 --- a/scripts/abi-qualify.sh +++ b/scripts/abi-qualify.sh @@ -80,13 +80,13 @@ tests_ran() { ! grep -qE '^test result:.* [1-9][0-9]* ignored' "$log" } -# 1. Pins (omega at omega.lock, physics and aienos at omega's locks). +# 1. Pins (CUDApp at cudapp.lock, omega at omega.lock, physics and aienos at omega's locks). if bash scripts/pins.sh --gpu "$PINS" >"$OUT/pins.log" 2>&1 && [ -f "$PINS/env.sh" ]; then record pins pass "" # shellcheck disable=SC1091 . "$PINS/env.sh" else - record pins incomplete "scripts/pins.sh --gpu failed: no pinned omega, nothing native can be qualified" + record pins incomplete "scripts/pins.sh --gpu failed: no pinned CUDApp/omega, nothing native can be qualified" fi export AIEN_ABI_QUALIFY=1 @@ -155,8 +155,8 @@ dirty=false printf '"rustc":"%s",\n"cc":"%s",\n"nm":"%s",\n' "$(j "$(rustc -V)")" "$(j "$(${CC:-cc} --version | head -1)")" "$(j "$(nm --version | head -1)")" printf '"flags":{"RUSTFLAGS":"%s","CFLAGS":"%s","CC":"%s","AIEN_REQUIRE_NATIVE_LIBS":"%s"},\n' \ "$(j "${RUSTFLAGS:-}")" "$(j "${CFLAGS:-}")" "$(j "${CC:-cc}")" "${AIEN_REQUIRE_NATIVE_LIBS:-}" - printf '"commits":{"sovereign_core":"%s","sovereign_core_dirty":%s,"omega_lock":"%s","omega":"%s","physics":"%s","aienos":"%s"},\n' \ - "$(rev "$ROOT")" "$dirty" "$(tr -d '[:space:]' "$D/build-run.log" 2>&1 || { echo "build failed, see $D/build-run.log" >&2; exit 2; } grep -q "building the stub" "$D/build-run.log" && { echo "stub compose build; refusing" >&2; exit 2; } @@ -358,7 +358,7 @@ mkdir -p "$RUN"/{state,compose,prov,ws,home,logs} "$ART" LOGS=$RUN/logs WS=$RUN/ws -E=(env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_REQUIRE_BLACKWELL +E=(env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_REQUIRE_BLACKWELL -u AIEN_GPU_BACKEND -u AIEN_MODEL_DIR -u AIEN_MODEL_PATH -u AIEN_TOKENIZER_PATH -u AIEN_FORCE_CPU_STUB -u AIEN_FAULT_HOLD -u AIEN_FAULT_HOLD_FILE -u AIEN_ALLEN_SUBJECT -u AIEN_ALLEN_ADOPT -u AIEN_COMPOSE_MAX_TOKENS -u AIEN_COMPOSE_DOC_MAX_TOKENS @@ -598,7 +598,7 @@ if ! skip S1; then LINEAGE=$(cli compose recall --ids 1 | jq -r '.recall.cited[0].digest') kill9 || true SUBJ=$RUN/subject.bin - FX=$(cd "$REPO" && env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR AIEN_OMEGA_COMPOSE_LIB="$LIB" CARGO_TARGET_DIR="$D/target" \ + FX=$(cd "$REPO" && env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR AIEN_OMEGA_COMPOSE_LIB="$LIB" CARGO_TARGET_DIR="$D/target" \ DEMO_SUBJECT_OUT="$SUBJ" DEMO_LINEAGE_HEX="$LINEAGE" DEMO_SUBJECT_NAME="allen-e2e-demo-$V" \ cargo test --release -p aien-allen --test e2e_demo_subject -- --ignored --nocapture 2>&1) AGENT=$(printf '%s\n' "$FX" | sed -n 's/^AGENT=//p'); AROOT=$(printf '%s\n' "$FX" | sed -n 's/^ROOT=//p') diff --git a/scripts/bench/headstart-m6-ab.sh b/scripts/bench/headstart-m6-ab.sh index c6aa379b..a1add8f9 100755 --- a/scripts/bench/headstart-m6-ab.sh +++ b/scripts/bench/headstart-m6-ab.sh @@ -75,7 +75,7 @@ done mkdir -p "$OUT/logs" [ ! -e "$OUT/samples.jsonl" ] || die "$OUT/samples.jsonl exists: use a new OUT_DIR" -unset AIEN_OMEGA_DIR AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_DEV_FALLBACK +unset AIEN_CUDAPP_DIR AIEN_OMEGA_DIR AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_DEV_FALLBACK PINS="{}" case "$BUILD" in linked) diff --git a/scripts/check-release-candidate.sh b/scripts/check-release-candidate.sh index 331ba57e..4e192f02 100755 --- a/scripts/check-release-candidate.sh +++ b/scripts/check-release-candidate.sh @@ -19,11 +19,12 @@ # scripts/check-release-candidate.sh --model F also write the [model] table to file F # scripts/check-release-candidate.sh --package A.tar.gz --native # also check a built package (see below) -# Tree checks: candidate is set and not "unknown"; omega.lock equals omega-commit; Cargo.lock holds exactly the +# Tree checks: candidate is set and not "unknown"; omega.lock equals omega-commit; cudapp.lock holds a full commit hash +# and equals cudapp-commit when the candidate names one; Cargo.lock holds exactly the # [pins] revisions (aien-protocols, crumb-spec, spark-crumbs); the [model] table is complete (every digest is 64 hex). # Package checks: release.toml names this candidate; its [model] table equals the candidate's (model id, safetensors, # tokenizer, config, fixture digests); aien-cli-sha256 equals the sha256 of bin/aien in the archive; every [files] -# entry matches; --native is REQUIRED (the linux-aarch64 build that links the omega engine): aien-cli-sha256 must equal +# entry matches; --native is REQUIRED (the linux-aarch64 build that links the CUDApp GPU engine): aien-cli-sha256 must equal # [executables] aien-cli-native-release and every helper binary must equal its sc- entry. A package without --native # is refused (no candidate digest for that kind). Build recipe: docs/release/BUILD_RECIPE.md. # Env: AIEN_CANDIDATE_ROOT overrides the tree root (tests). @@ -54,6 +55,13 @@ cand="$(get "" candidate "$M")"; omega="$(get "" omega-commit "$M")" [[ -f omega.lock ]] || die "omega.lock is missing" lock="$(tr -d '[:space:]' < omega.lock)" [[ "$lock" == "$omega" ]] || die "omega.lock is $lock but candidate $cand names omega $omega. This tree is not $cand and cannot be released as it." +[[ -f cudapp.lock ]] || die "cudapp.lock is missing" +lock_cu="$(tr -d '[:space:]' < cudapp.lock)" +[[ "$lock_cu" =~ ^[0-9a-f]{40}$ ]] || die "cudapp.lock does not hold one full commit hash" +cudapp="$(get "" cudapp-commit "$M")" +if [[ -n "$cudapp" ]]; then + [[ "$lock_cu" == "$cudapp" ]] || die "cudapp.lock is $lock_cu but candidate $cand names cudapp $cudapp. This tree is not $cand and cannot be released as it." +fi grep -q '^\[model\]' "$M" || die "no [model] table in $M" for k in model-id model-safetensors-sha256 tokenizer-json-sha256 config-json-sha256 oracle-fixture-safetensors-sha256 oracle-fixture-manifest-sha256; do v="$(get model "$k" "$M")"; [[ -n "$v" ]] || die "[model] $k is missing in $M" diff --git a/scripts/gb10-serve-chat.sh b/scripts/gb10-serve-chat.sh index 327b7271..e2766407 100755 --- a/scripts/gb10-serve-chat.sh +++ b/scripts/gb10-serve-chat.sh @@ -95,8 +95,8 @@ obs mem_available_mib "$avail_mib" [ -f "$ENV_SH" ] || fail "pins env file $ENV_SH is missing" # shellcheck disable=SC1090 . "$ENV_SH" -[ "${AIEN_REQUIRE_NATIVE_LIBS:-}" = 1 ] && [ -n "${AIEN_OMEGA_DIR:-}" ] \ - || fail "$ENV_SH does not select the GPU engine (AIEN_OMEGA_DIR unset)" +[ "${AIEN_REQUIRE_NATIVE_LIBS:-}" = 1 ] && [ -n "${AIEN_CUDAPP_DIR:-}" ] \ + || fail "$ENV_SH does not select the GPU engine (AIEN_CUDAPP_DIR unset)" cargo build --locked --release -p aien-serve-http rc=$? obs build_rc "$rc" diff --git a/scripts/own30b-chip-run.sh b/scripts/own30b-chip-run.sh index faaea8a3..cd3ff36a 100755 --- a/scripts/own30b-chip-run.sh +++ b/scripts/own30b-chip-run.sh @@ -32,7 +32,7 @@ repo=$(cd "$(dirname "$0")/.." && pwd) echo "sc commit $(git -C "$repo" rev-parse HEAD) branch $(git -C "$repo" rev-parse --abbrev-ref HEAD)" echo "binary $bin sha256 $(sha256sum "$bin" | cut -d' ' -f1)" echo "golden $golden sha256 $(sha256sum "$golden" | cut -d' ' -f1)" - echo "omega lib ${AIEN_OMEGA_GPU_LIB:-pinned omega.lock} ${AIEN_OMEGA_GPU_LIB_SHA256:-}" + echo "omega lib ${AIEN_OMEGA_GPU_LIB:-pinned cudapp.lock} ${AIEN_OMEGA_GPU_LIB_SHA256:-}" echo "env AIEN_OMEGA_SPIN_US=${AIEN_OMEGA_SPIN_US:-} AIEN_OMEGA_CTA_BUDGET=${AIEN_OMEGA_CTA_BUDGET:-}" echo "cmd flock /tmp/aien-gb10.lock $bin chip $ckpt $golden $ev/$name $*" free -g | head -2 diff --git a/scripts/own30b-pkv-chip-check.sh b/scripts/own30b-pkv-chip-check.sh index 01e700f2..2a514b6f 100755 --- a/scripts/own30b-pkv-chip-check.sh +++ b/scripts/own30b-pkv-chip-check.sh @@ -24,7 +24,7 @@ # --dry-run prints the plan and checks the prerequisites; it starts no server. # The binary must be a native release build of this branch from a clean checkout (dirty or # unknown builds refuse persistence by design), e.g. -# AIEN_OMEGA_DIR= cargo build --release -p aien-serve-http +# AIEN_CUDAPP_DIR= cargo build --release -p aien-serve-http # # Key: atlas-vault entry AIEN_KV_STORE_KEY by default; PKV_CHECK_EPHEMERAL_KEY=1 makes a # throwaway key (never printed or saved). Stores are private temp dirs. Refuses while :18091 diff --git a/scripts/pins.sh b/scripts/pins.sh index a43dac3d..9e09f69e 100755 --- a/scripts/pins.sh +++ b/scripts/pins.sh @@ -14,40 +14,46 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pins.sh: materialize the three pinned checkouts a native (no CUDA) build needs, +# pins.sh: materialize the pinned checkouts a native (no CUDA) build needs, # exactly as CI does (ci.yml "Linked composition tests"), so a clean clone plus one # command yields the real omega libraries instead of the CPU stubs (sovereign-core #92). # -# omega at omega.lock (this repository) +# omega at omega.lock (this repository; the composition library) # physics at omega's physics.lock # aienos at omega's aienos.lock (authority source for the composition library) +# cudapp at cudapp.lock (this repository; the GB10 engine), only with --gpu # # Usage: scripts/pins.sh [--gpu] [--check] [DIR] # DIR where the checkouts live (default target/pins). Existing clones are reused; # the network is touched only when a clone is missing or not at its pin. -# --gpu env.sh also sets AIEN_OMEGA_DIR, which links the GB10 engine (aien-omega-gpu). -# Without it only the composition library (CPU) is linked, as the CI gate does. +# --gpu also place CUDApp at cudapp.lock; env.sh sets AIEN_CUDAPP_DIR, which links the +# GB10 engine (aien-omega-gpu). CUDApp vendors its driver client, so the engine +# needs no physics checkout. Without --gpu only the composition library (CPU) is +# linked, as the CI gate does. # --check verify only: every clone present and at its pin, no network, no writes. # Writes DIR/env.sh. Then: . target/pins/env.sh && cargo build --release # Env: AIEN_PINS_REMOTE_BASE (default https://github.com/aien-dev; a local mirror directory # works too), AIEN_PINS_REMOTE_SUFFIX (appended to each repository name; default "-mv" # for the default GitHub base, where the repositories are omega-mv, physics-mv and -# aienos-mv, and "" when AIEN_PINS_REMOTE_BASE is set), AIEN_PINS_ROOT (repository root -# override, used by scripts/test-pins.sh). +# aienos-mv, and "" when AIEN_PINS_REMOTE_BASE is set). CUDApp is $BASE/CUDApp under +# the default base (no suffix) and $BASE/cudapp$SUFFIX when AIEN_PINS_REMOTE_BASE is set. +# AIEN_PINS_ROOT (repository root override, used by scripts/test-pins.sh). # Exit: 0 ok, 2 usage, 3 a checkout is not at its pin (or missing under --check), 4 git failed. set -euo pipefail ROOT="${AIEN_PINS_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}" if [ -n "${AIEN_PINS_REMOTE_BASE:-}" ]; then BASE="$AIEN_PINS_REMOTE_BASE"; SUFFIX="${AIEN_PINS_REMOTE_SUFFIX:-}" + CUDAPP_URL="$BASE/cudapp$SUFFIX" else BASE="https://github.com/aien-dev"; SUFFIX="${AIEN_PINS_REMOTE_SUFFIX--mv}" + CUDAPP_URL="$BASE/CUDApp" fi GPU=0; CHECK=0; DIR="" for a in "$@"; do case "$a" in --gpu) GPU=1 ;; --check) CHECK=1 ;; - -h|--help) sed -n '2,22p' "$0"; exit 0 ;; + -h|--help) sed -n '2,41p' "$0"; exit 0 ;; -*) echo "pins.sh: unknown flag $a" >&2; exit 2 ;; *) [ -z "$DIR" ] || { echo "pins.sh: one DIR only" >&2; exit 2; }; DIR="$a" ;; esac @@ -58,17 +64,18 @@ die() { echo "pins.sh: $*" >&2; exit 3; } sha_of() { tr -d '[:space:]' < "$1"; } is_sha() { [[ "$1" =~ ^[0-9a-f]{40}$ ]]; } head_of() { git -C "$1" rev-parse HEAD 2>/dev/null || true; } -# place NAME SHA: make DIR/NAME a clone at SHA (detached), fetching only when needed. +# place NAME SHA [URL]: make DIR/NAME a clone at SHA (detached), fetching only when needed. +# URL defaults to $BASE/NAME$SUFFIX. place() { - local name="$1" sha="$2" + local name="$1" sha="$2" url="${3:-$BASE/$1$SUFFIX}" local d="$DIR/$name" is_sha "$sha" || die "$name pin is not a full 40-hex sha: '$sha'" if [ "$(head_of "$d")" = "$sha" ]; then echo "pins: $name at $sha (present)"; return 0; fi [ "$CHECK" -eq 0 ] || die "$name is not at $sha under --check (have '$(head_of "$d")', dir $d)" mkdir -p "$DIR" if [ ! -d "$d/.git" ]; then - echo "pins: cloning $name from $BASE/$name$SUFFIX" - git clone -q "$BASE/$name$SUFFIX" "$d" || { echo "pins.sh: clone of $name ($BASE/$name$SUFFIX) failed" >&2; exit 4; } + echo "pins: cloning $name from $url" + git clone -q "$url" "$d" || { echo "pins.sh: clone of $name ($url) failed" >&2; exit 4; } fi if ! git -C "$d" cat-file -e "$sha^{commit}" 2>/dev/null; then git -C "$d" fetch -q origin "$sha" || git -C "$d" fetch -q origin || { echo "pins.sh: fetch of $name failed" >&2; exit 4; } @@ -83,14 +90,18 @@ place omega "$(sha_of "$ROOT/omega.lock")" [ -f "$DIR/omega/aienos.lock" ] || die "omega checkout has no aienos.lock" place physics "$(sha_of "$DIR/omega/physics.lock")" place aienos "$(sha_of "$DIR/omega/aienos.lock")" +if [ "$GPU" -eq 1 ]; then + [ -f "$ROOT/cudapp.lock" ] || die "no cudapp.lock under $ROOT" + place cudapp "$(sha_of "$ROOT/cudapp.lock")" "$CUDAPP_URL" +fi if [ "$CHECK" -eq 0 ]; then { echo "# written by scripts/pins.sh; source it before cargo build/test" echo "export AIEN_OMEGA_COMPOSE_DIR='$DIR/omega'" echo "export AIEN_PHYSICS_DIR='$DIR/physics'" echo "export AIEN_AIENOS_LOCK_REPO='$DIR/aienos'" - if [ "$GPU" -eq 1 ]; then echo "export AIEN_OMEGA_DIR='$DIR/omega'"; else echo "unset AIEN_OMEGA_DIR"; fi - echo "unset AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_FORCE_CPU_STUB AIEN_DEV_FALLBACK" + if [ "$GPU" -eq 1 ]; then echo "export AIEN_CUDAPP_DIR='$DIR/cudapp'"; else echo "unset AIEN_CUDAPP_DIR"; fi + echo "unset AIEN_OMEGA_DIR AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_FORCE_CPU_STUB AIEN_DEV_FALLBACK" echo "export AIEN_REQUIRE_NATIVE_LIBS=1" } > "$DIR/env.sh" echo "pins: wrote $DIR/env.sh ($([ "$GPU" -eq 1 ] && echo 'GPU engine + composition' || echo 'composition only, CPU'))" diff --git a/scripts/release-build.sh b/scripts/release-build.sh index 0e526393..d821d6ff 100755 --- a/scripts/release-build.sh +++ b/scripts/release-build.sh @@ -18,7 +18,8 @@ # and the thing to run by hand to reproduce a candidate digest. See docs/release/BUILD_RECIPE.md. # scripts/release-build.sh [extra cargo args, e.g. --offline] # Needs a pinned toolchain (rust-toolchain.toml), `cargo fetch --locked` done into the CARGO_HOME in use, -# and for the native engine AIEN_OMEGA_DIR and AIEN_PHYSICS_DIR at omega.lock / omega's physics.lock. +# for the native GPU engine AIEN_CUDAPP_DIR at cudapp.lock, and for the composition library +# AIEN_OMEGA_COMPOSE_DIR and AIEN_PHYSICS_DIR at omega.lock / omega's physics.lock. # Cargo unifies features across every -p in one command, so a digest depends on the group it was built in # (docs/release/F1-binary-digest-difference.md). The groups are therefore fixed: the packaged helpers as one # group first, then aien-cli alone and last, each through scripts/repro-build.sh (--locked, path remap). diff --git a/scripts/repro-build.sh b/scripts/repro-build.sh index 64985398..1adda6ca 100755 --- a/scripts/repro-build.sh +++ b/scripts/repro-build.sh @@ -21,8 +21,8 @@ # rustc writes the source path of every dependency into panic messages. Dependencies come from # $CARGO_HOME/registry/src/..., so without this script the aien-cli digest depends on the home # directory and on CARGO_HOME of whoever built it. The script maps those prefixes to fixed names -# (--remap-path-prefix) and builds with --release --locked. It does not set AIEN_OMEGA_DIR, -# AIEN_PHYSICS_DIR or CARGO_TARGET_DIR: pass them as for any other build. +# (--remap-path-prefix) and builds with --release --locked. It does not set AIEN_CUDAPP_DIR, +# AIEN_OMEGA_COMPOSE_DIR, AIEN_PHYSICS_DIR or CARGO_TARGET_DIR: pass them as for any other build. set -euo pipefail root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P) cargo_home=${CARGO_HOME:-$HOME/.cargo} diff --git a/scripts/test-install-release.sh b/scripts/test-install-release.sh index 7fc86cbe..af96d996 100755 --- a/scripts/test-install-release.sh +++ b/scripts/test-install-release.sh @@ -319,7 +319,7 @@ inst_args "$WORK/bin-good" "$WORK/cfg-good" --rollback || fail "rollback after r # 13. release gate: the candidate must be named and omega.lock must be the candidate's omega commit GT="$WORK/gate"; mkdir -p "$GT/scripts" "$GT/release" -cp "$ROOT/scripts/check-release-candidate.sh" "$GT/scripts/"; cp "$ROOT/release/candidate.toml" "$GT/release/"; cp "$ROOT/Cargo.lock" "$GT/" +cp "$ROOT/scripts/check-release-candidate.sh" "$GT/scripts/"; cp "$ROOT/release/candidate.toml" "$GT/release/"; cp "$ROOT/Cargo.lock" "$ROOT/cudapp.lock" "$GT/" gate() { (cd "$GT" && bash scripts/check-release-candidate.sh "$@" > "$WORK/log-gate" 2>&1); } OM="$(sed -n 's/^omega-commit *= *"\(.*\)"$/\1/p' "$GT/release/candidate.toml")" echo "$OM" > "$GT/omega.lock" diff --git a/scripts/test-install.sh b/scripts/test-install.sh index 8d23ae61..182ae501 100755 --- a/scripts/test-install.sh +++ b/scripts/test-install.sh @@ -72,8 +72,8 @@ EOF cat > "$WORK/mocks/pins.sh" <<'EOF' #!/usr/bin/env bash [[ "$1" == --gpu ]] || { echo "pins.sh called without --gpu" >&2; exit 2; } -mkdir -p "$2/omega" -printf "export AIEN_OMEGA_DIR='%s/omega'\nexport AIEN_REQUIRE_NATIVE_LIBS=1\n" "$2" > "$2/env.sh" +mkdir -p "$2/cudapp" +printf "export AIEN_CUDAPP_DIR='%s/cudapp'\nexport AIEN_REQUIRE_NATIVE_LIBS=1\n" "$2" > "$2/env.sh" echo "pins.sh --gpu $2" >> "$MOCK_STATE/pins.calls" EOF @@ -87,8 +87,8 @@ args=" $* " [[ "$args" == *" --locked "* ]] || { echo "cargo build is not --locked" >&2; exit 1; } mkdir -p target/release if [[ "$args" == *" -p aien-serve-http "* ]]; then - [[ "${AIEN_REQUIRE_NATIVE_LIBS:-}" == 1 && -n "${AIEN_OMEGA_DIR:-}" ]] \ - || { echo "server build without the pins env (AIEN_REQUIRE_NATIVE_LIBS, AIEN_OMEGA_DIR)" >&2; exit 1; } + [[ "${AIEN_REQUIRE_NATIVE_LIBS:-}" == 1 && -n "${AIEN_CUDAPP_DIR:-}" ]] \ + || { echo "server build without the pins env (AIEN_REQUIRE_NATIVE_LIBS, AIEN_CUDAPP_DIR)" >&2; exit 1; } echo "server build" >> "$MOCK_STATE/cargo.calls" if [[ "${MOCK_SERVER_KIND:-native}" == native ]]; then e="native"; else e="STUB (not usable with --engine omega)"; fi printf '#!/bin/sh\nprintf "aien-serve-http 0.1.0\\nomega gpu engine: %s\\nqwen38 engine: %s\\n"\n' "$e" "$e" > target/release/aien-serve-http diff --git a/scripts/test-linked-compose.sh b/scripts/test-linked-compose.sh index dcdf07eb..97b469e9 100755 --- a/scripts/test-linked-compose.sh +++ b/scripts/test-linked-compose.sh @@ -27,7 +27,7 @@ # PHYSICS_DIR physics checkout at omega's physics.lock # AIENOS_REPO aienos clone holding omega's aienos.lock commit # Env: CARGO_TARGET_DIR (optional), LINKED_REPEAT (default 3: how many times the approved_attacks suite runs). -# CPU only: never sets AIEN_OMEGA_DIR (that would link the GPU engine) and unsets the stub/fallback switches. +# CPU only: never sets AIEN_CUDAPP_DIR (that would link the GPU engine) and unsets the stub/fallback switches. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" OMW=$(cd "${1:?OMEGA_DIR}" && pwd); PHW=$(cd "${2:?PHYSICS_DIR}" && pwd); AO=$(cd "${3:?AIENOS_REPO}" && pwd) @@ -38,7 +38,7 @@ pin=$(tr -d '[:space:]' <"$ROOT/omega.lock") [ "$(git -C "$AO" rev-parse HEAD)" = "$(tr -d '[:space:]' <"$OMW/aienos.lock")" ] || die "aienos HEAD != omega aienos.lock" REPEAT=${LINKED_REPEAT:-3} export AIEN_OMEGA_COMPOSE_DIR="$OMW" AIEN_PHYSICS_DIR="$PHW" AIEN_AIENOS_LOCK_REPO="$AO" -unset AIEN_OMEGA_DIR AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_FORCE_CPU_STUB AIEN_DEV_FALLBACK +unset AIEN_CUDAPP_DIR AIEN_OMEGA_DIR AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_FORCE_CPU_STUB AIEN_DEV_FALLBACK cd "$ROOT" LOG=$(mktemp); trap 'rm -f "$LOG"' EXIT run() { # run test targets with --include-ignored; the tests are serial (one process-wide compose home) diff --git a/scripts/test-native-identity.sh b/scripts/test-native-identity.sh index 8a7acc49..a6e77142 100755 --- a/scripts/test-native-identity.sh +++ b/scripts/test-native-identity.sh @@ -15,12 +15,12 @@ # limitations under the License. # Native identity checks in the build scripts of aien-omega-compose and aien-omega-gpu. -# Runs without omega: every case below must be decided by build.rs before any make. +# Runs without omega or CUDApp: every case below must be decided by build.rs before any make. # - a stub together with AIEN_REQUIRE_NATIVE_LIBS=1 is refused # - AIEN_REQUIRE_NATIVE_LIBS=1 with no library source is refused # - a prebuilt archive with no expected sha256, a wrong one, or a truncated archive is refused # - a prebuilt archive that misses one ABI function is refused -# - an omega checkout at a commit other than omega.lock is refused +# - a checkout at a commit other than its lock (omega.lock for compose, cudapp.lock for gpu) is refused # - a correct prebuilt archive builds, and its identity says "prebuilt" (never qualifies) # Exit 0 when every case behaves, 1 otherwise. set -euo pipefail @@ -59,8 +59,8 @@ fake_archive() { ar rcs "$2" "$src.o" } -# A git checkout at a commit that is not omega.lock. -WRONG="$WORK/wrong-omega" +# A git checkout at a commit that is neither omega.lock nor cudapp.lock. +WRONG="$WORK/wrong-checkout" git init -q "$WRONG" git -C "$WRONG" -c user.name=t -c user.email=t@t commit -q --allow-empty -m wrong @@ -86,7 +86,7 @@ check_crate() { "$libvar=$short" "${libvar}_SHA256=$sha" expect_refused "$crate" "prebuilt missing $drop" "does not define" \ "$libvar=$miss" "${libvar}_SHA256=$miss_sha" - expect_refused "$crate" "omega checkout at the wrong commit" "is at '" \ + expect_refused "$crate" "checkout at the wrong commit" "is at '" \ "$dirvar=$WRONG" if env "$libvar=$good" "${libvar}_SHA256=$sha" cargo check -q -p "$crate" >"$WORK/log" 2>&1 && @@ -102,7 +102,7 @@ cd "$ROOT" check_crate aien-omega-compose crates/aien-omega-compose/abi/rxc_host_abi.manifest \ AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_DIR rxc_host_recover AIEN_OMEGA_COMPOSE check_crate aien-omega-gpu crates/aien-omega-gpu/abi/omega_gpu.manifest \ - AIEN_OMEGA_GPU_LIB AIEN_OMEGA_DIR omega_gpu_matmul_f32 AIEN_OMEGA_GPU + AIEN_OMEGA_GPU_LIB AIEN_CUDAPP_DIR omega_gpu_matmul_f32 AIEN_OMEGA_GPU if [ "$fails" -ne 0 ]; then echo "native identity: $fails case(s) failed" diff --git a/scripts/test-pins.sh b/scripts/test-pins.sh index f0e57d89..7b4e81a2 100755 --- a/scripts/test-pins.sh +++ b/scripts/test-pins.sh @@ -17,7 +17,8 @@ # test-pins.sh: offline self-test of scripts/pins.sh with throwaway git repositories # (no network). Proves: correct pins pass (--check and a full run against a local mirror), # a checkout off its pin is refused (exit 3), a malformed lock is refused (exit 3), and -# env.sh carries the three directories and the AIEN_OMEGA_DIR choice. +# env.sh carries the three directories and the AIEN_CUDAPP_DIR choice (--gpu places cudapp +# at cudapp.lock). set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" T=$(mktemp -d); trap 'rm -rf "$T"' EXIT @@ -29,23 +30,29 @@ mk() { # mk NAME [FILE CONTENT]...: a one-commit repo under $T/mirror/NAME, prin [ -n "$(ls -A "$d" | grep -v '^.git$')" ] || : > "$d/.keep" git -C "$d" add -A; git -C "$d" -c user.name=t -c user.email=t@t commit -q -m pin; git -C "$d" rev-parse HEAD } -P=$(mk physics); A=$(mk aienos); O=$(mk omega physics.lock "$P" aienos.lock "$A") -mkdir -p "$T/root"; printf '%s\n' "$O" > "$T/root/omega.lock" +P=$(mk physics); A=$(mk aienos); O=$(mk omega physics.lock "$P" aienos.lock "$A"); C=$(mk cudapp) +mkdir -p "$T/root"; printf '%s\n' "$O" > "$T/root/omega.lock"; printf '%s\n' "$C" > "$T/root/cudapp.lock" run() { AIEN_PINS_ROOT="$T/root" AIEN_PINS_REMOTE_BASE="$T/mirror" bash "$ROOT/scripts/pins.sh" "$@"; } echo "test-pins: full run against a local mirror" chk 'run "$T/pins" >/dev/null' "pins.sh materializes omega, physics, aienos" chk '[ "$(git -C "$T/pins/omega" rev-parse HEAD)" = "$O" ]' "omega at omega.lock" chk '[ "$(git -C "$T/pins/physics" rev-parse HEAD)" = "$P" ]' "physics at omega physics.lock" chk '[ "$(git -C "$T/pins/aienos" rev-parse HEAD)" = "$A" ]' "aienos at omega aienos.lock" -chk 'grep -q "AIEN_OMEGA_COMPOSE_DIR=.*pins/omega" "$T/pins/env.sh" && grep -q "unset AIEN_OMEGA_DIR" "$T/pins/env.sh"' "env.sh: composition only without --gpu" -chk 'run --gpu "$T/pins" >/dev/null && grep -q "export AIEN_OMEGA_DIR=.*pins/omega" "$T/pins/env.sh"' "env.sh: --gpu sets AIEN_OMEGA_DIR" +chk 'grep -q "AIEN_OMEGA_COMPOSE_DIR=.*pins/omega" "$T/pins/env.sh" && grep -q "unset AIEN_CUDAPP_DIR" "$T/pins/env.sh" && ! grep -q "export AIEN_OMEGA_DIR" "$T/pins/env.sh"' "env.sh: composition only without --gpu" +chk '[ ! -e "$T/pins/cudapp" ]' "no cudapp checkout without --gpu" +chk 'run --gpu "$T/pins" >/dev/null && grep -q "export AIEN_CUDAPP_DIR=.*pins/cudapp" "$T/pins/env.sh" && grep -q "unset AIEN_OMEGA_DIR" "$T/pins/env.sh"' "env.sh: --gpu sets AIEN_CUDAPP_DIR, never AIEN_OMEGA_DIR" +chk '[ "$(git -C "$T/pins/cudapp" rev-parse HEAD)" = "$C" ]' "cudapp at cudapp.lock with --gpu" chk 'grep -q "AIEN_REQUIRE_NATIVE_LIBS=1" "$T/pins/env.sh"' "env.sh: stubs refused (AIEN_REQUIRE_NATIVE_LIBS=1)" chk 'run --check "$T/pins" >/dev/null' "--check passes when every clone is at its pin" +chk 'run --gpu --check "$T/pins" >/dev/null' "--gpu --check passes when cudapp is at its pin" echo "test-pins: refusals" git -C "$T/pins/physics" -c user.name=t -c user.email=t@t commit -q --allow-empty -m drift rc=0; run --check "$T/pins" >/dev/null 2>&1 || rc=$? chk '[ "$rc" -eq 3 ]' "--check refuses a checkout off its pin (exit 3, got $rc)" chk 'run "$T/pins" >/dev/null && [ "$(git -C "$T/pins/physics" rev-parse HEAD)" = "$P" ]' "a full run moves it back to the pin" +git -C "$T/pins/cudapp" -c user.name=t -c user.email=t@t commit -q --allow-empty -m drift +rc=0; run --gpu --check "$T/pins" >/dev/null 2>&1 || rc=$? +chk '[ "$rc" -eq 3 ]' "--gpu --check refuses cudapp off cudapp.lock (exit 3, got $rc)" printf 'not-a-sha\n' > "$T/root/omega.lock" rc=0; run "$T/pins" >/dev/null 2>&1 || rc=$? chk '[ "$rc" -eq 3 ]' "malformed omega.lock refused (exit 3, got $rc)" diff --git a/scripts/test-release-checks.sh b/scripts/test-release-checks.sh index cb2839d0..0e89f2c7 100755 --- a/scripts/test-release-checks.sh +++ b/scripts/test-release-checks.sh @@ -28,7 +28,7 @@ pass() { echo "ok: $*"; } T="$W/tree"; mkdir -p "$T/scripts" "$T/release" "$W/bins" cp "$ROOT/scripts/check-release-candidate.sh" "$ROOT/scripts/package-release.sh" "$ROOT/scripts/verify-release-assets.sh" "$T/scripts/" echo licence > "$T/LICENSE"; echo notice > "$T/NOTICE"; echo third > "$T/THIRD_PARTY.md"; echo constitution > "$T/CONSTITUTION.md"; echo readme > "$T/README.md"; echo '#!/bin/sh' > "$T/install.sh" -OM=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +OM=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; CU=eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee PR=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; CS=cccccccccccccccccccccccccccccccccccccccc; SC=dddddddddddddddddddddddddddddddddddddddd H64() { printf '%064d' "$1"; } for b in aien-cli spark-cockpit-rs spark-inquisitor cortex-encoder-rs cortex-rs spark-supervisor spark-debugger; do @@ -39,6 +39,7 @@ write_candidate() { # aien-digest cat > "$T/release/candidate.toml" < "$T/omega.lock" + echo "$CU" > "$T/cudapp.lock" { echo "[[package]]"; echo "source = \"git+https://github.com/aien-dev/aien-protocols?rev=$PR#$PR\"" echo "[[package]]"; echo "source = \"git+https://github.com/aien-dev/crumb-spec?rev=$CS#$CS\"" @@ -80,6 +82,9 @@ must_pass; pass "matching tree accepted" # source pins echo "$(H64 9 | cut -c1-40)" > "$T/omega.lock"; must_fail "omega.lock is"; write_locks; pass "omega.lock mismatch rejected" +echo "$(H64 8 | cut -c1-40)" > "$T/cudapp.lock"; must_fail "cudapp.lock is"; write_locks; pass "cudapp.lock mismatch rejected" +rm "$T/cudapp.lock"; must_fail "cudapp.lock is missing"; write_locks; pass "missing cudapp.lock rejected" +echo short > "$T/cudapp.lock"; must_fail "does not hold one full commit hash"; write_locks; pass "malformed cudapp.lock rejected" sed -i "s/crumb-spec?rev=$CS#$CS/crumb-spec?rev=$SC#$SC/" "$T/Cargo.lock"; must_fail "consumes crumb-spec"; write_locks; pass "Cargo.lock crumb-spec mismatch rejected" sed -i "s/aien-protocols?rev=$PR#$PR/aien-protocols?rev=$CS#$CS/" "$T/Cargo.lock"; must_fail "consumes aien-protocols"; write_locks; pass "Cargo.lock aien-protocols mismatch rejected" echo "source = \"git+https://github.com/aien-dev/spark-crumbs?rev=$PR#$PR\"" >> "$T/Cargo.lock"; must_fail "several revisions of spark-crumbs"; write_locks; pass "two revisions of one pin rejected" diff --git a/scripts/test-release-real-tree.sh b/scripts/test-release-real-tree.sh index b1b78a92..f84c5213 100755 --- a/scripts/test-release-real-tree.sh +++ b/scripts/test-release-real-tree.sh @@ -42,7 +42,7 @@ sha() { sha256sum "$1" | cut -d' ' -f1; } # fixture: the real manifest and locks, the real gate and packager, throwaway binaries T="$W/tree"; mkdir -p "$T/scripts" "$T/release" "$W/bins" cp "$ROOT/scripts/check-release-candidate.sh" "$ROOT/scripts/package-release.sh" "$T/scripts/" -cp "$ROOT/release/candidate.toml" "$T/release/"; cp "$ROOT/Cargo.lock" "$T/" +cp "$ROOT/release/candidate.toml" "$T/release/"; cp "$ROOT/Cargo.lock" "$ROOT/cudapp.lock" "$T/" # The fixture tree is the candidate's tree: omega.lock is the candidate's omega-commit, not this revision's. Main may # move ahead of the candidate; whether THIS revision is releasable is reported (not enforced) by release-dry-run.yml, # and enforced at tag time by release.yml. diff --git a/scripts/whole_system_e2e.sh b/scripts/whole_system_e2e.sh index c745483b..1c79aea7 100755 --- a/scripts/whole_system_e2e.sh +++ b/scripts/whole_system_e2e.sh @@ -417,8 +417,8 @@ if [ -n "$ARTIFACT" ]; then GPUX=(env -u AIEN_DEV_FALLBACK -u AIEN_OMEGA_CTA_BUDGET -u AIEN_OMEGA_SPIN_US AIEN_GPU_BACKEND=omega AIEN_REQUIRE_BLACKWELL=1) fi elif [ "$MODE" = gb10 ]; then - # G1: the pinned GPU engine, as the sc#94 release golden path (sc#92, sc#375); env.sh sets AIEN_OMEGA_DIR and - # AIEN_REQUIRE_NATIVE_LIBS=1 (a stub engine is a build error) and unsets AIEN_DEV_FALLBACK and the archive overrides. + # G1: the pinned GPU engine, as the sc#94 release golden path (sc#92, sc#375); env.sh sets AIEN_CUDAPP_DIR (CUDApp at + # cudapp.lock) and AIEN_REQUIRE_NATIVE_LIBS=1 (a stub engine is a build error) and unsets AIEN_DEV_FALLBACK and the archive overrides. PINS=$D/pins bash "$REPO/scripts/pins.sh" --gpu "$PINS" >"$D/pins.txt" 2>&1 || { echo "pins.sh --gpu failed, see $D/pins.txt" >&2; exit 2; } ( cd "$REPO" && . "$PINS/env.sh" && CARGO_TARGET_DIR="$TGT" cargo build --release -p aien-cli ) >"$D/build.log" 2>&1 \ @@ -428,16 +428,17 @@ elif [ "$MODE" = gb10 ]; then [ "$ZC" = 0 ] || { echo "zero-CUDA gate exit $ZC, see $D/zero-cuda-gate.txt; refusing" >&2; exit 2; } pin_of() { git -C "$PINS/$1" rev-parse HEAD 2>/dev/null; } lock_of() { tr -d '[:space:]' <"$1" 2>/dev/null; } - P_OM=$(pin_of omega); P_PH=$(pin_of physics); P_AO=$(pin_of aienos) + P_OM=$(pin_of omega); P_PH=$(pin_of physics); P_AO=$(pin_of aienos); P_CU=$(pin_of cudapp) { [ -n "$P_OM" ] && [ "$P_OM" = "$(lock_of "$REPO/omega.lock")" ] && [ "$P_PH" = "$(lock_of "$PINS/omega/physics.lock")" ] \ - && [ "$P_AO" = "$(lock_of "$PINS/omega/aienos.lock")" ]; } || { echo "pinned checkouts differ from their lock files" >&2; exit 2; } - PINS_JSON=$(jq -nc --arg o "$P_OM" --arg p "$P_PH" --arg a "$P_AO" '{omega:$o, physics:$p, aienos:$a, source:"scripts/pins.sh --gpu: omega.lock, then physics.lock and aienos.lock of that omega"}') + && [ "$P_AO" = "$(lock_of "$PINS/omega/aienos.lock")" ] \ + && [ -n "$P_CU" ] && [ "$P_CU" = "$(lock_of "$REPO/cudapp.lock")" ]; } || { echo "pinned checkouts differ from their lock files" >&2; exit 2; } + PINS_JSON=$(jq -nc --arg c "$P_CU" --arg o "$P_OM" --arg p "$P_PH" --arg a "$P_AO" '{cudapp:$c, omega:$o, physics:$p, aienos:$a, source:"scripts/pins.sh --gpu: cudapp.lock (GPU engine); omega.lock, then physics.lock and aienos.lock of that omega (composition)"}') NVDRV=$(head -1 /proc/driver/nvidia/version 2>/dev/null | tr -s ' ' | cut -c1-200) [ -n "$NVDRV" ] || { echo "no /proc/driver/nvidia/version: no NVIDIA driver loaded" >&2; exit 2; } # G2: every daemon start: a missing engine is fatal (never a CPU fallback); launch tuning left at the daemon defaults. GPUX=(env -u AIEN_DEV_FALLBACK -u AIEN_OMEGA_CTA_BUDGET -u AIEN_OMEGA_SPIN_US AIEN_GPU_BACKEND=omega AIEN_REQUIRE_BLACKWELL=1) else -( cd "$REPO" && env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_FORCE_CPU_STUB \ +( cd "$REPO" && env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_FORCE_CPU_STUB \ AIEN_OMEGA_COMPOSE_LIB="$LIB" CARGO_TARGET_DIR="$D/target" cargo build --release -p aien-cli ) >"$D/build.log" 2>&1 \ || { echo "build failed, see $D/build.log" >&2; exit 2; } grep -q "building the stub" "$D/build.log" && { echo "stub compose build; refusing" >&2; exit 2; } @@ -460,7 +461,7 @@ RUN=$D/run; [ -e "$RUN" ] && mv "$RUN" "$RUN.old-$(date +%s)" fi mkdir -p "$RUN"/{state,compose,prov,home,logs,ws-contract/inbox,ws-contract/outbox,ws/inbox,ws/outbox} "$OUT/chain" "$OUT/artifacts" SOCK=$RUN/s; LOGS=$RUN/logs; ART=$OUT/artifacts; WS=$RUN/ws; WSC=$RUN/ws-contract -E=(env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_REQUIRE_BLACKWELL +E=(env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_REQUIRE_BLACKWELL -u AIEN_GPU_BACKEND -u AIEN_MODEL_DIR -u AIEN_MODEL_PATH -u AIEN_TOKENIZER_PATH -u AIEN_FORCE_CPU_STUB -u AIEN_FAULT_HOLD -u AIEN_FAULT_HOLD_FILE -u AIEN_ALLEN_SUBJECT -u AIEN_ALLEN_ADOPT -u AIEN_COMPOSE_MAX_TOKENS -u AIEN_COMPOSE_DOC_MAX_TOKENS @@ -574,7 +575,7 @@ build_subject() { # lineage_hex: host-built fixture subject bound to record 1 of DEMO_SUBJECT_OUT="$SUBJ" DEMO_LINEAGE_HEX="$1" DEMO_SUBJECT_NAME="whole-system-e2e-$SUBJ_N" \ cargo test --release -p aien-allen --test e2e_demo_subject -- --ignored --nocapture 2>&1) else - fx=$(cd "$REPO" && env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR AIEN_OMEGA_COMPOSE_LIB="$LIB" CARGO_TARGET_DIR="$D/target" \ + fx=$(cd "$REPO" && env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR AIEN_OMEGA_COMPOSE_LIB="$LIB" CARGO_TARGET_DIR="$D/target" \ DEMO_SUBJECT_OUT="$SUBJ" DEMO_LINEAGE_HEX="$1" DEMO_SUBJECT_NAME="whole-system-e2e-$SUBJ_N" \ cargo test --release -p aien-allen --test e2e_demo_subject -- --ignored --nocapture 2>&1) fi diff --git a/scripts/whole_system_e2e_faults.sh b/scripts/whole_system_e2e_faults.sh index 58cf17a1..cc9657fd 100755 --- a/scripts/whole_system_e2e_faults.sh +++ b/scripts/whole_system_e2e_faults.sh @@ -44,7 +44,7 @@ DIRTY=$(git -C "$REPO" status --porcelain -- . ":!docs/campaigns/whole-system-e2 [ "$DIRTY" -eq 0 ] || [ -n "${WSE2E_ALLOW_DIRTY:-}" ] || { echo "working tree has $DIRTY uncommitted changes; commit them first" >&2; exit 2; } COMMIT=$(git -C "$REPO" rev-parse HEAD) mkdir -p "$D" -( cd "$REPO" && env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_FORCE_CPU_STUB \ +( cd "$REPO" && env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_FORCE_CPU_STUB \ AIEN_OMEGA_COMPOSE_LIB="$LIB" CARGO_TARGET_DIR="$D/target" cargo build --release -p aien-cli --features aien-cli/fault-hold ) >"$D/build.log" 2>&1 \ || { echo "build failed, see $D/build.log" >&2; exit 2; } grep -q "building the stub" "$D/build.log" && { echo "stub compose build; refusing" >&2; exit 2; } @@ -94,7 +94,7 @@ rcpt() { # step status evidence [fields json] R=""; WS=""; SOCK=""; ART=""; E=(); REPORT="" mkenv() { # row dir R already exists SOCK=$R/s; WS=$D/work/ws # the proposal binds the workspace path, so every row uses the same path (re-seeded per row) - E=(env -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_REQUIRE_BLACKWELL + E=(env -u AIEN_CUDAPP_DIR -u AIEN_OMEGA_DIR -u AIEN_OMEGA_COMPOSE_DIR -u AIEN_OMEGA_GPU_LIB -u AIEN_REQUIRE_BLACKWELL -u AIEN_GPU_BACKEND -u AIEN_MODEL_DIR -u AIEN_MODEL_PATH -u AIEN_TOKENIZER_PATH -u AIEN_FORCE_CPU_STUB -u AIEN_FAULT_HOLD -u AIEN_FAULT_HOLD_FILE -u AIEN_ALLEN_SUBJECT -u AIEN_ALLEN_ADOPT -u AIEN_COMPOSE_MAX_TOKENS -u AIEN_COMPOSE_DOC_MAX_TOKENS diff --git a/tests/gates/run.sh b/tests/gates/run.sh index 64c97cb6..565329a7 100755 --- a/tests/gates/run.sh +++ b/tests/gates/run.sh @@ -22,9 +22,10 @@ # crates/aien-runtime/tests are separate and untouched. # # Pinned sibling sources: the hosted jobs check out omega at omega.lock, physics and aienos at -# omega's own locks, and aien-protocols at two fixed commits (TRN1 and CRB1 vector corpora). -# Here the same commits are materialised under $CARGO_TARGET_DIR/aien-pins (default target/aien-pins) from -# the sibling local clones ../omega ../physics ../aienos ../aien-protocols, offline. +# omega's own locks, and aien-protocols at two fixed commits (TRN1 and CRB1 vector corpora); the +# GB10 steps also use CUDApp at cudapp.lock. Here the same commits are materialised under +# $CARGO_TARGET_DIR/aien-pins (default target/aien-pins) from the sibling local clones ../omega +# ../physics ../aienos ../aien-protocols ../CUDApp, offline. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" cd "$ROOT" @@ -161,13 +162,15 @@ case "$step" in bash scripts/test-linked-compose.sh "$PINS/omega" "$PINS/physics" "$PINS/aienos" ;; # No hosted mirror: GitHub has no GB10. SC-GB10-SERVE-CHAT, the GPU receipt an Alpha needs - # (verify-bundle --require-full, NO_GPU_RECEIPT). Same pinned sources as linked-compose, from the - # siblings, offline; scripts/pins.sh --gpu reuses them and writes the env.sh install.sh sources. + # (verify-bundle --require-full, NO_GPU_RECEIPT). Same pinned sources as linked-compose plus CUDApp + # at cudapp.lock, from the siblings, offline; scripts/pins.sh --gpu reuses them and writes the env.sh + # install.sh sources. gb10-serve-chat) omega_sha="$(tr -d '[:space:]' < omega.lock)" pin omega omega "$omega_sha" pin physics physics "$(tr -d '[:space:]' < "$PINS/omega/physics.lock")" pin aienos aienos "$(awk 'NF && $1 !~ /^#/ {print $1; exit}' "$PINS/omega/aienos.lock")" + pin cudapp CUDApp "$(tr -d '[:space:]' < cudapp.lock)" AIEN_PINS_REMOTE_BASE="$(cd .. && pwd)" AIEN_PINS_REMOTE_SUFFIX="" bash scripts/pins.sh --gpu "$PINS" bash scripts/gb10-serve-chat.sh "$PINS/env.sh" ;; diff --git a/tests/gates/sc-gb10-serve-chat.gate b/tests/gates/sc-gb10-serve-chat.gate index addc815f..74003a1c 100644 --- a/tests/gates/sc-gb10-serve-chat.gate +++ b/tests/gates/sc-gb10-serve-chat.gate @@ -20,6 +20,7 @@ requires: inputs: - scripts/gb10-serve-chat.sh - scripts/pins.sh + - cudapp.lock - tools/serve-27b.sh - tests/gates/ run: diff --git a/tests/gates/sc-native-identity.gate b/tests/gates/sc-native-identity.gate index e7de53f8..978c058a 100644 --- a/tests/gates/sc-native-identity.gate +++ b/tests/gates/sc-native-identity.gate @@ -10,6 +10,7 @@ requires: inputs: - native-artifacts.lock - omega.lock + - cudapp.lock - scripts/test-native-identity.sh - Cargo.toml - Cargo.lock diff --git a/tests/gates/sc-pins-selftest.gate b/tests/gates/sc-pins-selftest.gate index a3c6a2eb..436bc096 100644 --- a/tests/gates/sc-pins-selftest.gate +++ b/tests/gates/sc-pins-selftest.gate @@ -11,6 +11,7 @@ inputs: - scripts/pins.sh - scripts/test-pins.sh - omega.lock + - cudapp.lock - tests/gates/ run: exec: tests/gates/run.sh diff --git a/tools/aien-local-ci/pins b/tools/aien-local-ci/pins index 0e82450d..73e63b00 100644 --- a/tools/aien-local-ci/pins +++ b/tools/aien-local-ci/pins @@ -4,6 +4,6 @@ # branch must be fetched by its sha on the trusted side first. The worker fetches a missing one from the # trusted clone's own origin and holds it as refs/remotes/aien-pins/ (wt.sh sync copies that ref # into the mirror). Read from the operator's trusted sc clone, beside `siblings`; never from the head. -# Pins that come from lock files (omega.lock and the locks inside it) are not listed: they follow main. +# Pins that come from lock files (omega.lock and the locks inside it, cudapp.lock) are not listed: they follow main. aien-sovereign-core aien-protocols 353b7d4be3f00169545caec1615cffa61f7d311a # SC-TRN1 corpus aien-sovereign-core aien-protocols b50c00d737fa5c57ea7280e2aa4b0354ff166cf5 # SC-CRB1 corpus diff --git a/tools/aien-test/docs/LOCAL_VERIFICATION.md b/tools/aien-test/docs/LOCAL_VERIFICATION.md index df2c125e..06b42707 100644 --- a/tools/aien-test/docs/LOCAL_VERIFICATION.md +++ b/tools/aien-test/docs/LOCAL_VERIFICATION.md @@ -307,7 +307,7 @@ commit by its sha from the trusted clone's own `origin` and holds it as `refs/remotes/aien-pins/`, so `wt.sh sync` copies it into the mirror and git never prunes it. A pin that cannot be made present is a journal note; the gate that needs it then fails, never PASS. Pins read from lock files (omega's -`omega.lock` and the locks inside it) follow main and are not listed. +`omega.lock` and the locks inside it, and `cudapp.lock`) follow main and are not listed. Model gates (PREFILL-E2E-2 and its eight mutant gates, `requires: host`) read the TinyLlama-1.1B-Chat-v1.0 checkpoint at `$HOME/models/TinyLlama-1.1B-Chat-v1.0`