Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ if (TARGET ggml-hrx)
--hrx-buffer-test-jobs 1 --hrx-buffer-test-output all --hrx-buffer-test-filter ".*")
# engine #2500: the loader's mapping becomes HRX0_Mapped weight buffers (skips without LLAMACPP_TEST_MODELFILE)
llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx")
set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77)
# 77 stays for the model skip; the device skip exits 1 and prints this string (test-hrx-ops' convention).
# SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION on ctest 4.2.3, so the exit code is what makes it loud.
set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77
FAIL_REGULAR_EXPRESSION "test skipped: no device available")

add_executable(hrx-backend-test hrx-backend-test.cpp)
target_link_libraries(hrx-backend-test PRIVATE ggml-hrx ggml hrx::hrx loomc::loomc)
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-attention-q-decode-head-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-attention-q-decode-head-size: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-decode-stride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-decode-stride: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-fa-masked-v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-fa-masked-v: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-fa-transposed-value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-fa-transposed-value: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-get-rows-iq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-get-rows-iq: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t backend = ggml_backend_dev_init(device, nullptr);
REQUIRE(backend != nullptr);
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-hadamard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ double max_rel_error(const std::vector<float> & got, const std::vector<double> &
int main() {
ggml_backend_dev_t dev = ggml_backend_dev_by_name("HRX0");
if (dev == nullptr) {
printf("test-hrx-hadamard: no HRX0 device, skipped\n");
return 77;
printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(dev, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
7 changes: 5 additions & 2 deletions tests/test-hrx-loader-mapped.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ int main(int argc, char ** argv) {
}
}
if (hrx == nullptr) {
std::printf("skipped: no HRX device\n");
// ctest's FAIL_REGULAR_EXPRESSION cannot see this if the exit code is SKIP_RETURN_CODE 77: measured on
// ctest 4.2.3, rc 77 + this string is reported Skipped and the row is green. Exit 1 so a device runner
// fails loudly; 77 stays for the model skip, which a CI runner legitimately cannot judge.
std::printf("test skipped: no device available\n");
llama_backend_free();
return 77;
return 1;
}
llama_log_set(collect, nullptr);
llama_model_params params = llama_model_default_params();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-moe-split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-moe-split: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-mul-mat-id-k32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-mul-mat-id-k32: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-mxfp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-mxfp4: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t backend = ggml_backend_dev_init(device, nullptr);
REQUIRE(backend != nullptr);
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-nvfp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-nvfp4: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t backend = ggml_backend_dev_init(device, nullptr);
REQUIRE(backend != nullptr);
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-q2_0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-q2_0: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t backend = ggml_backend_dev_init(device, nullptr);
REQUIRE(backend != nullptr);
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-routed-down-hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,10 @@ int main(int argc, char ** argv) {
}
if (device == nullptr) {
REQUIRE(failures == 0);
std::printf("test-hrx-routed-down-hip: plan cases OK; no HRX0 device, the device cases are skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down
6 changes: 4 additions & 2 deletions tests/test-hrx-top-k-repeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ int main() {
device = ggml_backend_dev_by_name("HRX0");
}
if (device == nullptr) {
std::printf("test-hrx-top-k-repeat: no HRX0 device, skipped\n");
return 77;
std::printf("test skipped: no device available\n");
// ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped
// row is green for a required check, so a missing device is a failure here.
return 1;
}
ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr);
ggml_backend_t cpu = ggml_backend_cpu_init();
Expand Down