Skip to content

Commit da14071

Browse files
committed
Merge remote-tracking branch 'origin/main' into separate_weights_per_tier_v2
2 parents b9403bb + 966d722 commit da14071

File tree

747 files changed

+23568
-9924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

747 files changed

+23568
-9924
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.benchmark.vector;
11+
12+
import org.apache.lucene.index.VectorSimilarityFunction;
13+
import org.elasticsearch.common.logging.LogConfigurator;
14+
import org.elasticsearch.index.codec.vectors.OptimizedScalarQuantizer;
15+
import org.openjdk.jmh.annotations.Benchmark;
16+
import org.openjdk.jmh.annotations.BenchmarkMode;
17+
import org.openjdk.jmh.annotations.Fork;
18+
import org.openjdk.jmh.annotations.Level;
19+
import org.openjdk.jmh.annotations.Measurement;
20+
import org.openjdk.jmh.annotations.Mode;
21+
import org.openjdk.jmh.annotations.OutputTimeUnit;
22+
import org.openjdk.jmh.annotations.Param;
23+
import org.openjdk.jmh.annotations.Scope;
24+
import org.openjdk.jmh.annotations.Setup;
25+
import org.openjdk.jmh.annotations.State;
26+
import org.openjdk.jmh.annotations.Warmup;
27+
28+
import java.util.concurrent.ThreadLocalRandom;
29+
import java.util.concurrent.TimeUnit;
30+
31+
@BenchmarkMode(Mode.Throughput)
32+
@OutputTimeUnit(TimeUnit.MILLISECONDS)
33+
@State(Scope.Benchmark)
34+
@Warmup(iterations = 3, time = 1)
35+
@Measurement(iterations = 5, time = 1)
36+
@Fork(value = 3)
37+
public class OptimizedScalarQuantizerBenchmark {
38+
static {
39+
LogConfigurator.configureESLogging(); // native access requires logging to be initialized
40+
}
41+
@Param({ "384", "702", "1024" })
42+
int dims;
43+
44+
float[] vector;
45+
float[] centroid;
46+
byte[] destination;
47+
48+
@Param({ "1", "4", "7" })
49+
byte bits;
50+
51+
OptimizedScalarQuantizer osq = new OptimizedScalarQuantizer(VectorSimilarityFunction.DOT_PRODUCT);
52+
53+
@Setup(Level.Iteration)
54+
public void init() {
55+
ThreadLocalRandom random = ThreadLocalRandom.current();
56+
// random byte arrays for binary methods
57+
destination = new byte[dims];
58+
vector = new float[dims];
59+
centroid = new float[dims];
60+
for (int i = 0; i < dims; ++i) {
61+
vector[i] = random.nextFloat();
62+
centroid[i] = random.nextFloat();
63+
}
64+
}
65+
66+
@Benchmark
67+
public byte[] scalar() {
68+
osq.scalarQuantize(vector, destination, bits, centroid);
69+
return destination;
70+
}
71+
72+
@Benchmark
73+
@Fork(jvmArgsPrepend = { "--add-modules=jdk.incubator.vector" })
74+
public byte[] vector() {
75+
osq.scalarQuantize(vector, destination, bits, centroid);
76+
return destination;
77+
}
78+
}

build-tools-internal/version.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jna = 5.12.1
1717
netty = 4.1.118.Final
1818
commons_lang3 = 3.9
1919
google_oauth_client = 1.34.1
20-
awsv1sdk = 1.12.746
2120
awsv2sdk = 2.30.38
2221
reactive_streams = 1.0.4
2322

distribution/docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ for (final Architecture architecture : Architecture.values()) {
590590
}
591591
if(base == DockerBase.DEFAULT) {
592592
// Add additional docker hub specific context which we use solely for publishing to docker hub.
593-
// At the moment it only differs in not labels added that we need for openshift certification
593+
// At the moment it is exactly the same as the default context.
594594
addBuildDockerContextTask(architecture, base, 'DockerHubContext', "docker-hub-build-context")
595595
}
596596
}

