Repository navigation
- After a GPU fault, the layer says which kernels it may have come from. A kernel that faults (an illegal address, a misaligned access, a
trap: errors 700, 716, 719 and the others of their kind) ends its context, and the program used to stop at a later call with no more than "unspecified launch failure". The first call that the layer routes and that returns such an error now makes it say, once and at every log level, which kernels were launched in that context since their last synchronisation that succeeded, the last first, each with its grid, block, stream and thread, what the layer made of its image (PTX retargeted, machine code translated, compiled alone or with its module, from the cache, launched from a second translation) and the image's size and XXH64; a CUDA graph's launch is named with the kernel nodes captured in it, andVF_SUMMARYsays it again. The lines never say that a kernel faulted: a copy or a memset, which the layer does not see, may be what failed. Keeping this costs about 25 ns a launch (an empty kernel launched in a loop: 1.86 µs a launch instead of 1.84).VF_FAULT_TRACE=1waits for every launch and names the launch whose synchronisation met the fault (5.7 to 5.8 µs a launch of an empty kernel);VF_FAULT_REPORT=0turns the report off, and the calls that reach the driver are then those of 0.1.5 (what the layer cannot say). - The CUDA 13 build of NCCL runs collectives on V100s (issue #2). The wheels' NCCL (
nvidia-nccl-cu132.30.7, which PyTorch 2.14 and SGLang 0.5.23 install) holds instructions of multicast memory (multimem.*) in its ring and tree kernels, behind tests that only its NVLink-SHARP transport passes; the layer refused those kernels, and the first collective failed. Where the driver says that no GPU of the process can take part in multicast, as with V100s, each such instruction is now replaced by a reported trap, and the kernels are given: on two V100s,torch.distributedcollectives with the wheel's NCCL gave the CPU's values exactly, floats included, with NCCL's own choice of algorithm and protocol and with each of Ring and Tree in Simple, LL and LL128 (388 cases), and SGLang with--tp-size 2gave the CPU's greedy tokens; an all-reduce of 64 MiB reached 33.3 GB/s of bus bandwidth, against 34.8 with NCCL's CUDA 12 build. The cost is the first start: NCCL's adapted code, 248 MB of PTX, is compiled by the driver for about 15 minutes in each process, and later starts take about half a minute more than with the CUDA 12 build, which stays the one to use (vf fetch --only libnccl). A reported trap that a kernel reaches all the same stops it withCUDA_ERROR_ASSERT(710) and a line of the driver that names the function: please report it.VF_REPORTED_TRAPS=0refuses those kernels as before (Several GPUs and NCCL). - CUB and Thrust no longer fail with "invalid device function" in programs whose code is PTX only. In a CUDA 13 build for
75-virtual, as Ollama'scuda_v13runner is, CUB's device-wide sorts, reductions and scans failed with "invalid device function": the layer answered 7.0 for the architecture that the program's PTX was written for, and CUB chooses its code by that answer. It now answers the architecture of the program's PTX, at most the capability that the caller is told. An outside tester, TheWeakShall, had found that, on 0.1.5, llama.cpp v1.0.0 built so stopped with-bsand withdraft-mtpand its default backend sampling of drafts; with this change CUB's sort, sum and scan from such a build give the right results, and so do the ARGSORT (up to 1,048,576 columns), TOP_K, CUMSUM, SUM and MEAN cases of llama.cpp b11521'stest-backend-opsbuilt so. The tester then ran the same build again on the code of 0.1.6: with-bs, and withdraft-mtpand its default backend sampling of drafts, it ran to the end, with no "invalid device function", so--no-spec-draft-backend-samplingis no longer needed; its other runs gave the text of 0.1.5, and where the log-probabilities were read, every token and the log-probabilities of the five first candidates at every position were those of 0.1.5 (the report). - Told 8.0, a kernel that only an image's sm_80 code has is given. The layer gives an image with machine code for sm_75 and sm_80, and no PTX, its sm_75 code, translated. A program told 8.0 that asked for a kernel present only in the sm_80 code was answered "named symbol not found": stock vLLM 0.34.0 with a bfloat16 model, told 8.0 and its compilation off, stopped so at its first forward, at its vectorized bf16
fused_add_rms_norm. The layer now gives that one kernel from the sm_80 code, translated, in a module of its own, with a line, when the kernel reaches no data of its image; otherwise the lookup fails as before, and a line says which code has the kernel and why it is not given. The norm alone on 81,920 bf16 values gave the CPU's bits for its residual and for all but 2 of its norms (one bf16 unit away), and vLLM's engine passes the test's comparison with the CPU's reference in bfloat16. The translation of sm_80 machine code covers more (55 of the 3,652 functions of vLLM 0.34.0's sm_80 code, 464 of the 23,708 of PyTorch 2.14.0's) and is still not independently validated: compare results.VF_TOLD_CODE=0turns this off. - bf16 cuBLAS variants (still opt-in): rules of speed, a gate at k 768, and a verify mode. With
VF_CUBLAS_BF16_TC=1, the tensor-core path now serves only the classes of shapes where it was measured faster than cuBLAS 12.9 on the layers of real models: TN products (a linear layer's), not the narrow products of tall matrices, the long products of many rows or the wide down projections at many columns, and not the products of a training step's backward pass, so that a bf16 fine-tuning step of a 0.5B model ran at 1.12 to 1.24 times its speed without the path, where it ran at 0.36 to 0.77 times. Its gate on k is 768 (it was 1024), so that the linear layers of models of hidden size 768 or 896 are within it: prompts and scoring ran at 1.33 to 1.74 times their speed without the path, an embedding encoder at 1.53 to 1.77, Whisper's encoder at 1.31. Products of operands all positive over a wide range of magnitudes come out low beyond the acceptance test's bias bound at k from 768 to 1023, each element within its error bound. The fallback for rows and columns that do not convert exactly to fp16 is launched once per call, not once per chunk (a call with 2 % of its columns failing: 4.6 ms instead of 17.1).VF_CUBLAS_BF16_VERIFY=1, a diagnostic, makes every call that the skinny path serves a second time with cuBLAS 12.9 itself and compares the two bit for bit on the GPU, in graphs too; the exit report says how many differed.VF_SAFE=1keeps every call at 12.9's bits (measurements). - New, opt-in:
VF_TRITON_TC=1, Triton's products on Volta's tensor cores at the default capability. Told 7.5, Triton computestl.dotwith float32fma. Through the launcher,VF_TRITON_TC=1has Triton compile a kernel whose products all multiply float16, bfloat16 or int8 operands for sm_80, while PyTorch, NVML and every other reader are still told 7.5, and the layer runs it on Volta's tensor cores (float16) or with its emulated products (bfloat16, int8). Measured on a V100 with Triton 3.8: float16 GEMMs at 17 to 38 TFLOPS against 0.23 to 3.2, vLLM's mixture of experts 13 to 98 times faster in float16, and int8 products, which Triton 3.3 to 3.9 cannot compile for 7.5, run. The float16 sums are truncated as in every product of Volta's tensor cores, and bfloat16 results can differ in the last bits. It acts at the default capability only: told 8.0 it says so and changes nothing. A first coldtorch.compilewith max-autotune takes about 13 % longer. Off by default;VF_SAFE=1turns it off (Triton's matrix products). - What telling vLLM 8.0 costs a dense model.
VF_CAPABILITY=8.0 VF_CAPABILITY_ALL=1keeps a bfloat16 model in bfloat16, where below 8.0 vLLM makes it float16, but its bfloat16 products then run without tensor cores, which a V100 has for float16 only: Qwen2.5-0.5B-Instruct on stock vLLM 0.34.0, compilation and CUDA graphs on, one V100, ran at 359 and 7,445 tokens a second (1 and 32 requests) at the default capability, and at 81.5 and 742 told 8.0. That setting is for a model that refuses float16. The vLLM guide andLIMITS.mdsay so. - PTX is adapted faster, on several threads. The lowering of PTX and the analysis of a module scan and allocate less (pull request #5, by midhatn): on one CPU, the adaptation of the 60 fat binaries of Strata's CUDA 13 engine takes 5.0 s instead of 27.9 s, and the lowering of cuBLASLt 13.5's PTX 10.6 s instead of 30.4 s, with the same output on the corpora compared. A large module is now lowered and analysed on worker threads, as many as the CPUs the process may run on, 8 at most (pull request #7, by midhatn): on 8 CPUs, 3.2 s instead of 5.0 and 3.9 s instead of 10.6, the same bytes at every number of threads.
VF_THREADScaps them (1for none). The first start of a program with empty caches is shorter by as much. - Logs.
VF_SUMMARY's file holds the counts of the bf16 cuBLAS variants too, while the process runs, so that a process killed with SIGKILL keeps them. They come through two functions of the layer's own in itslibcuda.so.1,vf_summary_addandvf_summary_remove, by which another library can put lines of its own in that file (their rules). The thread that writes the file no longer takes the program's signals but those of a fault.vf doctorsays whether the layer can use its cache directory, and how to fix it: one that its group could write (as one made under a umask of 002) turned the cache off with one line of the log, and every start adapted again (issue #4). - Building. Each checkout builds in a directory of its own,
~/.cache/volta-forever/target-HASH: a second checkout whose files were older than the first's outputs was given the first one's forwarding generator.scripts/build.shremaps the paths ofCARGO_HOME, not only of~/.cargo, so that the libraries built under anotherHOMEare the same bytes. - Outside reports, and an Ollama guide. TheWeakShall ran
tests/gpu/run.sh(200 of 200 at 0.1.5, at the default and at 8.0) on drivers 580.173.02, 580.178.04 and 580.196.07 and on Rocky Linux 9.9, Ubuntu 26.04, Debian 13 and Fedora 45, stock Ollama 0.40.4's CUDA 13 runner through the layer on four models, two of its runners at once, with and without MPS, and a run of 4,000 requests in 4 h 10 min in which nothing drifted; then, on the code of 0.1.6,tests/gpu/run.sh(229 of 229, at the default and at 8.0, no Xid line), the llama.cpp runs above, and the long run's three fixed prompts, which gave the same bytes as on 0.1.5.docs/reports/lists each with its link, and the Ollama guide gathers what was measured: prompts at 1.3 to 1.9 times the speed of Ollama's CUDA 12 runner on two mixture-of-experts models and at 0.40 to 0.67 times on two dense ones, for which the CUDA 12 runner, without the layer, is the faster choice. - For contributors.
tests/gpu/run.shhas 229 cases (200 in 0.1.5) and reads the kernel's log withjournalctl -korsudo -n dmesgwheredmesgis refused (issue #4).tests/gpu/multi-gpu.sh(pull request #6, by midhatn) runs a test kernel on two GPUs at once from two threads of one process, retargeted, translated and native, lazy and eager, with graphs and copies between the GPUs.tests/gpu/nccl.shcompares NCCL's collectives with the CPU's values exactly. The unit tests run in an empty home of their own, which they must leave empty.
Thank you to TheWeakShall for the outside reports of issue #4, and to midhatn for pull requests #5, #6 and #7.
Known limits. Told 7.5 (the default), Triton 3.8 uses no tensor cores for tl.dot unless VF_TRITON_TC=1; in a program with PyTorch, VF_CAPABILITY=8.0 VF_CAPABILITY_ALL=1 is the other way to them, and PyTorch's own attention is then refused. The CUDA 13 NCCL's first start compiles for about 15 minutes in each process. The translation of sm_80 machine code, used more now for programs told 8.0, is not independently validated, and Triton's machine code is validated on a corpus, not kernel by kernel. Told 7.5, llama.cpp computes every quantized prompt batch with emulated integer tensor-core products, slower than an sm_70 build on dense models; with greedy decoding a near tie that the PTX build resolves the other way can send a text into a loop, which Ollama's repeat limit ends with HTTP 500 (2 of 4,000 requests in the outside long run, both again on the code of 0.1.6). A kernel whose code is a trap is not recognised in an input of the driver's linker or of nvJitLink, and a kernel with an empty body is not refused. A refused kernel still traps when another kernel launches it, or when it is reached by an indirect call or through a call into another linker input. Under eager loading, PyTorch takes very long to start through the layer. A lookup table asked for by name can be refused (error 801) once a kernel that the layer compiled alone holds a copy of it. See the limits and the full changelog.
Upgrading. The layer's cache (~/.cache/volta-forever/proxy, or VF_PROXY_CACHE) has a new format again, and a new build does not use the entries of the one before: the first start of each program after the upgrade adapts and translates its code again, as a first run does. For Strata split over several GPUs, give that first start STRATA_WATCHDOG_S=900 (Strata guide). The entries of 0.1.5 are removed as the cache reaches its size limit (2 GB by default), or remove the directory. A program with the CUDA 13 NCCL, whose kernels the layer refused, now loads them, and its first start compiles them: before the driver compiles an image of 16 MiB of PTX or more given so, a line at the default level says what it compiles, that the first time can take many minutes, and, for NCCL, that its CUDA 12 build starts in seconds; the driver keeps the result in its cache (383 MB for NCCL; raise CUDA_CACHE_MAXSIZE if other programs fill it). With VF_CUBLAS_BF16_TC=1, the tensor-core path takes products from k = 768 (1024 in 0.1.5), and no longer those of the classes of shapes that its rules leave to cuBLAS 12.9, a training step's backward pass among them. From source, the old build directory ~/.cache/volta-forever/target is no longer used and can be removed.
Inference engine guides and benchmarks · Ollama · Installation