Skip to content

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

@bryan113

Description

@bryan113

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions