﻿# ONNX CUDA shared MoE profiling: share successful tactics without sharing a transient failure

Shared MoE tactics in v0.4.0 coordinate per-key success and retry failures; verify concurrent first use without serializing unrelated profiling problems.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-ort-shared-moe-profiling-success-only/
Language: en

CUDA Plugin EP v0.4.0 shares successful MoE GEMM tactic-profiling results across identically shaped layers within one process. The linked PR coordinates first use per key and deliberately does not share failed profiling outcomes. Avoiding repeated tuning therefore requires both a complete identity key and a retry policy that distinguishes absence of a result from a reusable success.

## Identical dimensions do not complete the key

The profiling decision can depend on device, runner state, epilogue and other parameters beyond a layer’s dimensions. The PR includes those inputs in the shared identity. A proposed unit suite varies runner state while holding shape fixed and confirms distinct entries. A model with repeated layers is a strong positive case, but cannot alone prove that different valid problems remain separated rather than borrowing the first layer’s choice incorrectly.

## A failed profile is not a shared tactic

A transient allocation failure can leave no usable configuration. Sharing that absence process-wide would prevent another instance from retrying under better conditions. The release work shares only successful outcomes. A proposed test makes the first attempt fail through a controlled test seam, then confirms a later profiler tries again. Keep this separate from a permanent unsupported configuration, whose correct handling may be rejection rather than repeated expensive tuning.

## Coordination should be per problem

Concurrent first uses of one key should avoid duplicate tuning, while unrelated keys should not wait behind one long profiling run. A proposed concurrency test holds one key in progress and lets another finish. This checks lock scope as well as cache contents. A single-threaded benchmark cannot expose a global-lock bottleneck, and a reduced profile count alone does not prove unrelated work remains parallel.

## The cache is in-process, not a disk artifact

The PR explicitly limits sharing to one process and separates future persistence. Do not infer cross-restart reuse from the persistent MatMulNBits feature elsewhere in the release. This article reports the success-sharing contract and proposed retry/concurrency cases without new timings. Measure cold first use and warm requests separately, and retain model-output comparisons before claiming a practical initialization benefit.

## Sources

- [ONNX Runtime plugin-ep-cuda/v0.4.0 release](https://github.com/microsoft/onnxruntime/releases/tag/plugin-ep-cuda/v0.4.0)
- [ONNX Runtime pull request #34169](https://github.com/microsoft/onnxruntime/pull/34169)

## Related reading

- [CUDA events and request time: different measurement boundaries](/journal/gpu-cuda-events-wall-time/)
- [ONNX Runtime offline optimization: a saved optimized graph inherits a target contract](/journal/fg2-onnxruntime-offline-graph-target-compatibility/)
