Skip to content

Closes #3571: Update in1d_benchmark - #4651

Merged
ajpotts merged 1 commit into
Bears-R-Us:masterfrom
ajpotts:3571_Update_in1d_benchmark
Jul 9, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:masterfrom
ajpotts:3571_Update_in1d_benchmark

Conversation

@ajpotts

@ajpotts ajpotts commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

PR: Refactor in1d_benchmark.py with NumPy and Correctness Testing Support

This PR updates the in1d benchmark to follow the standardized Arkouda benchmarking format with enhanced flexibility and validation.

✅ Key Enhancements

  • Support for --numpy

    • Runs the benchmark using np.isin(...) for baseline comparison
    • Uses .to_ndarray() to convert Arkouda arrays
  • Support for --correctness_only

    • Validates that ak.in1d(...) results match np.isin(...)
    • Ensures consistent correctness across all supported types and sizes
  • Multi-Type & Threshold Scaling

    • Benchmarks are parameterized over:
      • dtype ∈ {int64, uint64, str}
      • size ∈ {MEDIUM (below threshold), LARGE (above threshold)}
    • Logic remains aligned with Chapel In1d.chpl:threshold default (2**23)
  • Benchmark Metadata

    • Includes problem size, backend name, and memory transfer rate in GiB/sec

🔧 Technical Notes

  • Strings are accounted for in memory cost as: size * 8 + nbytes
  • The dtype in pytest.dtype conditional enables external filtering (e.g., CLI --dtype)

This refactor ensures in1d performance and correctness are robustly measured across Arkouda and NumPy, and is consistent with other benchmark modules.

Closes #3571: Update in1d_benchmark

@ajpotts
ajpotts force-pushed the 3571_Update_in1d_benchmark branch from cc87917 to 4942980 Compare June 23, 2025 17:53
@ajpotts
ajpotts marked this pull request as ready for review June 23, 2025 17:54
@ajpotts
ajpotts force-pushed the 3571_Update_in1d_benchmark branch 4 times, most recently from 4d347fc to 0a46d3a Compare June 25, 2025 14:07
@ajpotts
ajpotts requested a review from vasslitvinov June 25, 2025 15:55

@vasslitvinov vasslitvinov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think io_benchmark.py was included unintentionally.

I also do not see numpy benchmarking, despite it was claimed in the PR description. Instead I see @pytest.mark.skip_numpy(True) added. Please reconcile.

Comment thread benchmark_v2/in1d_benchmark.py Resolved
@ajpotts
ajpotts force-pushed the 3571_Update_in1d_benchmark branch 2 times, most recently from 083c4e6 to cbb5b4b Compare June 30, 2025 20:40
Comment thread benchmark_v2/in1d_benchmark.py Resolved
@ajpotts
ajpotts force-pushed the 3571_Update_in1d_benchmark branch from cbb5b4b to 4b46495 Compare July 7, 2025 16:10

@1RyanK 1RyanK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@ajpotts
ajpotts added this pull request to the merge queue Jul 9, 2025
Merged via the queue into Bears-R-Us:master with commit b15201c Jul 9, 2025
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 this pull request may close these issues.

Update in1d_benchmark

3 participants