﻿# EXR training loaders: preflight image dimensions before allocating worker memory

Plan OpenEXR decoding memory from headers and decoded arrays rather than compressed file size, using version-appropriate dimension limits and bounded loader concurrency.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-openexr-header-preflight-worker-memory-budget/
Language: en

## Budget for decoded data

A compressed render output can be small on disk while expanding into large pixel arrays. Training input workers may hold several decoded samples, transformed copies and queued batches at once. Estimate that working set before increasing worker count to keep a GPU busy. Distinguish process RAM from device memory: a model can fit on the GPU while its image-decoding stage fails in host memory before a batch reaches the device.

## Inspect metadata before a full read

The [Python module reference](https://openexr.com/en/latest/python.html) documents a header-only read that avoids allocating full pixel arrays. Inspect dimensions, part count, channel types and storage characteristics before deciding to decode a sample. Header inspection is a planning step, not an exact peak-memory measurement. Deep sample counts, decompression buffers and later transformations can add allocations beyond an estimate based only on the flat image dimensions and expected model input shape.

## Use dimension limits appropriate to the deployment

The same reference describes Python dimension-limit controls introduced in version 3.5. Check the installed binding before using them. The [C++ I/O guide](https://openexr.com/en/latest/ReadingAndWritingImageFiles.html) documents corresponding image and tile limits. Configure limits before reads and keep them appropriate to legitimate data. A width-and-height ceiling does not guarantee that every accepted multipart or deep file will fit into a worker's total memory budget under concurrent loading.

## Account for representation changes

The [technical introduction](https://openexr.com/en/latest/TechnicalIntroduction.html) distinguishes channel types and image storage modes. A later conversion can increase element size or create additional arrays even when the decoded source is manageable. Include normalization, resizing, contiguous tensor copies and prefetch queues in the measurement. Avoid inferring the full cost from the final tensor alone, since temporary host allocations may coexist with decoded channels and batches waiting for transfer.

## Validate under realistic concurrency

Measure peak host memory and input throughput with the intended number of workers and representative large samples. Repeat with a sample near the configured dimension boundary. The guides to [render capacity](/journal/render-farm-idle-gpus/) and [renderer compatibility](/journal/gpu-llm-renderer-compatibility-matrix/) provide related operational context. A useful loader configuration combines metadata preflight, documented acceptance limits and a measured concurrency budget; increasing readers should be justified by actual GPU feeding performance rather than the apparent smallness of compressed files.
