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

EltwiseReduceMod Fails with Larger Moduli on 1.2.2 With DQ Processor #86

Closed
bryan113 opened this issue Oct 27, 2021 · 0 comments · Fixed by #90
Closed

EltwiseReduceMod Fails with Larger Moduli on 1.2.2 With DQ Processor #86

bryan113 opened this issue Oct 27, 2021 · 0 comments · Fixed by #90

Comments

@bryan113
Copy link

I discovered the following when tracking a test failure on a DQ processor. When passing a larger modulus and at least 8 input elements to the EltwiseReduceMod function, incorrect results are returned.

I wrote a quick test in the test-eltwise-reduce-mod.cpp file to replicate the issue:

TEST(EltwiseReduceMod, LargeModError) {
  uint64_t num = 8;
  std::vector<uint64_t> op;
  for(uint64_t i = 0; i < num; i++) op.push_back(124498721298790);
  std::vector<uint64_t> exp_out;
  for(uint64_t i = 0; i < num; i++) exp_out.push_back(253924022517);
  std::vector<uint64_t> result;
  for(uint64_t i = 0; i < num; i++) result.push_back(0);

  const uint64_t modulus = 1099511480321;
  const uint64_t input_mod_factor = modulus;
  const uint64_t output_mod_factor = 1;
  EltwiseReduceMod(result.data(), op.data(), op.size(), modulus,
                   input_mod_factor, output_mod_factor);
  CheckEqual(result, exp_out);
}

When compiling and executing the above on my computer with no processor enhancements, it passes, but with a DQ processor it fails. For our testing we were simply using an AWS c5.4xlarge instance. I've tested on an IFMA processor and the test passes where.

We built the project using the flags: -DCMAKE_BUILD_TYPE=Debug -DHEXL_TESTING=ON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant