kokkos / kokkos/stdBLAS

P1673: `vector_norm2`: should `init` be inside or outside the `sqrt`?

Open
#142 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
167
Forks
31
PR merge metrics
No merged PRs in 30d

Description

In the impl we have:

  // Compute the sum of squares using an algorithm that avoids
  // underflow and overflow by scaling.
  auto ssq_res = vector_sum_of_squares(exec, x, ssq_init);
  using std::sqrt;
  return init + ssq_res.scaling_factor * sqrt(ssq_res.scaled_sum_of_squares);
}

but in the spec we have:

For N equal to v.extent(0), the mathematical expression for the algorithm is sqrt(init + s), 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the vector_norm2 implementation and its call to vector_sum_of_squares, then compare the return expression with the P1673 specification's sqrt(init + s) formula. Resolve the intended placement of init and ensure the implementation matches the agreed interpretation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.