Skip to content

Commit 076d96e

Browse files
Merge branch 'main' into pkar/msearch-flatworld-search-project-routing
2 parents 3dc8133 + 25a3a93 commit 076d96e

File tree

467 files changed

+13108
-9242
lines changed

Some content is hidden

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

467 files changed

+13108
-9242
lines changed

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ similar to how the Gradle build-in `java-test-fixtures` plugin works.
239239
```
240240
dependencies {
241241
testImplementation(project(":fixture-providing-project')) {
242-
requireCapabilities("org.elasticsearch.gradle:fixture-providing-project-test-artifacts")
242+
requireCapabilities(${project(":fixture-providing-project').group}:fixture-providing-project-test-artifacts")
243243
}
244244
}
245245
```

benchmarks/src/main/java/org/elasticsearch/benchmark/vector/scorer/VectorScorerInt7uBulkBenchmark.java

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.apache.lucene.store.IOContext;
1515
import org.apache.lucene.store.IndexInput;
1616
import org.apache.lucene.store.MMapDirectory;
17+
import org.apache.lucene.util.hnsw.RandomVectorScorer;
1718
import org.apache.lucene.util.hnsw.UpdateableRandomVectorScorer;
1819
import org.apache.lucene.util.quantization.QuantizedByteVectorValues;
1920
import org.elasticsearch.common.logging.LogConfigurator;
@@ -48,6 +49,7 @@
4849
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.createRandomInt7VectorData;
4950
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.getScorerFactoryOrDie;
5051
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.luceneScoreSupplier;
52+
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.luceneScorer;
5153
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.readNodeCorrectionConstant;
5254
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.supportsHeapSegments;
5355
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.vectorValues;
@@ -80,10 +82,10 @@ public class VectorScorerInt7uBulkBenchmark {
8082

8183
// 128k is typically enough to not fit in L1 (core) cache for most processors;
8284
// 1.5M is typically enough to not fit in L2 (core) cache;
83-
// 40M is typically enough to not fit in L3 cache
84-
@Param({ "128000", "1500000", "30000000" })
85+
// 130M is enough to not fit in L3 cache
86+
@Param({ "128", "1500", "130000" })
8587
public int numVectors;
86-
public int numVectorsToScore = 20_000;
88+
public int numVectorsToScore;
8789

8890
Path path;
8991
Directory dir;
@@ -100,8 +102,12 @@ public class VectorScorerInt7uBulkBenchmark {
100102
UpdateableRandomVectorScorer luceneDotScorer;
101103
UpdateableRandomVectorScorer nativeDotScorer;
102104

105+
RandomVectorScorer luceneDotScorerQuery;
106+
RandomVectorScorer nativeDotScorerQuery;
107+
103108
@Setup(Level.Trial)
104109
public void setup() throws IOException {
110+
numVectorsToScore = Math.min(numVectors, 20_000);
105111
factory = getScorerFactoryOrDie();
106112

107113
var random = ThreadLocalRandom.current();
@@ -127,6 +133,17 @@ public void setup() throws IOException {
127133
.orElseThrow()
128134
.scorer();
129135
nativeDotScorer.setScoringOrdinal(targetOrd);
136+
137+
if (supportsHeapSegments()) {
138+
// setup for getInt7SQVectorScorer / query vector scoring
139+
float[] queryVec = new float[dims];
140+
for (int i = 0; i < dims; i++) {
141+
queryVec[i] = random.nextFloat();
142+
}
143+
luceneDotScorerQuery = luceneScorer(dotProductValues, VectorSimilarityFunction.DOT_PRODUCT, queryVec);
144+
nativeDotScorerQuery = factory.getInt7SQVectorScorer(VectorSimilarityFunction.DOT_PRODUCT, dotProductValues, queryVec)
145+
.orElseThrow();
146+
}
130147
}
131148

132149
@TearDown
@@ -151,6 +168,14 @@ public float[] dotProductLuceneMultipleRandom() throws IOException {
151168
return scores;
152169
}
153170

171+
@Benchmark
172+
public float[] dotProductLuceneQueryMultipleRandom() throws IOException {
173+
for (int v = 0; v < numVectorsToScore; v++) {
174+
scores[v] = luceneDotScorerQuery.score(ordinals[v]);
175+
}
176+
return scores;
177+
}
178+
154179
@Benchmark
155180
public float[] dotProductNativeMultipleSequential() throws IOException {
156181
for (int v = 0; v < numVectorsToScore; v++) {
@@ -167,6 +192,14 @@ public float[] dotProductNativeMultipleRandom() throws IOException {
167192
return scores;
168193
}
169194

195+
@Benchmark
196+
public float[] dotProductNativeQueryMultipleRandom() throws IOException {
197+
for (int v = 0; v < numVectorsToScore; v++) {
198+
scores[v] = nativeDotScorerQuery.score(ordinals[v]);
199+
}
200+
return scores;
201+
}
202+
170203
@Benchmark
171204
public float[] dotProductNativeMultipleSequentialBulk() throws IOException {
172205
nativeDotScorer.bulkScore(ids, scores, ordinals.length);
@@ -179,6 +212,12 @@ public float[] dotProductNativeMultipleRandomBulk() throws IOException {
179212
return scores;
180213
}
181214

215+
@Benchmark
216+
public float[] dotProductNativeQueryMultipleRandomBulk() throws IOException {
217+
nativeDotScorerQuery.bulkScore(ordinals, scores, ordinals.length);
218+
return scores;
219+
}
220+
182221
@Benchmark
183222
public float[] dotProductScalarMultipleSequential() throws IOException {
184223
var queryVector = dotProductValues.vectorValue(targetOrd);

benchmarks/src/test/java/org/elasticsearch/benchmark/vector/scorer/VectorScorerInt7uBulkBenchmarkTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import java.util.Arrays;
2020

21+
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.supportsHeapSegments;
22+
2123
public class VectorScorerInt7uBulkBenchmarkTests extends ESTestCase {
2224

2325
final float delta = 1e-3f;
@@ -61,6 +63,11 @@ public void testDotProductRandom() throws Exception {
6163
assertArrayEquals(expected, bench.dotProductLuceneMultipleRandom(), delta);
6264
assertArrayEquals(expected, bench.dotProductNativeMultipleRandom(), delta);
6365
assertArrayEquals(expected, bench.dotProductNativeMultipleRandomBulk(), delta);
66+
if (supportsHeapSegments()) {
67+
assertArrayEquals(expected, bench.dotProductLuceneQueryMultipleRandom(), delta);
68+
assertArrayEquals(expected, bench.dotProductNativeQueryMultipleRandom(), delta);
69+
assertArrayEquals(expected, bench.dotProductNativeQueryMultipleRandomBulk(), delta);
70+
}
6471
} finally {
6572
bench.teardown();
6673
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalTestArtifactExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void registerTestArtifactFromSourceSet(SourceSet sourceSet) {
3434
JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);
3535
javaPluginExtension.registerFeature(name + "Artifacts", featureSpec -> {
3636
featureSpec.usingSourceSet(sourceSet);
37-
featureSpec.capability("org.elasticsearch.gradle", project.getName() + "-" + sourceSet.getName() + "-artifacts", "1.0");
37+
featureSpec.capability(project.getGroup().toString(), project.getName() + "-" + sourceSet.getName() + "-artifacts", "1.0");
3838
// This feature is only used internally in the
3939
// elasticsearch build so we do not need any publication.
4040
featureSpec.disablePublication();

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ tasks.named('zipAggregation').configure {
9595
ext.testArtifact = { p, String name = "test" ->
9696
def projectDependency = p.dependencies.create(p)
9797
projectDependency.capabilities {
98-
requireCapabilities("org.elasticsearch.gradle:${projectDependency.name}-${name}-artifacts")
98+
requireCapabilities("${p.group}:${projectDependency.name}-${name}-artifacts")
9999
};
100100
}
101101

docs/changelog/137598.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 137598
2+
summary: Improve SAML error handling by adding metadata
3+
area: Authentication
4+
type: enhancement
5+
issues:
6+
- 128179

docs/changelog/138072.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138072
2+
summary: Add a new setting for s3 API call timeout
3+
area: Snapshot/Restore
4+
type: enhancement
5+
issues: []

docs/changelog/138198.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138198
2+
summary: Add Embedding inference task type
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/138260.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 138260
2+
summary: "[HealthAPI] Deterministic shard availability key order"
3+
area: Health
4+
type: enhancement
5+
issues:
6+
- 138043

docs/changelog/138332.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138332
2+
summary: Do not skip a remote cluster base on the query's execution time status
3+
area: ES|QL
4+
type: bug
5+
issues: []

0 commit comments

Comments
 (0)