Repository navigation
D3D12 executor: re-measure a network larger than the default arena (Model L 4K native no longer falls back to HIP) - #195
Merged
Conversation
… in a 4095 MiB arena (Fixes #182) Model L at 3840x2160 native needs 2738 MiB of native D3D12 arena. The executor measured the network in the default 2560 MiB arena, ran out, and handed the context to the HIP executor, whose process keeps HIP's instance and the pooled imported arena after the context is destroyed (+1419 MiB, constant per cycle). The measure is now repeated in a 4095 MiB arena (WG_D3D12_ARENA_MB's upper bound) when the default one runs out and WG_D3D12_ARENA_MB is not set; the retry and its outcome are logged. Contexts that fit the default arena take the same path as before. Record: clean/l/records/issue182_create_destroy_record.json (5 create/destroy cycles each, Model L and Model M at 4K native and 4K Quality: executor dx12 in every cycle, +2 MiB after every destroy; control with the retry off: executor hip, +1419 MiB). Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…ncoder fusion); same figures Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #182
Model L at 3840x2160 native now runs on the D3D12 executor and returns to baseline after destroy.
Cause
The memory is not held by a Model L allocation. The D3D12 executor makes the network's allocations twice: pass 1
measures the arena, pass 2 allocates exactly that size. Pass 1 ran in the default arena (
WG_D3D12_ARENA_MB,2560 MiB). Model L at 4K native needs 2738 MiB, so pass 1 ran out ("native D3D12 arena exhausted for 267386880 bytes;
WG_D3D12_ARENA_MB is 2560"), and the front end gave the context to the HIP executor.
HIP keeps memory until the process ends: its own instance, plus the pooled imported arena (633 MiB). This is HIP
runtime behaviour, documented in
clean/FORMATS.md, "Context teardown and re-creation". That is the constant+1419 MiB after every destroy in #182.
In the #85 records, every run that kept memory ran on
executor hip, and every run that returned ran onexecutor dx12. Model M "returned" only because it never needed HIP.Change (
clean/runtime/interop/executor_d3d12.cpp; no kernels touched)WG_D3D12_ARENA_MB'supper bound). Pass 2 then allocates exactly the measured size.
WG_D3D12_ARENA_MBis set.D3D12 executor: the network does not fit the default arena (...); measuring again in a 4095 MiB arenaD3D12 executor: measured in the 4095 MiB arena: the network needs 2738 MiB; the D3D12 executor runs it in an arena of that sizemeasuring again in a 4095 MiB arena failed (...)instance and the pooled imported arena until it ends, as FORMATS.md documents. This PR does not change that path.
clean/FORMATS.md: a paragraph on the arena measure, the retry, its log lines and the HIP fallback's residue.Suggested title for #182: "Model L at 4K native falls back to HIP (arena measure in 2560 MiB)".
Record (
clean/l/records/issue182_create_destroy_record.json)GPU: RX 9070 XT (gfx1201). Harness:
test_dll_d3d12 resize_real, 5 create/destroy cycles each, no resize.Process memory: DXGI local segment, this process only. Built from this branch merged with main, one GPU run at a
time through
gpu_slot.py. Models: synthetic files from the repository's generators; memory depends on thenetwork's shapes, not on the values.
WG_D3D12_ARENA_MB=2560(no re-measure)Model M unchanged: no re-measure line in either Model M run, and the same runtime-reported memory as the #85
record (933 MiB at 4K Quality, 1590 MiB at 4K native).
The control reproduces #182 exactly (+1419 MiB, constant, HIP), so the fix is the only difference.
Tested / Not tested
and the failure is logged.