Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ using namespace torchao::kernels::cpu::aarch64::kleidi::
#endif // TORCHAO_ENABLE_KLEIDI

const float kTol = 1.0e-5;
const float kTolKleidiAI = 1.0e-2;

using namespace torchao::ops::linear_8bit_act_xbit_weight;

Expand Down Expand Up @@ -109,8 +110,12 @@ void test_linear_8bit_act_xbit_weight(
test_case.clamp_min, test_case.clamp_max);

// Test correctness
float tol = kTol;
if (has_kleidi) {
tol = kTolKleidiAI;
}
for (int i = 0; i < m * n; i++) {
EXPECT_NEAR(output[i], test_case.expected_output[i], kTol);
EXPECT_NEAR(output[i], test_case.expected_output[i], tol);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow. Dont know what happend to reduce tol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anything happened.

I guess the KleidiAI kernels never consistently passed the tests with the existing tolerance; they only pass about 7 out of every 8 times you run the tests (@digantdesai confirmed this). But I didn't realize this until I enabled them in CI.

Reducing tolerance makes them consistently pass (at least I didn't see any failures locally when I repeatedly ran the tests).

We still need to figure out why they don't consistently pass at the higher tolerance.

}
}
}
Expand Down
Loading