In this article
Workspace query mode records requirements for the intended calls; it does not execute the solve or justify sharing scratch across concurrent operations.
Describe the sequence before budgeting scratch
A factorization followed by a solve can reuse temporary memory when the operations execute in the intended sequence on the same handle stream. Adding every independently reported temporary size may overstate the reusable requirement. Conversely, taking one observed size from an unrelated shape can understate it. Specify the actual operations, problem dimensions and handle configuration whose requirement the application intends to provision before replacing automatic workspace management.
Use the library’s query boundary
The rocSOLVER memory-model guide explains how rocBLAS query mode collects requirements for a selected sequence. The documented query calls describe sizes without performing the real numerical computation. Keep query-mode entry and exit paired, and do not treat untouched outputs from a sizing pass as a completed factorization. A diagnostic can verify that the numerical execution occurs later with valid allocated input and output storage.
Understand why the result is a maximum
The rocBLAS helper reference documents collecting the maximum optimal device-memory requirement because sequential calls can reuse scratch on the same stream. That reasoning does not authorize sharing one buffer between independently concurrent handles or streams. Preserve the intended execution relationship with the resulting allocation record rather than storing a bare byte count detached from the sequence that produced it.
Bind and release user-owned storage deliberately
The rocBLAS allocation reference describes user-owned workspace and insufficient-memory behavior. After allocating the required storage, bind it through the documented handle interface and retain it until its users complete. Detach it before releasing its backing allocation. Changing ownership is a state transition for future library calls, not evidence that earlier asynchronous work has ceased accessing the same memory.
Requery when the problem contract changes
Exercise a larger shape and a changed operation sequence to confirm the application updates its requirement before reuse. Test concurrent execution separately with independent ownership. The existing stream-dependency guide and software reproducibility guide provide context. A useful memory budget therefore records the query sequence, shape, library configuration and lifetime boundary, distinguishing reusable sequential scratch from aggregate memory needed by simultaneous work.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.