Skip to content

feat(colgrep): support AMD GPU indexing in Linux releases - #202

Closed
OmerFarukOruc wants to merge 2 commits into
lightonai:mainfrom
OmerFarukOruc:feat/migraphx-linux
Closed

OmerFarukOruc wants to merge 2 commits into
lightonai:mainfrom
OmerFarukOruc:feat/migraphx-linux

Conversation

@OmerFarukOruc

@OmerFarukOruc OmerFarukOruc commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Enable AMD encoding in the existing Linux x86_64 release (mkl,cuda,migraphx) with a managed ONNX Runtime. Provider failures propagate under --force-gpu; MIGraphX encoding keeps clustering/compression on CPU. The teardown fix retains the provider mapping and the CLI exits normally.

The slowdown investigation found repeated compilation for dynamic shapes. Stable GPU batch rows and a model/shape/device-specific compiled-program cache reuse those programs across processes and cleared indexes. It also found incorrect asymmetric INT8 arithmetic in MIGraphX 7.1.1 (255 × 1 returned -1). The runtime now applies an exact INT32 zero-point correction; unsupported integer forms use CPU fallback. Quantized GPU execution requires the corrected runtime even with caching disabled.

Matched INT8 trial on Fedora 44, RX 7900 XTX (gfx1100), ROCm/MIGraphX 7.1.1; pinned LateOn-Code-edge revision 4bcdf5ed93f791259eb130b577a240f753d68dd8. Input /home/oruc/Desktop/workspace/nixos-config remained at a5323f7d1b7d69596b5033af366687a838e11a43, with the same two untracked directories. All three cleared isolated indexes have identical content hashes and metadata: 157 files, 1,053 code units, 91,556 embeddings.

Run Total indexing Exit
v1.8.5 CPU, --force-cpu 9.440 s 0
GPU, empty compiled-program cache 236.730 s 0
GPU, cached programs, new index 12.522 s 0

Cached GPU remains 32.64% slower than CPU here; cold GPU is 25.08× slower. This is one matched trial, with downloads excluded and GPU-only ORT profiling/ROCm sampling. First compilation remains expensive. The five saved programs were unchanged in the cached run. The previous 57× result used incorrect GPU INT8 arithmetic and different input; its timings are superseded, not a valid speedup baseline. The private v1.8.5 baseline is byte-identical to the former installed binary; the install/settings/cache had been removed externally and remain absent.

Both GPU profiles contain 25 MIGraphX inference events; model_run totals are 235.935 s cold / 11.912 s cached. Timestamped rocm-smi --showpids captures colgrep PIDs 664162 / 693720 during encoding. Managed-cache indexing also exits 0 with ORT_DYLIB_PATH unset and records 25 MIGraphX events.

TASK=/home/oruc/Documents/Codex/2026-10-14/goal-an-upstream-pull-request-to
export LD_LIBRARY_PATH="$TASK/work/fedora-root/usr/lib64"
export HF_HOME="$TASK/work/slowdown/matched-r4-landing/huggingface"
ORT_DYLIB_PATH="$TASK/work/slowdown/managed-r4/onnxruntime-linux-x64-migraphx-1.23.1-rocm7.1.1-r4/lib/libonnxruntime.so.1.23.1" \
COLGREP_DATA_DIR="$TASK/work/slowdown/matched-r4-landing/gpu-cold-data" \
NEXT_PLAID_MIGRAPHX_CACHE_DIR="$TASK/work/slowdown/matched-r4-landing/model-cache" \
NEXT_PLAID_ORT_PROFILE="$TASK/work/slowdown/matched-r4-landing/profiles/gpu-cold" \
"$TASK/work/next-plaid/.slim/worktrees/migraphx-linux/target/release/colgrep" \
  init --force-gpu /home/oruc/Desktop/workspace/nixos-config

Use fresh index/output directories to repeat; the evidence bundle includes the complete CPU/cold-GPU/cached-GPU runner and recorded configuration (fp32=false, hook mode agent). CPU uses ORT 1.23.0. GPU uses ORT 1.23.1-r4, source d9b2048791efb5804fe3d53a04b4971256addebf, built against the pinned official ROCm 7.1.1 Ubuntu 22.04 image. Local packaging reused a complete baseline build and rebuilt the provider incrementally. The PR runtime job performs a clean build without publishing; release publication requires its success. No host package change or reboot occurred; Fedora MIGraphX libraries were extracted privately.

Validation includes 281 exact integer comparisons across 16 real ORT probes, strict nine-document nearest-self checks in MIGraphX-only and combined builds, forced CPU/old-runtime rejection, real FP32 indexing/querying, and HTTP/checksum/companion/cache failure and offline reuse checks. Identical-tensor CPU/GPU embeddings give cosines 0.999252–0.999572. Combined-feature cargo tests, Clippy, the full Linux CLI E2E suite and normal commit hooks pass.

cargo test -p colgrep -p next-plaid-onnx --features colgrep/mkl,colgrep/cuda,colgrep/migraphx
cargo clippy -p colgrep -p next-plaid-onnx --all-targets --features colgrep/mkl,colgrep/cuda,colgrep/migraphx -- -D warnings

Evidence bundle with exact rerun commands, profiles, logs, timings and hashes. The exact runtime and checksum are attached to the validation release. No NVIDIA hardware was available. A pre-existing FP32 If/MatMul MIGraphX failure is recorded as a follow-up and is excluded from successful GPU claims.

Hosted CI and CLI E2E passed for e92888b; the clean runtime build is still running.

Refs: #201

Stabilize MIGraphX batches and cache compiled programs across indexes.
Correct asymmetric integer zero-point arithmetic in the packaged runtime
and require that capability for quantized GPU encoding.

Respect absolute XDG cache roots while retaining offline legacy cache
reuse. Keep CPU clustering and compression and propagate forced GPU errors.

Refs: #201
@OmerFarukOruc OmerFarukOruc closed this by deleting the head repository Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant