Repository navigation
Conversation
With the upstream i915 kernel driver, which lacks VM_BIND, NEO doesn't use direct submission, and every submission is a system call: launching a trivial kernel and synchronizing takes ~56 µs on an Arc A770, often twice that (#756). Forcing it on through NEO's debug keys brings that down to ~12 µs, but each process with a polling ring delays other processes on the GPU by a time slice per round, so it is opt-in: the `direct_submission` preference, or ONEAPI_DIRECT_SUBMISSION. NEO reads its settings when it is loaded, so the keys are set before oneAPI.jl loads NEO, which it now does itself before zeInit, and are removed again afterwards so child processes don't inherit them. This needs a NEO_jll that doesn't load the driver in its __init__; with one that does, oneAPI.jl warns that the setting can't apply.
Contributor
|
Documentation preview: https://juliagpu.github.io/oneAPI.jl/previews/PR793/ |
This branch has not been deployed
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.
Launching a trivial kernel and synchronizing takes ~56 µs on an Arc A770 with the upstream i915 kernel driver, often twice that (#756). Almost all of that is in the driver: appending a launch to an immediate command list costs ~17 µs of host time, and
zeCommandListHostSynchronize~39 µs (p90 ~110 µs), against ~2 µs that oneAPI.jl adds. NEO submits work with a system call there, because it only uses direct submission (a ring buffer the GPU polls) when the kernel driver has VM_BIND, i.e. withxeor Intel's out-of-tree i915.NEO's debug keys
NEOReadDebugKeys=1 EnableDirectSubmission=1force it on, with i915 in a variant meant for kernel drivers without VM_BIND, which Intel ships for some integrated GPUs. On the A770 that brings launch+sync to ~12 µs without outliers, also after the host has been idle. It is not free for others, though: to the GPU scheduler a polling ring is a busy context, so every process with one delays the other processes on the GPU by a time slice (1 ms with i915's defaults) per round. With 4 such processes alive, another process's 0.5 ms kernel took 4.6 ms instead of 0.58 ms. So this adds an opt-in, thedirect_submissionpreference, overridable per process withONEAPI_DIRECT_SUBMISSION, and documents the trade-off in the performance guide.NEO reads its settings when the library is loaded, so oneAPI.jl now loads NEO itself, after setting the keys and before
zeInit, and removes the keys again so that child processes don't inherit them. That needs NEO_jll not to load the driver in its__init__(JuliaPackaging/Yggdrasil#15918). With a NEO_jll that does, opting in warns that it can't apply, and setting the two variables before starting Julia still works.Closes #756.