diff --git a/lib/Dialect/Transforms/PromoteStridedHipOperands.cpp b/lib/Dialect/Transforms/PromoteStridedHipOperands.cpp index 46bccbef6..b6120b744 100644 --- a/lib/Dialect/Transforms/PromoteStridedHipOperands.cpp +++ b/lib/Dialect/Transforms/PromoteStridedHipOperands.cpp @@ -147,8 +147,15 @@ void PromoteStridedHipOperandsPass::runOnOperation() { // ops) does not invalidate the walk. SmallVector consumers; funcOp.walk([&](DestinationStyleOpInterface dpsOp) { + // Match on op-name prefix rather than dialect object: NPI plugin ops + // (hip.npi_quantize, hip.npi_dequantize, etc.) live in NpiDialect but + // carry "hip.*" names and the same contiguous-pointer ABI. The old + // dialect-object check excluded them, causing strided subview inputs + // (e.g. Q/K/V slices from onnx.Split) to be passed uncopied to NPI + // kernels that read them as flat arrays, producing wrong values. Operation *op = dpsOp.getOperation(); - if (op->getDialect() != op->getContext()->getLoadedDialect()) + llvm::StringRef fullOpName = op->getName().getStringRef(); + if (!fullOpName.starts_with("hip.")) return; consumers.push_back(dpsOp); });