Skip to content

Add native Bolt CUDA package preservation example (no optimization) - #2733

Draft
Rui Ren (rui-ren) wants to merge 2 commits into
microsoft:mainfrom
rui-ren:rui-ren/bolt-cuda-recipe
Draft

Rui Ren (rui-ren) wants to merge 2 commits into
microsoft:mainfrom
rui-ren:rui-ren/bolt-cuda-recipe

Conversation

@rui-ren

Copy link
Copy Markdown

Describe your changes

Add a config-driven, reference-only native-preservation example for an existing local three-component NVIDIA Nemotron 3.5 Bolt CUDA export.

  • Reuse existing CompositeModel and ONNXModel handlers; no framework changes or new pass.
  • Validate the standard RunConfig, resolve decoder/vision_encoder/embedding and bounded package-local external-data references, and round-trip source/GenAI/graph metadata through existing handlers.
  • Stream SHA-256 hashes and write only a reference model config and receipt. Never copy/rewrite/dequantize/requantize native IQ2_XXS, raw Q8_0 or A16 NVFP4 weights.
  • Reject passes/builds, unsupported CPU/stock GenAI/ort-extensions routes, absent CUDA, missing custom ops and CUDA initialization fallback. Default runtime checks create sessions only; --inspect-only explicitly records NOT_CHECKED.
  • Document the prepared-feature/source-bound host prompt-compaction prerequisite, which this example does not implement.

This is not an Olive engine optimization workflow, accuracy evaluator, optimized package, or model-readiness claim. It intentionally does not call olive run with a dummy pass. The source package remains in place and the output is not relocatable.

Validation

  • python -m pytest examples/bolt_native_cuda/test_preserve.py --basetemp=./bolt-recipe-test-artifacts -q: 22 passed (network-free IR-built opaque fixtures; runtime-success branches are mocked, not numerical fixtures).
  • lintrunner: ok No lint issues, including pylint.
  • Package import and olive --help: pass.
  • Read-only native v8 inspection: all 13 files resolved, 24,200,581,839 referenced bytes; all three external-payload SHA-256 values match the export receipt. No model artifact copied.
  • Existing tiny IQ2 fixture executed on assigned GPU3 with corrected ORT 1.32; profiling confirms MatMulGGMLIQ2XXS on CUDA and finite output. This is kernel availability evidence, not full-model accuracy evidence.
  • Stock ORT 1.28 explicitly rejects the tiny fixture because MatMulGGMLIQ2XXS is not registered.
  • Full-package session creation was attempted and bounded/stopped after more than four minutes without a completion result. It is not reported as passing; the final source was separately verified by native inspection and all 22 fixture tests.

Source pin: nvidia/NVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB at c6cc2e8ffa353403213d6b9b18aaf8eb684d705a.
Local native export source: d3ac98d5aa571b0c4c25fd288bd0a36741c342ee.
Corrected CUDA provider SHA-256: 394cc8fadb5006635368e96c8cd0fe124462d1a2a6eb67c3b7fc953f11d19c5d.

Model readiness remains NOT_ESTABLISHED. Earlier hidden/cache failures are not waived. Separate qualification must retain finite outputs, NRMSE <= 0.03, cosine >= 0.999 and exact required-token gates.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass. (22 focused tests pass; full repository/model qualification not claimed.)
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

Release note: Add a read-only, zero-pass native Bolt CUDA package-consumption example using existing Olive model handlers, with preservation receipts and explicit unsupported-runtime/route errors.

(Optional) Issue link

Independent example-only draft; no framework compatibility fix was warranted.

Represent decoder, vision encoder and embedding through existing Olive model handlers. Validate native packed graphs and external-data bounds, retain provenance and assets as references, and fail explicitly for unsupported routes and missing CUDA/custom-op support. Never transform or copy the already quantized payloads.

Add 22 network-free fixture tests and document that preservation/session creation does not establish numerical model readiness. No framework changes or optimization claims.

Signed-off-by: rui-ren <15321482+rui-ren@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Docs CI on 2fcfff6 identified the new main-branch example URL as the sole broken link: the example does not exist on main before merge. Refer to its source-checkout README path without an external pre-merge URL. Preserve all runtime and native-weight behavior.

Validation: existing 22 network-free recipe tests pass with GPUs hidden; lintrunner passes. Original bounded native session evidence remains unchanged.
Signed-off-by: rui-ren <15321482+rui-ren@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rui-ren

Copy link
Copy Markdown
Author

Exact-head CI follow-up: 8e0278ad391fe1a6a6d703d19c590984095878cb fixes one real documentation issue from 2fcfff67: Docs linkcheck returned 404 for the not-yet-merged main/examples/bolt_native_cuda URL. The docs now reference the existing source-checkout README path, without suppressing linkcheck or changing framework/runtime/quantization behavior. Failure log: https://github.com/microsoft/Olive/actions/runs/38829738766/job/116745510608

Existing focused fixtures on the follow-up commit: 22 passed, and lintrunner passed. Validation clarification: the initial GPU-hidden local attempt failed during inherited Torch/Transformers accelerator-discovery imports; rerunning the same mocked/IR-only fixtures with GPU3 visible passed in 3.91 seconds. No fixture executed CUDA kernels and no additional full-model/session run was performed. The follow-up commit message's “with GPUs hidden” phrase is incorrect; this comment and the retained failed/successful logs correct that validation detail.

New-head workflows are running: Docs, Lint, fast tests. CLA passed. No actionable review/inline comments were present. The Azure bot note says authorized /azp run may be needed; no authorization bypass attempted.

The original bounded full-session attempt/evidence is retained unchanged. It produced no numerical result, and must not be treated as a numerical failure or successful inference. Full model readiness remains NOT_ESTABLISHED.

This branch has not been deployed

No deployments
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