Runtime: the compute encoder's imageblock size; a kernel's explicit imageblock is dispatched
ComputeCommandEncoder::set_imageblock_size is Metal's setImageblockWidth:height:. The encoder keeps the size, 1 by 1 until a call sets one (Metal's size for an encoder that never sets one), and a dispatch of a kernel that reaches an explicit imageblock runs at it: the translator's SpecKey::ImageblockWidth and ImageblockHeight are specialized per VkPipeline (Constant::Imageblock), as a threadgroup memory length is. The dispatch's refusal (Gap::KernelInput naming RuntimeFact::ImageblockSize) goes. - encoder: Sizes carries the encoder's threadgroup memory lengths and imageblock size to decide() and threadgroup_memory(); Lengths holds the imageblock size for a kernel that reaches one (0 by 0 otherwise, so other kernels keep one pipeline whatever the encoder set), and its cells (w x h x cell bytes, rounded to 16) count in Limit::ThreadgroupMemory with the lengths. - pipeline: Variant keeps its Lengths (the key is ([u32; 3], &Lengths, bool)); an imageblock kernel has no main pipeline, as a kernel that takes a threadgroup memory length has none; keeps_plain counts the imageblock as encoder-sized memory. - Refusal::ImageblockSize: a side that is not a power of two (0 included) or more than 1024 cells, whatever the state's maxTotalThreadsPerThreadgroup, as Metal's validation layer stops them at the call (probe crates/metal2vulkan-conformance/probes/imageblock_size_rules.m, job m3-max-70002, M3 Max, macOS 27.0.1). - prepare_dispatch and dispatch_variant take the imageblock size as a fourth argument ([1, 1] where the encoder set none); a size the encoder would refuse makes nothing and answers None. The consumer's two call sites take the argument (planner, through main). - Validation: the engine candidate sets a case's explicit imageblock size and passes it to prepare_dispatch; KernelImageblock narrows to a tile pass's implicit imageblock (the runtime builds no tile function). No executor ABI bump: no recorded row ran an explicit imageblock case, which the requirement refused. The replay player plays setImageblockWidth:height:, and the pre-pass passes each dispatch's size. Form (step 0, jobs m3-max-69983, m3-max-69984): Metal compiles nothing for a new size (a new size's first dispatch 202-312 us median against 205-228 us second use and 222 us at the control size, a state's make 15-20 ms); a pushed size would size the Workgroup arena at Metal's 1024 cells on every dispatch. A new size here is one VkPipeline make at its first dispatch, a known gap. Tests: tests::imageblock (replacing tests::kernel_input): a dispatch never sized runs 1 by 1; one encoder runs 4 by 2 and 4 by 4, each read back, two first-use variant waits and no main pipeline; the setter's refusals.
This commit is contained in:
1 parent
f016ff5098
commit
afbcfec9a7
30 files changed
+677
-269
No files matched your search
@@ -932,7 +932,7 @@ MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setSamplerStates:with
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setSamplerState:lodMinClamp:lodMaxClamp:atIndex: I runtime ComputeCommandEncoder::set_sampler_state
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setSamplerStates:lodMinClamps:lodMaxClamps:withRange: I runtime ComputeCommandEncoder::set_sampler_state_with_lod_clamps a loop of it
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setThreadgroupMemoryLength:atIndex: I runtime ComputeCommandEncoder::set_threadgroup_memory_length
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setImageblockWidth:height: M explicit imageblocks; a kernel that reaches one is made and its dispatch refused (`Gap::KernelInput`) M encoder-calls
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setImageblockWidth:height: I runtime ComputeCommandEncoder::set_imageblock_size a specialization: a new size makes a pipeline at its first dispatch
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setStageInRegion: I runtime ComputeCommandEncoder::set_stage_in_region
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method setStageInRegionWithIndirectBuffer:indirectBufferOffset: I runtime ComputeCommandEncoder::set_stage_in_region_with_indirect_buffer always refused: a stage-in region the GPU reads is not built (`Gap::StageIn`)
|
||||
MTLComputeCommandEncoder.h MTLComputeCommandEncoder method dispatchThreadgroups:threadsPerThreadgroup: I runtime ComputeCommandEncoder::dispatch_threadgroups
|
||||
|
||||
|
Reference in new issue
Block a user