mirror of
https://github.com/Comfy-Org/comfy-aimdo.git
synced 2026-11-04 23:37:21 +00:00
[PR #77] [CLOSED] Synchronize CUDA before VBAR fault eviction #104
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-aimdo#104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/77
Author: @I-spyne-I
Created: 7/26/2026
Status: ❌ Closed
Base:
master← Head:agent/fix-vbar-fault-sync📝 Commits (1)
825b7a5Synchronize CUDA before VBAR fault eviction📊 Changes
1 file changed (+7 additions, -0 deletions)
View changed files
📝
src/model-vbar.c(+7 -0)📄 Description
What changed
Add a CUDA context synchronization boundary at the start of
vbar_fault(), after selecting the AIMDO device context and before any budget-driven residency changes can occur.Root cause
vbar_fault()can run while a kernel launched for the preceding layer is still consuming VBAR-backed pages. Its budget enforcement path may then evict and unmap those pages. That creates a use-after-unmap race in the CUDA virtual-memory layer, which can manifest as nondeterministic inference corruption, a stuck first sampler step, or a WindowsnvlddmkmTDR/reset rather than a recoverable Python exception.This is the remaining unsynchronized residency boundary described in #65; the other major unmap paths already synchronize around their changes.
Impact
The synchronization trades some asynchronous overlap at model page-fault boundaries for deterministic page-lifetime safety. It does not alter exported APIs, page accounting, or wheel compatibility.
Validation
v0.4.10release commit (ace72ab).src/model-vbar.c.Addresses #65.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.