diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index a9e4da1f2..9101d849e 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -2787,13 +2787,29 @@ or does not check is rebuilt from the generations' names, with young counted ful A driver's compiler takes memory that grows faster than the stage, in the process that creates the pipeline. The translator states each module's entry weight (`ModuleStats::entry_weight`: the -entry's instructions, each call counted as its callee's body); `COMPILED_STAGE_WEIGHT`, 99,109, is -the heaviest measured to compile within host-sized memory on the slowest compiler measured (ANV, -Mesa 26.2.6, on the Iris Xe of RPL-P: 132 s and a 3.65 GiB peak resident set; one of 532,213 passed -16 GiB). No Vulkan query states how large a stage a device's compiler takes, so the bound is one -for every device. A kernel past it is never compiled in the process that runs the program: each -of its `VkPipeline`s is compiled in a helper process the consumer starts, caps and times, and is -created here from that compile's cache data alone. +entry's instructions, each call counted as its callee's body), and the stage bound is +`COMPILED_STAGE_WEIGHT`, 39,014: the heaviest kernel measured to compile in its creating process +within 512 MiB of that process's resident growth on every driver measured. Made cold (no pipeline +cache, the driver's shader cache off) and alone in a process of its own, a real program's kernel +of that weight grew the process by 350 MiB in 6.8 s on ANV (Mesa 26.2.6, the Iris Xe of RPL-P; +job m3-max-66048), 148 MiB in 1.8 s on NVIDIA's driver (620.70.06, an RTX 3090; job +m3-max-66050) and 80 MiB in 0.55 s on RADV (Mesa 26.2.6, a Radeon 780M; job m3-max-66049). Above +it, on the same Iris Xe, an older build's kernels of entry weights 73,814, 75,886 and 99,109 took +peak resident sets of 1.76, 2.24 and 3.65 GiB in 45 s, 47 s and 132 s (job m3-max-26147). No +Vulkan query states how large a stage a device's compiler takes, so the bound is one for every +device; it rises when a heavier kernel is measured to compile within 512 MiB. A kernel past the +bound is never compiled in the process that runs the program: each of its +`VkPipeline`s is compiled in a helper process the consumer starts, caps and times, and is created +here from that compile's cache data alone. + +Render stages have a bound of their own, 99,109, as no helper compiles a render stage: a render +pipeline with a stage past it is refused (Known gaps of render pipeline states), and one at or +under it compiles in the process that runs the program with no cap, past the kernels' bound too. +The two numbers measure two things: where a kernel leaves the process, and where a render stage is +refused because nothing else can compile it. They are one number again when a helper compiles +render stages. `Metrics::render_makes_past_kernel_bound` counts the render pipelines translated +with a stage past the kernels' bound, and `Metrics::render_weight_past_kernel_bound_max` holds the +heaviest such stage's weight. - The make of such a `VkPipeline` (at the state's creation, a `prepare_dispatch` call or a dispatch) reads the pipeline's entry under `stages/` in the cache directory. With data, it @@ -3264,9 +3280,18 @@ cache is answered compile-required on both. ### Known gaps of render pipeline states -- A render pipeline whose vertex or fragment stage weighs more than the stage bound (Kernels past - the stage bound) is refused (`Gap::StageSize`, `StageGap::RenderStage`) where Metal makes it: no - helper compiles a render stage. +- A render pipeline whose vertex or fragment stage weighs more than 99,109, the render stages' + bound (Kernels past the stage bound), is refused (`Gap::StageSize`, `StageGap::RenderStage`) + where Metal makes it: no helper compiles a render stage. +- A render pipeline whose heaviest stage weighs more than the kernels' bound + (`COMPILED_STAGE_WEIGHT`, 39,014) and at most 99,109 compiles in the process that runs the + program, with no cap, where a kernel that heavy compiles only in the consumer's capped helper + (`Metrics::render_makes_past_kernel_bound` counts them). No render stage that heavy is measured. + The heaviest render stage measured of a real program, of entry weight 35,063 beside a vertex + stage of 431 (39,424 as lavapipe's profile weighs it), made cold and alone in a process of its + own, grew the process by 316 MiB in 3.8 s on ANV (Mesa 26.2.6, the Iris Xe of RPL-P; job + m3-max-66048), 180 MiB in 2.5 s on NVIDIA's driver (620.70.06, an RTX 3090; job m3-max-66050) + and 58 MiB in 0.6 s on RADV (Mesa 26.2.6, a Radeon 780M; job m3-max-66049). - Refused at creation by `Gap::RenderPipeline`, naming its `RenderPipelineKind`: depth and stencil attachment formats that differ, as of separate depth and stencil textures (`DepthStencilFormats`: Vulkan's pipeline takes one format for both, diff --git a/crates/metal2vulkan-runtime/src/counters.rs b/crates/metal2vulkan-runtime/src/counters.rs index 3f4e33866..c1faab90e 100644 --- a/crates/metal2vulkan-runtime/src/counters.rs +++ b/crates/metal2vulkan-runtime/src/counters.rs @@ -696,6 +696,8 @@ struct Atomics { preprocess_regions_remade: AtomicU64, stage_fills: AtomicU64, pipelines_from_stage_fills: AtomicU64, + render_makes_past_kernel_bound: AtomicU64, + render_weight_past_kernel_bound_max: AtomicU64, visibility_interrupts_refused: AtomicU64, accumulated_visibility_refused: AtomicU64, overlapping_copies_refused: AtomicU64, @@ -855,6 +857,15 @@ impl Counters { } } + /// One more render pipeline translated whose heaviest stage, of entry weight `weight`, is past + /// the kernels' stage bound. + pub(crate) fn render_past_kernel_bound(&self, weight: u64) { + let a = &self.atomics; + a.render_makes_past_kernel_bound.fetch_add(1, Relaxed); + a.render_weight_past_kernel_bound_max + .fetch_max(weight, Relaxed); + } + /// One more first-use wait at `site`: an encoding call that made the `VkPipeline` it needed, /// for `nanos` nanoseconds, in the total and in its site's. pub(crate) fn first_use_wait(&self, site: FirstUse, nanos: u64) { @@ -1705,6 +1716,10 @@ impl Counters { preprocess_regions_remade: a.preprocess_regions_remade.load(Relaxed), stage_fills: a.stage_fills.load(Relaxed), pipelines_from_stage_fills: a.pipelines_from_stage_fills.load(Relaxed), + render_makes_past_kernel_bound: a.render_makes_past_kernel_bound.load(Relaxed), + render_weight_past_kernel_bound_max: a + .render_weight_past_kernel_bound_max + .load(Relaxed), visibility_interrupts_refused: a.visibility_interrupts_refused.load(Relaxed), accumulated_visibility_refused: a.accumulated_visibility_refused.load(Relaxed), overlapping_copies_refused: a.overlapping_copies_refused.load(Relaxed), @@ -2530,6 +2545,18 @@ pub struct Metrics { /// so the driver compiled nothing for them in this process. Each is counted in /// [`pipelines_created`](Self::pipelines_created) too. pub pipelines_from_stage_fills: u64, + /// No Metal counterpart: render pipelines translated whose heaviest stage weighs more than + /// the kernels' stage bound (`metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT`), each a make + /// of a state the device had not translated: past that bound a kernel compiles only in the + /// consumer's capped helper, and a render stage compiles in this process with no cap up to + /// the render stages' own bound, 99,109, past which it is refused + /// ([`Gap::StageSize`](crate::Gap::StageSize)); the refused are counted too. + pub render_makes_past_kernel_bound: u64, + /// No Metal counterpart: the heaviest stage's entry weight of the + /// [`render_makes_past_kernel_bound`](Self::render_makes_past_kernel_bound), 0 where there are + /// none; a maximum since the device was made, so the difference of two reads does not apply + /// to it. + pub render_weight_past_kernel_bound_max: u64, /// Commands a render encoder refused because they would end its pass's rendering while a /// `Boolean` or `Counting` visibility result's query counts the draws /// ([`DrawKind::VisibilityResultInterrupt`](crate::DrawKind::VisibilityResultInterrupt)): diff --git a/crates/metal2vulkan-runtime/src/error.rs b/crates/metal2vulkan-runtime/src/error.rs index a5689014c..3272485be 100644 --- a/crates/metal2vulkan-runtime/src/error.rs +++ b/crates/metal2vulkan-runtime/src/error.rs @@ -1466,16 +1466,18 @@ pub enum Gap { /// What the pass sets beside the plane, or into it. kind: LinearPlanePassKind, }, - /// A pipeline of a function whose module weighs more than the compiled stage bound - /// (`metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT`, the heaviest measured to compile within - /// host-sized memory), which this process never compiles, that the device does not make: - /// what `cause` names. A kernel's `VkPipeline` is made from its helper's cache data alone - /// ([`Device::fill_stage`](crate::Device::fill_stage)). Metal's counterpart is the pipeline - /// state's make, which Metal's compiler service compiles. + /// A pipeline the device does not make for its heaviest stage's weight, for what `cause` + /// names: a kernel whose module weighs more than the compiled stage bound + /// (`metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT`, 39,014), which this process never + /// compiles, its `VkPipeline` made from its helper's cache data alone + /// ([`Device::fill_stage`](crate::Device::fill_stage)), or a render pipeline with a stage that + /// weighs more than 99,109, the render stages' own bound, as no helper compiles a render stage. + /// Metal's counterpart is the pipeline state's make, which Metal's compiler service compiles. /// - /// Basis: device (ANV, Mesa 26.2.6, took 3.65 GiB to compile a stage of entry weight 99,109 - /// and passed 16 GiB on one of 532,213; a driver whose helper's compile met its cap or time, - /// or that keeps no pipeline cache data, gives no data to make the pipeline from). + /// Basis: device (on the Iris Xe of RPL-P, ANV, Mesa 26.2.6, the consumer's helper compiles of + /// entry weights 186,065 to 424,132 passed its 3 GiB cap, job m3-max-65807; a driver whose + /// helper's compile met its cap or time, or that keeps no pipeline cache data, gives no data to + /// make the pipeline from). StageSize { /// The heaviest stage's entry weight (`ModuleStats::entry_weight`). weight: u64, @@ -1501,7 +1503,8 @@ pub enum StageGap { /// The device's driver writes no pipeline cache header, so its cache data holds no compile /// another process can hand it: lavapipe's (an empty cache's data is 20 bytes in Mesa 26.2.4). NoPipelineCache, - /// A render pipeline's vertex or fragment stage: no helper compiles render stages. + /// A render pipeline's vertex or fragment stage past the render stages' bound, 99,109: no + /// helper compiles render stages. RenderStage, } diff --git a/crates/metal2vulkan-runtime/src/render.rs b/crates/metal2vulkan-runtime/src/render.rs index e0a9770c7..21e4cafe8 100644 --- a/crates/metal2vulkan-runtime/src/render.rs +++ b/crates/metal2vulkan-runtime/src/render.rs @@ -1018,12 +1018,16 @@ impl RenderCompiled { if let Some(kind) = unbuilt(&pipeline, translator.profile().enabled()) { return Err(Error::Unsupported(Gap::RenderPipeline { kind })); } - // A stage past the stage bound is compiled in no process of the runtime's, and no helper - // compiles a render stage. + // No helper compiles a render stage: one past the kernels' bound compiles here, counted, + // and one past the render stages' own bound is refused. let heaviest = (pipeline.stages.iter()) .map(|stage| stage.stats.entry_weight) .max(); if let Some(weight) = heaviest.filter(|&weight| weight > crate::stage::bound()) { + core.counters.render_past_kernel_bound(weight); + } + if let Some(weight) = heaviest.filter(|&weight| weight > crate::stage::RENDER_STAGE_WEIGHT) + { return Err(Error::Unsupported(Gap::StageSize { weight, cause: StageGap::RenderStage, diff --git a/crates/metal2vulkan-runtime/src/stage.rs b/crates/metal2vulkan-runtime/src/stage.rs index adc208c4e..4379eade0 100644 --- a/crates/metal2vulkan-runtime/src/stage.rs +++ b/crates/metal2vulkan-runtime/src/stage.rs @@ -181,9 +181,9 @@ pub(crate) struct Heavy { digest: [u8; 32], } -/// The entry weight past which a stage is compiled only in the consumer's helper: the translator's +/// The entry weight past which a kernel is compiled only in the consumer's helper: the translator's /// `COMPILED_STAGE_WEIGHT`, or, in a device test, one the test sets (`TEST_BOUND`), so a small -/// kernel passes it. +/// kernel passes it. A render stage is weighed against [`RENDER_STAGE_WEIGHT`]. pub(crate) fn bound() -> u64 { #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] if let Some(bound) = @@ -194,6 +194,17 @@ pub(crate) fn bound() -> u64 { metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT } +/// The heaviest entry weight of a render pipeline's stage this process makes: no helper compiles a +/// render stage, so one that weighs more is refused (`Gap::StageSize`, `StageGap::RenderStage`), +/// and one at or under it compiles in this process with no cap, past the kernels' [`bound`] too. +/// The two numbers measure two things: where a kernel leaves this process, and where a render +/// stage is refused because nothing else can compile it. They are one number again when a helper +/// compiles render stages. Measured cold and alone in a process of its own, the heaviest render +/// stage of a real program, of entry weight 35,063 beside a vertex stage of 431 (39,424 as +/// lavapipe's profile weighs it), grew the process by 316 MiB in 3.8 s on ANV (Mesa 26.2.6, the +/// Iris Xe of RPL-P; job m3-max-66048); no render stage between 39,424 and this weight is measured. +pub(crate) const RENDER_STAGE_WEIGHT: u64 = 99_109; + /// The stage bound a device test sets; none where zero ([`bound`]). #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] pub(crate) static TEST_BOUND: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); diff --git a/crates/metal2vulkan-runtime/src/tests/stage.rs b/crates/metal2vulkan-runtime/src/tests/stage.rs index 64f3d0978..e25ef5f1d 100644 --- a/crates/metal2vulkan-runtime/src/tests/stage.rs +++ b/crates/metal2vulkan-runtime/src/tests/stage.rs @@ -428,4 +428,34 @@ mod on_device { ); } } + + /// With the kernels' stage bound below every stage's weight, a render state is still made in + /// this process, as a render stage is refused only past the render stages' own bound, and it + /// is counted: one translated render pipeline past the kernels' bound, at its heaviest stage's + /// weight. + #[test] + fn a_render_state_past_the_kernel_bound_is_made_in_process_and_counted() { + use crate::tests::draw::on_device::{descriptor, examples, state}; + let Some(library) = examples() else { + return; + }; + crate::stage::TEST_BOUND.store(1, Relaxed); + let d = descriptor(&library, "colored_fragment", crate::PixelFormat::RGBA8Unorm); + let instance = crate::tests::validation::instance(&[]); + let devices = devices_of_the_cfgs_kind(&instance); + assert!(!devices.is_empty(), "no device of this cfg's kind"); + for (name, physical) in &devices { + let device = on(name, physical, None, 0); + state(name, &device, &d); + let m = device.counters().metrics(); + assert_eq!(m.render_makes_past_kernel_bound, 1, "{name}"); + assert!(m.render_weight_past_kernel_bound_max > 1, "{name}: {m:?}"); + state(name, &device, &d); + let again = device.counters().metrics(); + assert_eq!( + again.render_makes_past_kernel_bound, 1, + "{name}: the state is translated once" + ); + } + } } diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index f76e473a3..9183154c5 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -61,7 +61,7 @@ mod tests; /// unchanged version, and its bless records the version. Independent of the crate's version and of /// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no /// history. -pub const SEMANTICS_VERSION: u32 = 2269; +pub const SEMANTICS_VERSION: u32 = 2270; /// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the /// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another diff --git a/crates/metal2vulkan/src/pipeline/compile/stage_bound.rs b/crates/metal2vulkan/src/pipeline/compile/stage_bound.rs index e060026c6..9df6fc0ea 100644 --- a/crates/metal2vulkan/src/pipeline/compile/stage_bound.rs +++ b/crates/metal2vulkan/src/pipeline/compile/stage_bound.rs @@ -2,9 +2,8 @@ //! plan of it is. //! //! A driver's compiler takes memory that grows faster than the stage, in the process that creates -//! the pipeline, so one creation past the largest stage measured to compile may take the host's -//! memory. No Vulkan query states how large a stage a device's compiler takes, so the bound is the -//! heaviest stage measured to compile on the slowest compiler measured, one bound for every device. +//! the pipeline, so one heavy creation may take the host's memory. No Vulkan query states how large +//! a stage a device's compiler takes, so the bound is one for every device. //! //! Every module's entry is weighed (`spirv::roll::entry_weight`: the entry's instructions with each //! call counted as its callee's body, as the driver inlines every call) after the repeated regions @@ -19,13 +18,21 @@ //! pipeline reads the weight against [`COMPILED_STAGE_WEIGHT`] (`metal2vulkan-runtime` compiles //! such a kernel only in a helper process the consumer caps). //! -//! **The compiled bound.** [`COMPILED_STAGE_WEIGHT`] is the heaviest entry measured to compile -//! within host-sized memory: on ANV, Mesa 26.2.6, on the Iris Xe of RPL-P, compute modules created -//! cold through `vkCreateComputePipelines` (job m3-max-26147) of entry weights 73,814, 75,886 and -//! 99,109 took 45 s, 47 s and 132 s and peak resident sets of 1.76, 2.24 and 3.65 GiB, and one of -//! entry weight 532,213 passed 16 GiB at 358 s without finishing, where it was stopped. No margin -//! is taken below it, as no weight above it is measured to compile; it rises when a larger compile -//! is measured within host-sized memory. +//! **The compiled bound.** [`COMPILED_STAGE_WEIGHT`] is 39,014: the heaviest kernel measured to +//! compile in the process that creates its pipeline within 512 MiB of that process's resident +//! growth on every driver measured. Made cold (no pipeline cache, the driver's shader cache off) +//! and alone in a process of its own, a real program's kernel of that weight grew the process by +//! 350 MiB in 6.8 s on ANV (Mesa 26.2.6, the Iris Xe of RPL-P; job m3-max-66048), 148 MiB in +//! 1.8 s on NVIDIA's driver (620.70.06, an RTX 3090; job m3-max-66050) and 80 MiB in 0.55 s on +//! RADV (Mesa 26.2.6, a Radeon 780M; job m3-max-66049). Above it, on the same Iris Xe, an older +//! build's compute modules of entry weights 73,814, 75,886 and 99,109, created cold through +//! `vkCreateComputePipelines`, took 45 s, 47 s and 132 s and peak resident sets of 1.76, 2.24 and +//! 3.65 GiB (job m3-max-26147), and the consumer's helper compiled kernels of entry weights +//! 121,523 and 128,372 within peak resident sets of 2,620 and 2,763 MiB and those of 186,065 to +//! 424,132 passed its 3 GiB cap (job m3-max-65807). No margin is taken below it: it rises when a +//! heavier kernel is measured to compile within 512 MiB. It is the kernels' bound: +//! `metal2vulkan-runtime` refuses a render stage only past a bound of its own, as no helper +//! compiles a render stage (its README, "Kernels past the stage bound"). //! //! [`ModuleStats::entry_weight`]: crate::pipeline::ModuleStats::entry_weight @@ -36,14 +43,14 @@ use crate::error::Error; use crate::lower::emit::Emitted; use crate::lower::simd::WidestPin; -/// The heaviest entry weight ([`ModuleStats::entry_weight`]) measured to compile within host-sized -/// memory (the module docs' compiled bound). A stage that weighs more is one whose creation may -/// take the host's memory. +/// The heaviest entry weight ([`ModuleStats::entry_weight`]) of a kernel measured to compile within +/// 512 MiB of its creating process's resident growth on every driver measured (the module docs' +/// compiled bound). A kernel that weighs more is one whose creation may take the host's memory. /// /// [`ModuleStats::entry_weight`]: crate::pipeline::ModuleStats::entry_weight -pub const COMPILED_STAGE_WEIGHT: u64 = 99_109; +pub const COMPILED_STAGE_WEIGHT: u64 = 39_014; -/// The entry weight past which a kernel is planned again keeping its pin: the measured one in +/// The entry weight past which a kernel is planned again keeping its pin: the compiled one in /// production ([`StageBounds::MEASURED`]), another in a test, so it reaches the bound with a small /// module. #[derive(Clone, Copy, Debug, PartialEq, Eq)] @@ -53,7 +60,7 @@ pub(crate) struct StageBounds { } impl StageBounds { - /// The bound measured (the module docs). + /// The compiled bound (the module docs). pub(crate) const MEASURED: StageBounds = StageBounds { compiled: COMPILED_STAGE_WEIGHT, }; diff --git a/crates/metal2vulkan/tests/api_signatures.tsv b/crates/metal2vulkan/tests/api_signatures.tsv index 0a456295e..5dad7df6d 100644 --- a/crates/metal2vulkan/tests/api_signatures.tsv +++ b/crates/metal2vulkan/tests/api_signatures.tsv @@ -620,7 +620,7 @@ const-value metal2vulkan::bind::indirect_commands::WRITTEN_FLAG_BYTES 4 const-value metal2vulkan::metal::format::BICUBIC_TEXELS_UNBOUND crate::metal::bicubic::BicubicTexels::NEUTRAL.0 const-value metal2vulkan::metal::sampler::NOT_MIPMAPPED_MAX_LOD 0.25 const-value metal2vulkan::metal::vertex::MAX_VERTEX_ALIGNMENT 4 -const-value metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT 99_109 +const-value metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT 39_014 const-value metal2vulkan::pipeline::DEEP_THREADGROUP 64 const-value metal2vulkan::pipeline::GRID_TILE_THREADS 256 const-value metal2vulkan::pipeline::NONUNIFORM 1 @@ -1731,8 +1731,10 @@ field metal2vulkan-runtime::Metrics.pushes pub pushes: u64 field metal2vulkan-runtime::Metrics.pushes_held pub pushes_held: u64 field metal2vulkan-runtime::Metrics.queue_lock_wait_max_nanos pub queue_lock_wait_max_nanos: u64 field metal2vulkan-runtime::Metrics.queue_lock_wait_nanos pub queue_lock_wait_nanos: u64 +field metal2vulkan-runtime::Metrics.render_makes_past_kernel_bound pub render_makes_past_kernel_bound: u64 field metal2vulkan-runtime::Metrics.render_records_read pub render_records_read: u64 field metal2vulkan-runtime::Metrics.render_records_stale pub render_records_stale: u64 +field metal2vulkan-runtime::Metrics.render_weight_past_kernel_bound_max pub render_weight_past_kernel_bound_max: u64 field metal2vulkan-runtime::Metrics.resolves pub resolves: u64 field metal2vulkan-runtime::Metrics.ring_block_allocations pub ring_block_allocations: SiteAllocations field metal2vulkan-runtime::Metrics.ring_writes pub ring_writes: u64 diff --git a/docs/API.md b/docs/API.md index 50db9fa75..a80932364 100644 --- a/docs/API.md +++ b/docs/API.md @@ -526,11 +526,12 @@ assert!(stats.reachable_blocks <= stats.blocks); search (a loop), each emitted once and called at every access. - `entry_weight` is what a driver compiles once it has inlined every call: the entry's instructions with each call counted as its callee's body, after repeated regions are rolled - into loops. A stage past `pipeline::COMPILED_STAGE_WEIGHT` (99,109, the heaviest measured to - compile within host-sized memory on the slowest compiler measured) is one whose creation may - take the host's memory: the translator makes it all the same, and `metal2vulkan-runtime` - compiles such a kernel only in a helper process the consumer caps (its README, "Kernels past - the stage bound"). A kernel past the bound only because it emulates its SIMD groups is planned + into loops. A kernel past `pipeline::COMPILED_STAGE_WEIGHT` (39,014, the heaviest kernel + measured to compile within 512 MiB of its creating process's resident growth on every driver + measured) is one whose creation may take the host's memory: the translator makes it all the + same, and `metal2vulkan-runtime` compiles such a kernel only in a helper process the consumer + caps (its README, "Kernels past the stage bound", which gives the figures and the render + stages' own bound). A kernel past the bound only because it emulates its SIMD groups is planned again keeping the device's widest subgroup mode pinned, where that plan is lighter. - Compare one module against the next of the same shader, not one shader against another. Measured cost per block differed several-fold between a synthetic module and a real workload, so a diff --git a/docs/REFUSALS.md b/docs/REFUSALS.md index 220cbef0f..a4bc1c268 100644 --- a/docs/REFUSALS.md +++ b/docs/REFUSALS.md @@ -381,7 +381,7 @@ Columns: | `RenderPass` | A render pass of something the runtime does not build yet (`CommandBuffer::render_command_encoder`) | every device (a public call's own check of its arguments) | `ours`: the replay streams' passes render into one to two color attachments and a stencil or a depth attachment, each a level of a 2D texture of one sample, with no resolve and a clear depth of 1, none naming two textures for its depth and stencil; each other kind is built when a replay stream makes one; `DepthStencilViews` and `ClearDepth` are what Vulkan's rendering under the floor takes no form of | 6: `crates/metal2vulkan-runtime/src/pass.rs (check)`, `crates/metal2vulkan-runtime/src/pass.rs (ops)` (+4) | `-` | | `Draw` | A draw or render encoder state the runtime does not build yet (`RenderCommandEncoder`) | every device (a public call's own check of its arguments) | `ours`: the replay streams draw lines and triangles through one viewport Vulkan's is, with pipeline states of their pass's formats, filled and clipped; each other kind is built when a replay stream draws one), and device for [`DrawKind::DividedBaseInstance`] (a device that does not report `supportsNonZeroFirstInstance` | 13: `crates/metal2vulkan-runtime/src/render_encoder.rs (attachment_reads, 3 sites)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (checked)` (+9) | `-` | | `LinearPlanePass` | A render pass over a surface plane that renders as a linear colour attachment alone, in a shape the device does not render... | at the device's limit | `device`: VK_NV_linear_color_attachment renders such a format as a colour attachment only "as long as all the color attachments in the render pass instance have VK_IMAGE_TILING_LINEAR tiling"; the RTX 3090's driver lost the device rendering a linear colour attachment beside a depth or stencil attachment | 1: `crates/metal2vulkan-runtime/src/pass.rs (check)` | `-` | -| `StageSize` | A pipeline of a function whose module weighs more than the compiled stage bound (`metal2vulkan::pipeline::COMPILED_STAGE_WEIGHT`, the heaviest... | at the device's limit | `device`: ANV, Mesa 26.2.6, took 3.65 GiB to compile a stage of entry weight 99,109 and passed 16 GiB on one of 532,213; a driver whose helper's compile met its cap or time, or that keeps no pipeline cache data, gives no data to make the pipeline from | 3: `crates/metal2vulkan-runtime/src/pipeline.rs (past_stage_bound)`, `crates/metal2vulkan-runtime/src/render.rs (of)` (+1) | `-` | +| `StageSize` | A pipeline the device does not make for its heaviest stage's weight, for what `cause` names | at the device's limit | `device`: on the Iris Xe of RPL-P, ANV, Mesa 26.2.6, the consumer's helper compiles of entry weights 186,065 to 424,132 passed its 3 GiB cap, job m3-max-65807; a driver whose helper's compile met its cap or time, or that keeps no pipeline cache data, gives no data to make the pipeline from | 3: `crates/metal2vulkan-runtime/src/pipeline.rs (past_stage_bound)`, `crates/metal2vulkan-runtime/src/render.rs (of)` (+1) | `-` | ## Appendix: every site