diff --git a/crates/metal2vulkan-runtime/src/device/staging.rs b/crates/metal2vulkan-runtime/src/device/staging.rs index 9ca4a48d9..b0286938c 100644 --- a/crates/metal2vulkan-runtime/src/device/staging.rs +++ b/crates/metal2vulkan-runtime/src/device/staging.rs @@ -68,17 +68,18 @@ //! `VkQueue`. //! //! - **Why.** A copy through a queue of the graphics family runs on the engine the program's -//! kernels run on. Beside another queue's kernels, a frame that copied a `Managed` buffer's -//! 1 MiB in took 3.53 to 3.57 ms (p50) at the start of the batch's work and 1.80 to 1.81 ms -//! through the fill queue on an RTX 3090 and an RTX 2080, and one of 64 MiB 40.6 to 48.9 ms and -//! 35.9 to 36.2 ms (`tests::managed_copies_bench`); in raw Vulkan on an RTX 5080 Laptop GPU -//! (615.71.09), buffer copies through the graphics family beside such kernels moved 13.5 GB/s -//! and left them 52 to 56% of their rate, and through the copy engine 28.5 GB/s and 92 to 97% +//! kernels run on. Beside another queue's kernels, a frame that copied a `Managed` buffer's 1 MiB +//! in took 3.53 to 3.60 ms (p50) at the start of the batch's work and 1.80 to 1.84 ms through the +//! fill queue on an RTX 3090 and an RTX 2080, and one of 64 MiB 40.6 to 48.9 ms and 35.9 to 37.8 +//! ms (`tests::managed_copies_bench`); in raw Vulkan on an RTX 5080 Laptop GPU (615.71.09), +//! buffer copies through the graphics family beside such kernels moved 13.5 GB/s and left them 52 +//! to 56% of their rate, and through the copy engine 28.5 GB/s and 92 to 97% //! (`examples/copy_engine.rs`). //! - **Its least.** Fills of fewer bytes stay at the batch's start. From 1 MiB up, the fill queue's -//! frames took at most 1.04 times as long as the others' alone and no longer beside the kernels, -//! on the RTX 3090, RTX 2080 and RTX 5080 Laptop GPU; under it, up to 2.0 times as long alone -//! (256 KiB on the RTX 2080) and 1.11 times beside the kernels (128 KiB there) +//! frames took at most 1.04 times as long as the others' alone (the RTX 3090's at 1 MiB, traded +//! for the halved frame beside the kernels) and no longer beside the kernels, on the RTX 3090, +//! RTX 2080 and RTX 5080 Laptop GPU; under it, 0.51 to 2.03 times as long, where two devices that +//! both copied at the batch's start differed by 0.31 to 1.39 times //! (`tests::managed_copies_bench`, docs/FAST-PATHS.md). //! - **Why not the staging queue.** A fill comes after the batches before its batch on that //! batch's `VkQueue` (below); on the staging queue, which waits for no work in flight, every diff --git a/docs/FAST-PATHS.md b/docs/FAST-PATHS.md index 2cd2cc1c1..9576bcd12 100644 --- a/docs/FAST-PATHS.md +++ b/docs/FAST-PATHS.md @@ -478,18 +478,19 @@ recorded here. second queue, in a submission of their own after the batches before it, which the batch waits for (`device/staging.rs`, `WorkCounts::fill_queue_submissions`); smaller ones, and every fill elsewhere, run at the start of the batch's own work on its queue. Beside another queue's kernels, - a frame that copied a `Managed` buffer's 1 MiB in took 1.80 to 1.81 ms (p50) through the fill - queue against 3.53 to 3.57 ms at the batch's start on the RTX 3090 and RTX 2080, and 64 MiB 35.9 - to 36.2 against 40.6 to 48.9 ms (3.39 against 5.92 ms on the RTX 5080 Laptop GPU); alone, from 1 - MiB up, the fill queue's frames took at most 1.04 times as long. That 1.04 is the RTX 3090's at 1 - MiB, 0.06 ms a frame, traded for the halved frame beside the kernels there: the swept size from - which the fill queue is within 1% alone on all three is 64 MiB, and the fills under it would lose - that gain. Under 1 MiB they took up to 2.0 times as long alone (256 KiB on the RTX 2080, 0.94 - against 0.46 ms) and 1.11 times beside the kernels (128 KiB there) - (`tests::managed_copies_bench`), so smaller fills stay at the batch's start. From 1 MiB up the - other queue's kernels' share of their rate moved by -5 to +8 points on the RTX 3090 and RTX 2080 - and by +3 to +20 on the RTX 5080 Laptop GPU; every other submission of the device's waits on the - GPU for the fill queue's last until the host saw it complete. + a frame that copied a `Managed` buffer's 1 MiB in took 1.80 to 1.84 ms (p50) through the fill + queue against 3.53 to 3.60 ms at the batch's start on the RTX 3090 and RTX 2080, and 64 MiB 35.9 + to 37.8 against 40.6 to 48.9 ms (3.31 to 3.39 against 5.90 to 5.92 ms on the RTX 5080 Laptop GPU); + alone, from 1 MiB up, the fill queue's frames took at most 1.04 times as long. That 1.04 is the + RTX 3090's at 1 MiB, 0.06 ms a frame, traded for the halved frame beside the kernels there: the + swept size from which the fill queue is within 1% alone on all three is 64 MiB, and the fills + under it would lose that gain. Under 1 MiB the fill queue's frames took 0.51 to 2.03 times as long + as the batch's start's, where two devices that both copied at the batch's start differed by 0.31 + to 1.39 times (`tests::managed_copies_bench`): no gain past that spread, so smaller fills keep the + batch's start. From 1 MiB up the other queue's kernels' share of their rate moved by -5 to +8 + points on the RTX 3090 and RTX 2080 and by +1 to +21 on the RTX 5080 Laptop GPU; every other + submission of the device's waits on the GPU for the fill queue's last until the host saw it + complete. - **A no-copy buffer's deallocator runs in its release.** On an M3 Max under macOS 27.0.1 an unused no-copy buffer's deallocator ran inside its final release, on the releasing thread, every time. So a release that frees the buffer's import while a deallocator waits for the free frees it