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

KDTrees #206

Merged
merged 12 commits into from
Nov 6, 2023
Merged

KDTrees #206

merged 12 commits into from
Nov 6, 2023

Conversation

josevalim
Copy link
Contributor

@josevalim josevalim commented Nov 5, 2023

No description provided.

@josevalim
Copy link
Contributor Author

josevalim commented Nov 5, 2023

The numbers are really good. For N=1000 on the CPU:

Name               ips        average  deviation         median         99th %
banded          250.39        3.99 ms    ±40.61%        3.28 ms        9.97 ms
unbanded          5.64      177.35 ms    ±25.45%      175.40 ms      387.83 ms

Comparison:
banded          250.39
unbanded          5.64 - 44.41x slower +173.35 ms

Memory usage statistics:

Name        Memory usage
banded        0.00551 MB
unbanded         4.50 MB - 817.51x memory usage +4.50 MB

**All measurements for memory usage were the same**

@josevalim
Copy link
Contributor Author

GPU, N=1_000_00 (ht @polvalente)

Operating System: Linux
CPU Information: 13th Gen Intel(R) Core(TM) i9-13900KS
Number of Available Cores: 32
Available memory: 125.53 GB
Elixir 1.15.1
Erlang 26.0.2

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 10 s
memory time: 2 s
reduction time: 0 ns
parallel: 1
inputs: none specified
Estimated total run time: 28 s

Benchmarking banded 1M ...
Benchmarking unbanded 1M ...
    
Name                  ips        average  deviation         median         99th %
banded 1M           55.01    0.00030 min     ±2.15%    0.00030 min    0.00032 min
unbanded 1M        0.0167       1.00 min     ±0.00%       1.00 min       1.00 min

Comparison: 
banded 1M           55.01
unbanded 1M        0.0167 - 3301.18x slower +1.00 min

Memory usage statistics:

Name           Memory usage
banded 1M        0.00001 GB
unbanded 1M         4.44 GB - 825455.53x memory usage +4.44 GB

**All measurements for memory usage were the same**

@krstopro
Copy link
Member

krstopro commented Nov 5, 2023

What is the dimension of the data you used for benchmarks?

Update: I see it's equal to 3, sorry for asking this.

@josevalim
Copy link
Contributor Author

To add to your question/answer, the dimension should not impact the results, as we don't store the tensors and we only cycle through them.

@doc """
Builds a KDTree without known min-max bounds.

If your tensor has a known band (for example, -1 and 1),
Copy link
Member

Choose a reason for hiding this comment

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

Is this the wording they use in one of the papers? I would expect "bounds" and bounded/2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No paper uses it, the idea is that it would reflect "frequency bands" but I think bound and unbound is more common. It may be a bit confusing because they are not really unbound and more of a question if the bounds are known and reasonable.

@josevalim josevalim merged commit d730ded into main Nov 6, 2023
2 checks passed
@josevalim josevalim deleted the jv-kdtree branch November 6, 2023 12:46
@josevalim
Copy link
Contributor Author

💚 💙 💜 💛 ❤️

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.

4 participants