Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize some tests #8078

Merged
merged 12 commits into from
Feb 13, 2024
6 changes: 3 additions & 3 deletions src/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ FuncSchedule FuncSchedule::deep_copy(

internal_assert(contents.defined()) << "Cannot deep-copy undefined FuncSchedule\n";
FuncSchedule copy;
copy.contents->store_level = contents->store_level;
copy.contents->compute_level = contents->compute_level;
copy.contents->hoist_storage_level = contents->hoist_storage_level;
copy.contents->store_level.set(contents->store_level);
copy.contents->compute_level.set(contents->compute_level);
copy.contents->hoist_storage_level.set(contents->hoist_storage_level);
copy.contents->storage_dims = contents->storage_dims;
copy.contents->bounds = contents->bounds;
copy.contents->estimates = contents->estimates;
Expand Down
59 changes: 9 additions & 50 deletions test/correctness/float16_t_neon_op_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SimdOpCheck : public SimdOpCheckTest {
// bits, 192 bits, and 256 bits for everything.
struct TestParams {
const int bits;
ImageParam in_f;
std::function<Expr(Expr)> in_f;
std::vector<std::pair<int, string>> vl_params;
Expr f_1, f_2, f_3, u_1, i_1;
};
Expand All @@ -77,7 +77,7 @@ class SimdOpCheck : public SimdOpCheckTest {

for (auto &test_param : test_params) { // outer loop for {fp32, fp16}
const int bits = test_param.bits;
ImageParam in_f = test_param.in_f;
auto in_f = test_param.in_f;
Expr f_1 = test_param.f_1;
Expr f_2 = test_param.f_2;
Expr f_3 = test_param.f_3;
Expand Down Expand Up @@ -256,7 +256,7 @@ class SimdOpCheck : public SimdOpCheckTest {
suffix_map.emplace(tasks.back().name, suffix);
}

void compile_and_check(Func error, const string &op, const string &name, int vector_width, std::ostringstream &error_msg) override {
void compile_and_check(Func error, const string &op, const string &name, int vector_width, const std::vector<Argument> &arg_types, std::ostringstream &error_msg) override {
std::string fn_name = "test_" + name;
std::string file_name = output_directory + fn_name;

Expand Down Expand Up @@ -315,52 +315,11 @@ class SimdOpCheck : public SimdOpCheckTest {
} // namespace

int main(int argc, char **argv) {
Target host = get_host_target();
Target hl_target = get_target_from_environment();
Target jit_target = get_jit_target_from_environment();
printf("host is: %s\n", host.to_string().c_str());
printf("HL_TARGET is: %s\n", hl_target.to_string().c_str());
printf("HL_JIT_TARGET is: %s\n", jit_target.to_string().c_str());

// Only for 64bit target with fp16 feature
if (!(hl_target.arch == Target::ARM && hl_target.bits == 64 && hl_target.has_feature(Target::ARMFp16))) {
Halide::Internal::Test::Sharder::accept_sharded_status();
printf("[SKIP] To run this test, set HL_TARGET=arm-64-<os>-arm_fp16. \n");
return 0;
}

// Create Test Object
// Use smaller dimension than default(768, 128) to avoid fp16 overflow in reduction test case
SimdOpCheck test(hl_target, 384, 32);

if (!test.can_run_code()) {
printf("[WARN] To run verification of realization, set HL_JIT_TARGET=arm-64-<os>-arm_fp16. \n");
}

if (argc > 1) {
test.filter = argv[1];
}

if (getenv("HL_SIMD_OP_CHECK_FILTER")) {
test.filter = getenv("HL_SIMD_OP_CHECK_FILTER");
}

if (argc > 2) {
// Don't forget: if you want to run the standard tests to a specific output
// directory, you'll need to invoke with the first arg enclosed
// in quotes (to avoid it being wildcard-expanded by the shell):
//
// correctness_simd_op_check "*" /path/to/output
//
test.output_directory = argv[2];
}

bool success = test.test_all();

if (!success) {
return 1;
}

printf("Success!\n");
// FIXME
printf("[SKIP] Test is currently broken. See https://github.com/halide/Halide/issues/8083");
return 0;

return SimdOpCheckTest::main<SimdOpCheck>(
argc, argv,
{Target("arm-64-linux-arm_fp16")});
}
Loading
Loading