_scaled_dot_product_flash_attention_for_cpu can't be rewrite in ReduceOpVariantsPass. Because of string not pattern. https://github.com/llvm/torch-mlir/blob/0c29ccf1439c91c7a2175a167d4bdb2c01a03e63/lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp#L240 I found out the reason is: https://github.com/llvm/torch-mlir/blob/0c29ccf1439c91c7a2175a167d4bdb2c01a03e63/projects/jit_ir_common/csrc/jit_ir_importer/torch_to_mlir_utils.cpp#L541 Modify the code and it will work. ``` return createMlirOperationAtEnd( appendToBlock, "torch.operator", loc, resultTypes, operands, toMlirNamedAttribute( "name", mlirStringAttrGet(context, toMlirStringRef(opName)))); ```