distribution/docker/src/docker/Dockerfile.default

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,13 @@ LABEL org.label-schema.build-date="${build_date}" \\
139139
org.opencontainers.image.vendor="Elastic" \\
140140
org.opencontainers.image.version="${version}"
141141

142-
<% if (docker_context != 'docker-hub-build-context') { %>
143142
LABEL name="Elasticsearch" \\
144143
maintainer="[email protected]" \\
145144
vendor="Elastic" \\
146145
version="${version}" \\
147146
release="1" \\
148147
summary="Elasticsearch" \\
149148
description="You know, for search."
150-
<% } %>
151149

152150
RUN mkdir /licenses && ln LICENSE.txt /licenses/LICENSE
153151

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/SystemJvmOptions.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
6161
"-Dio.netty.noUnsafe=true",
6262
"-Dio.netty.noKeySetOptimization=true",
6363
"-Dio.netty.recycler.maxCapacityPerThread=0",
64+
// temporary until we get off-heap vector stats in Lucene 10.3
65+
"--add-opens=org.apache.lucene.core/org.apache.lucene.codecs.lucene99=org.elasticsearch.server",
66+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene90=org.elasticsearch.server",
67+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene91=org.elasticsearch.server",
68+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene92=org.elasticsearch.server",
69+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene94=org.elasticsearch.server",
70+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene95=org.elasticsearch.server",
6471
// log4j 2
6572
"-Dlog4j.shutdownHookEnabled=false",
6673
"-Dlog4j2.disable.jmx=true",

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/APMJvmOptionsTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import static org.mockito.Mockito.doReturn;
3939
import static org.mockito.Mockito.mock;
4040

41-
@ESTestCase.WithoutSecurityManager
4241
public class APMJvmOptionsTests extends ESTestCase {
4342

4443
private Path installDir;

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/JvmErgonomicsTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.common.util.concurrent.EsExecutors;
1616
import org.elasticsearch.node.NodeRoleSettings;
1717
import org.elasticsearch.test.ESTestCase;
18-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1918

2019
import java.io.IOException;
2120
import java.util.ArrayList;
@@ -41,7 +40,6 @@
4140
import static org.junit.Assert.assertTrue;
4241
import static org.junit.Assert.fail;
4342

44-
@WithoutSecurityManager
4543
@SuppressFileSystems("*")
4644
public class JvmErgonomicsTests extends ESTestCase {
4745

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/JvmOptionsParserTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.core.IOUtils;
1616
import org.elasticsearch.core.Strings;
1717
import org.elasticsearch.test.ESTestCase;
18-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1918
import org.junit.AfterClass;
2019
import org.junit.BeforeClass;
2120

@@ -43,7 +42,6 @@
4342
import static org.hamcrest.Matchers.hasSize;
4443
import static org.hamcrest.Matchers.not;
4544

46-
@WithoutSecurityManager
4745
@LuceneTestCase.SuppressFileSystems("*")
4846
public class JvmOptionsParserTests extends ESTestCase {
4947

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/MachineDependentHeapTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import org.elasticsearch.common.settings.Settings;
1313
import org.elasticsearch.test.ESTestCase;
14-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1514
import org.hamcrest.Matcher;
1615

1716
import java.util.Collections;
@@ -21,7 +20,6 @@
2120
import static org.hamcrest.Matchers.empty;
2221

2322
// TODO: rework these tests to mock jvm option finder so they can run with security manager, no forking needed
24-
@WithoutSecurityManager
2523
public class MachineDependentHeapTests extends ESTestCase {
2624

2725
public void testDefaultHeapSize() throws Exception {

docs/changelog/125570.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125570
2+
summary: ES|QL random sampling
3+
area: Machine Learning
4+
type: feature
5+
issues: []

0 commit comments

Comments
 (0)