-
Notifications
You must be signed in to change notification settings - Fork 40
In order queues #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
In order queues #1060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks! gamess worked fine with this PR. The test |
|
On a fresh re-pull and run, there are no hangs. I do see some fails that aren't present in a pull from develop: All fail with: Did you see these at all? |
8a942a2 to
6dad2aa
Compare
…er events Replace LastEvent tracking with marker-based queue synchronization: - Remove LastEvent_ member and updateLastEvent() from Queue class - Add addDependenciesQueueSync() template that creates marker events in other queues for implicit synchronization between blocking/default streams - Make query() pure virtual, backends implement using native sync APIs Level Zero changes: - Use ZE_COMMAND_QUEUE_FLAG_IN_ORDER for command queues - Implement query() with zeCommandListHostSynchronize zero-timeout check - Move event maintenance from EventMonitor to on-demand in getEventFromPool() - Add createEventDedicated() for callback events (workaround for PVC driver issue with event reuse between immediate and regular command lists) - Get dependencies before locking CommandListMtx to avoid deadlock - Reduce event pool size from 1000 to 10 OpenCL changes: - Track IsEmptyQueue_ to handle query() for never-used queues - Implement addDependenciesQueueSync() with cl_event markers - Rework callback mechanism to use marker enqueued from callback thread instead of user events (workaround for Intel driver bug) Other: - Add checkEvents() virtual method to Context for event processing - Fix Device destructor to avoid holding multiple locks simultaneously - Remove L0CollectEventsTimeout env var (no longer needed) - TestBufferDevAddr now conditional on OpenCL backend
This PR refactors the queue synchronization system to replace the previous "last event tracking" approach with a more robust event dependency system. The changes eliminate race conditions and simplify the synchronization logic.
Key Changes
1. Queue Synchronization Refactor
Removed Components:
LastEvent_member variable fromQueueclassLastEventMtxmutex for protecting last event accessupdateLastEvent()method for updating last event referencesgetLastEvent()andgetLastEventNoLock()methodsgetSyncQueuesLastEvents()method for collecting synchronization eventsAdded Components:
addDependenciesQueueSyncImpl()template method for creating event dependencies2. Device Destruction Ordering Fix
Before:
After:
3. Event Management Improvements
Added Methods:
checkEvents()virtual method to baseContextclass (default no-op implementation)checkEventsForAllContexts()method toBackendclass for processing events across all contextsRemoved Calls:
updateLastEvent(nullptr)calls from queue removal pathsupdateLastEvent(nullptr)calls from cleanup routines4. Queue Query Interface Changes
Before:
After:
Technical Details
Event Dependency System
The new
addDependenciesQueueSyncImpl()template method:Key Features:
Synchronization Logic
Default Streams (Legacy/Per-Thread):
Blocking Queues: