Repository navigation
qwen27 metal: a keep that fails part way ends its encoder, so the error returns instead of aborting the process - #2376
Conversation
|
Thanks @jschmied, a clean find, and the failing-allocator tool is a good check. One thing: And please rebase the CHANGELOG line onto current Unreleased, ending "(#2376). Thanks to @jschmied." |
6cf5164 to
19fa70f
Compare
|
Thanks @ashhart, you're right, the unguarded form could end the encoder twice. Both are done on
Two limits on that test. It can't tell a double end apart, because this M3 Pro doesn't flag a second Main still aborts with exit 134. |
|
Thanks @jschmied, that's the guarded form, with |
…or returns instead of aborting the process Runner.keep opens its command encoder before the per-layer commits and keep uploads; any error after that left the encoder open, and the objc pool's release then asserted "Command encoder released without endEncoding", so the process aborted and the error was lost. A guarded errdefer ends it, as qwen27_keep's other keep sites do, so the errors after the encoder's own end (a GPU failure, a refused path) don't end it twice. tf-qwen27-keep-error fails each of the keep's allocations in turn on a synthetic model: on main it aborts, here each returns OutOfMemory and the same round keeps on retry; then a refused path after the end returns BadPath. Found on the pipeline stage path (ashhart#2005).
19fa70f to
511f375
Compare
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Thanks @jschmied! This is in TensorFold 1.2.4, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.4 |
What this changes
Runner.keepopens its command encoder before the per-layer GDN commits and attention keep uploads. Any error after that point (an allocation, a refused keep) used to leave the encoder open. The objc pool's release then assertedCommand encoder released without endEncoding: the process aborted, and the error never reached the caller. Now a guardederrdefer if (!ended) e.end();, as innative/qwen27_keep.zig, closes it. The error returns and the same round can keep again, and the errors after the encoder's own end (error.RoundGpuFailure, a refused path) don't end it twice.AttentionKeep.Checks on this head
zig build tf-qwen27-keep-error && tf-qwen27-keep-error(new). On main it aborts with the assertion, exit 134. On this head:PASS a keep failing at each of its 6 allocations returns OutOfMemory and keeps on retry; a refused path after the encoder ends returns BadPath, with and withoutMTL_DEBUG_LAYER=1. This can't tell a double end apart: this Mac doesn't flag a secondendEncodingeven with validation on, so the unguarded form passes too.RoundGpuFailurecan't be injected, so that path is unexercised.zig build test --summary all: 715/715 steps.zig fmt --checkandgit diff --checkare clean.Receipt
Runner.keep's error path only. A keep that succeeds runs the same commands as before.Checklist