﻿# ONNX CUDA offload budgets: a session-wide device cap is broader than the BFC arena limit

The v0.4.0 offload cap covers session CUDA allocations beyond the BFC arena; budget groups coordinate target and draft only within the supported allocator path.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-ort-moe-session-device-cap-budget-group/
Language: en

CUDA Plugin EP v0.4.0 distinguishes a session-wide offload device-memory limit from gpu_mem_limit, which caps the BFC arena. It also provides budget groups for target and draft sessions. The accounting boundary matters: limiting one allocator subsystem is not equivalent to limiting all device allocations made through the session’s CUDA allocators.

## Name the allocation set being capped

A memory setting is interpretable only with its accounting scope. The release explicitly contrasts the offload cap with the arena limit. A proposed test records allocations inside and outside the arena under a constrained session, then checks the documented cap behaviour. Do not infer a whole-process memory guarantee from either number: driver resources and allocations outside the supported session path can have a different ownership boundary.

## Target and draft can consume one device together

Speculative decoding commonly places two sessions on one GPU. Independent generous limits can each look reasonable while their sum is not. The budget-group feature provides a shared accounting mechanism for that configuration. A qualification should test both initialization orders and overlapping work, with the same group identifier and actual device. Two sessions on different devices do not test the contention the shared budget is intended to address.

## Allocator exclusions are real compatibility conditions

The release states that this limit is unsupported with external CUDA allocators or CUDA memory pools. An application using those mechanisms must not assume the same accounting applies. Preserve allocator configuration with the model record and test the expected rejection or unsupported outcome. Replacing an allocator for a benchmark changes the system being evaluated, so a result from the default allocator cannot validate the excluded production configuration.

## Accounting success is not a quality result

A bounded accepted plan still needs numerical tests and workload-specific latency measurements. Smaller budgets can change expert placement and transfer work without changing the intended model function. This article reports the two accounting boundaries and shared-session use case, without claiming a universal no-OOM guarantee or independent benchmark. The practical record is the cap, allocator mode, group membership and measured workload together.

## 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 #33451](https://github.com/microsoft/onnxruntime/pull/33451)

## Related reading

- [CUDA OOM Allocated vs Reserved: Read the Evidence](/journal/cuda-oom-reserved-vs-allocated/)
- [CUDA Out of Memory with Concurrent Requests](/journal/cuda-oom-concurrent-requests/)
