Revert "[metal] Add Dawn toggle and Tint option for TensorsOps" This reverts commit 2a005ba4ce42b2d473b107fe25f1cfc48a3e6e2c. Reason for revert: Causing Dawn->Chromium roller failure. Error on ios-simulator. Failure Link: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8672287040021697281/+/u/compile__with_patch_/raw_io.output_text_failure_summary_ Original change's description: > [metal] Add Dawn toggle and Tint option for TensorsOps > > Expose 32x32x32 for F16 as the only configuration for now. > > Bug: 550350271 > Change-Id: I592707d5168e5342587435718ec71bb838f0ddd0 > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/337135 > Reviewed-by: Alan Baker <alanbaker@google.com> > Commit-Queue: James Price <jrprice@google.com> TBR=jrprice@google.com,alanbaker@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 550350271 Change-Id: I1b0147f9a9e2337b7dc39bf2cccce698f2bac5f3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/337255 Reviewed-by: James Price <jrprice@google.com> Reviewed-by: Brandon Jones <bajones@chromium.org> Commit-Queue: James Price <jrprice@google.com>
diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp index 421dcdf..9b7acbb 100644 --- a/src/dawn/native/Toggles.cpp +++ b/src/dawn/native/Toggles.cpp
@@ -838,9 +838,6 @@ "Disable clamping of subgroupMatrixLoad/Store on storage buffers if " "cooperativeMatrixRobustBufferAccess == VK_TRUE", "https://crbug.com/548005877", ToggleStage::Device}}, - {Toggle::MetalEnableTensors, - {"metal_enable_tensors", "Enable the use of Metal 4 Tensor Operations for subgroup matrix.", - "https://crbug.com/550350271", ToggleStage::Adapter}}, {Toggle::WaitIsThreadSafe, {"wait_is_thread_safe", "WaitFor* functions are thread-safe and can be called without the device-lock if implicit "
diff --git a/src/dawn/native/Toggles.h b/src/dawn/native/Toggles.h index 9d9a9dc..40892c6 100644 --- a/src/dawn/native/Toggles.h +++ b/src/dawn/native/Toggles.h
@@ -199,7 +199,6 @@ VulkanDisallowNPOTDepthStencilMipmaps, VulkanReplaceUnsignedCompareZero, VulkanUseCooperativeMatrixRobustBufferAccess, - MetalEnableTensors, // Once all backends have been updated to be thread safe for waiting, we can remove this toggle. WaitIsThreadSafe,
diff --git a/src/dawn/native/metal/PhysicalDeviceMTL.mm b/src/dawn/native/metal/PhysicalDeviceMTL.mm index 65488b8..47e4e35 100644 --- a/src/dawn/native/metal/PhysicalDeviceMTL.mm +++ b/src/dawn/native/metal/PhysicalDeviceMTL.mm
@@ -385,15 +385,7 @@ } void PhysicalDevice::SetupBackendAdapterToggles(dawn::platform::Platform* platform, - TogglesState* adapterToggles) const { - if (@available(macos 26.0, *)) { - if (![*mDevice supportsFamily:MTLGPUFamilyMetal4]) { - adapterToggles->ForceSet(Toggle::MetalEnableTensors, false); - } - } else { - adapterToggles->ForceSet(Toggle::MetalEnableTensors, false); - } -} + TogglesState* adapterToggles) const {} void PhysicalDevice::SetupBackendDeviceToggles(dawn::platform::Platform* platform, TogglesState* deviceToggles) const { @@ -1069,41 +1061,23 @@ } } if (auto* subgroupMatrixConfigs = info.Get<AdapterPropertiesSubgroupMatrixConfigs>()) { - if (toggles.IsEnabled(Toggle::MetalEnableTensors)) { - if (@available(macos 26.0, *)) { - DAWN_ASSERT([*mDevice supportsFamily:MTLGPUFamilyMetal4]); - } else { - DAWN_ASSERT(false); - } + DAWN_ASSERT([*mDevice supportsFamily:MTLGPUFamilyApple7]); - // TODO(553457823): decide which other matrix configurations to expose. - auto configs = HeapArray<SubgroupMatrixConfig>(1); - configs[0].componentType = wgpu::SubgroupMatrixComponentType::F16; - configs[0].resultComponentType = wgpu::SubgroupMatrixComponentType::F16; - configs[0].M = 32; - configs[0].N = 32; - configs[0].K = 32; + auto configs = HeapArray<SubgroupMatrixConfig>(2); - subgroupMatrixConfigs->configs = std::move(configs).MoveToSpan(); - } else { - DAWN_ASSERT([*mDevice supportsFamily:MTLGPUFamilyApple7]); + configs[0].componentType = wgpu::SubgroupMatrixComponentType::F32; + configs[0].resultComponentType = wgpu::SubgroupMatrixComponentType::F32; + configs[0].M = 8; + configs[0].N = 8; + configs[0].K = 8; - auto configs = HeapArray<SubgroupMatrixConfig>(2); + configs[1].componentType = wgpu::SubgroupMatrixComponentType::F16; + configs[1].resultComponentType = wgpu::SubgroupMatrixComponentType::F16; + configs[1].M = 8; + configs[1].N = 8; + configs[1].K = 8; - configs[0].componentType = wgpu::SubgroupMatrixComponentType::F32; - configs[0].resultComponentType = wgpu::SubgroupMatrixComponentType::F32; - configs[0].M = 8; - configs[0].N = 8; - configs[0].K = 8; - - configs[1].componentType = wgpu::SubgroupMatrixComponentType::F16; - configs[1].resultComponentType = wgpu::SubgroupMatrixComponentType::F16; - configs[1].M = 8; - configs[1].N = 8; - configs[1].K = 8; - - subgroupMatrixConfigs->configs = std::move(configs).MoveToSpan(); - } + subgroupMatrixConfigs->configs = std::move(configs).MoveToSpan(); } } } // namespace dawn::native::metal
diff --git a/src/dawn/native/metal/ShaderModuleMTL.mm b/src/dawn/native/metal/ShaderModuleMTL.mm index 4b95323..ba12a99 100644 --- a/src/dawn/native/metal/ShaderModuleMTL.mm +++ b/src/dawn/native/metal/ShaderModuleMTL.mm
@@ -374,7 +374,6 @@ req.tintOptions.extensions.disable_demote_to_helper = device->IsToggleEnabled(Toggle::DisableDemoteToHelper); - req.tintOptions.extensions.enable_tensors = device->IsToggleEnabled(Toggle::MetalEnableTensors); req.limits = LimitsForCompilationRequest::Create(device->GetLimits().v1); req.adapterSupportedLimits = UnsafeUnserializedValue(
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc index c4363d3..ed2e4ba 100644 --- a/src/tint/cmd/tint/main.cc +++ b/src/tint/cmd/tint/main.cc
@@ -179,8 +179,6 @@ std::unordered_map<uint32_t, tint::msl::writer::ArgumentBufferInfo> group_to_argument_buffer_info; - bool enable_tensors = false; - std::unordered_map<uint32_t, uint32_t> pixel_local_attachments; tint::msl::validate::MslVersion msl_version = tint::msl::validate::MslVersion::kMsl_2_3; #endif @@ -521,10 +519,6 @@ "dynamic-offset", R"(Mapping for dynamic buffers to be attached to the entry point, format is GROUP.BINDING=OFFSET, comma separated. BINDING is the BindingIndex, not @binding BindingNumber))"); - auto& enable_tensors = options.Add<BoolOption>( - "enable-tensors", "Enable Metal 4 tensor operations in MSL", Default{false}); - TINT_DEFER(opts->enable_tensors = *enable_tensors.value); - // Default to validating against MSL 2.3, which corresponds to macOS 11.0. tint::Vector<EnumName<tint::msl::validate::MslVersion>, 2> msl_version_enum_names{ EnumName(tint::msl::validate::MslVersion::kMsl_2_3, "2.3"), @@ -1216,7 +1210,6 @@ gen_options.use_argument_buffers = options.use_argument_buffers; gen_options.group_to_argument_buffer_info = options.group_to_argument_buffer_info; gen_options.array_length_from_constants = GenerateArrayLengthFromConstants(ir, options.ep_name); - gen_options.extensions.enable_tensors = options.enable_tensors; auto entry_point = inspector.GetEntryPoint(options.ep_name); gen_options.non_constant_zero_offset = tint::RoundUp(4U, entry_point.immediate_data_size);
diff --git a/src/tint/lang/msl/writer/common/options.h b/src/tint/lang/msl/writer/common/options.h index 2adf427..9dc8812 100644 --- a/src/tint/lang/msl/writer/common/options.h +++ b/src/tint/lang/msl/writer/common/options.h
@@ -162,11 +162,7 @@ /// Set to `true` to disable demote to helper transform bool disable_demote_to_helper = false; - /// Set to `true` to enable the use of Metal Tensors for subgroup matrix. - /// TODO(553457231): Enable in fuzzers when implementation is complete. - bool enable_tensors = false; - - TINT_REFLECT(Extensions, disable_demote_to_helper, enable_tensors); + TINT_REFLECT(Extensions, disable_demote_to_helper); TINT_REFLECT_HASH_CODE(Extensions); bool operator==(const Extensions&) const = default;