Skip to content

Commit f5dc4bb

Browse files
committed
Update on "[ET-VK][ez] Misc fixes related to extension support checking"
## Context Follow up from #7576. Apply two "fixes" that were missed in the first diff: 1. Check device capability for Prepacking nodes as well 2. Remove conditional skips during generated operator correctness tests; rely on the device capability check to determine if a skip is needed. Differential Revision: [D68035430](https://our.internmc.facebook.com/intern/diff/D68035430/) [ghstack-poisoned]
1 parent 26be400 commit f5dc4bb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

backends/vulkan/test/op_tests/utils/gen_computegraph.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,30 @@ def gen_graph_exec_code(self, check_output=True) -> str:
633633

634634
return graph_exec
635635

636+
def gen_conditional_skips(self, skip_str: str = "GTEST_SKIP();") -> str:
637+
fp16_skip = f"if (!{self.graph}{self.dot}context()->adapter_ptr()->has_full_float16_buffers_support()) {{\n"
638+
fp16_skip += f" {skip_str}\n"
639+
fp16_skip += "}"
640+
fp16_skip = re.sub(r"^", " ", fp16_skip, flags=re.M) + "\n"
641+
642+
int8_skip = f"if (!{self.graph}{self.dot}context()->adapter_ptr()->has_full_int8_buffers_support()) {{\n"
643+
int8_skip += f" {skip_str};\n"
644+
int8_skip += "}\n"
645+
646+
skips = ""
647+
648+
skips += "if (test_dtype == at::kHalf) {\n"
649+
skips += fp16_skip
650+
skips += "}\n"
651+
652+
for _, dtype in self.suite_def.arg_dtype.items():
653+
if dtype == "at::kChar" or dtype == "at::kQInt8":
654+
skips += int8_skip
655+
continue
656+
657+
skips += "\n"
658+
return skips
659+
636660
def gen_op_check_fn(self) -> str:
637661
op_name = self.f.func.name.unambiguous_name()
638662
if self.suite_def.test_name_suffix is not None:

0 commit comments

Comments
 (0)