This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 49bc080665 [Tests] Make TargetCreation.DeduplicateKeys host-agnostic
on AArch64 (#19786)
49bc080665 is described below
commit 49bc080665689ab50ac22c8edc8721048a584e8c
Author: Shushi Hong <[email protected]>
AuthorDate: Tue Jun 16 07:31:04 2026 -0400
[Tests] Make TargetCreation.DeduplicateKeys host-agnostic on AArch64
(#19786)
This pr fixes #19718. The test asserted target->attrs.size()==2, which
is host-specific: LLVM target canonicalization legitimately adds host
attrs (feature.has_sve / has_asimd / is_aarch64 / mtriple on AArch64),
so the target ends up with 9 attrs there and the assertion fails, while
it happens to be 2 on x86. The test only means to verify that duplicate
keys are deduplicated, so assert that the "keys" entry did not leak into
the generic attrs map instead of pinning the host-specific attr count.
---
tests/cpp/target_test.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/cpp/target_test.cc b/tests/cpp/target_test.cc
index e6e73e84d6..d842c868d5 100644
--- a/tests/cpp/target_test.cc
+++ b/tests/cpp/target_test.cc
@@ -379,7 +379,7 @@ TEST(TargetCreation, DeduplicateKeys) {
TVM_FFI_ICHECK_EQ(target->keys.size(), 2U);
TVM_FFI_ICHECK_EQ(target->keys[0], "cpu");
TVM_FFI_ICHECK_EQ(target->keys[1], "arm_cpu");
- TVM_FFI_ICHECK_EQ(target->attrs.size(), 2U);
+ TVM_FFI_ICHECK_EQ(target->attrs.count("keys"), 0U);
TVM_FFI_ICHECK_EQ(target->GetAttr<ffi::String>("device"), "arm_cpu");
}