Skip to content

Commit

Permalink
Merge branch 'main-dev' of https://github.com/ashvardanian/SimSIMD in…
Browse files Browse the repository at this point in the history
…to main-dev
  • Loading branch information
ashvardanian committed Jun 30, 2024
2 parents 00efb7b + 0ac5403 commit faa796e
Show file tree
Hide file tree
Showing 17 changed files with 348 additions and 191 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"name": "simsimd-ci",
"version": "1.0.0",
"devDependencies": {
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.5",
"conventional-changelog-eslint": "^6.0.0",
"semantic-release": "^24.0.0-beta.2"
},
"release": {
"debug": true,
"ci": false,
"dryRun": false,
"private": true,
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "eslint",
"releaseRules": [
{
"tag": "Break",
"release": "major"
},
{
"tag": "Add",
"release": "minor"
},
{
"tag": "Improve",
"release": "patch"
},
{
"tag": "Make",
"release": "patch"
},
{
"tag": "Refactor",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "eslint",
"releaseRules": [
{
"tag": "Break",
"release": "major"
},
{
"tag": "Add",
"release": "minor"
},
{
"tag": "Improve",
"release": "patch"
},
{
"tag": "Make",
"release": "patch"
},
{
"tag": "Refactor",
"release": false
}
]
}
],
"@semantic-release/changelog",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"verifyConditionsCmd": "echo verifyConditions",
"analyzeCommitsCmd": "echo analyzeCommits",
"verifyReleaseCmd": "echo verifyRelease",
"generateNotesCmd": "echo generateNotes",
"prepareCmd": "bash .github/workflows/update_version.sh '${nextRelease.version}'",
"publishCmd": "echo publish",
"successCmd": "echo success",
"failCmd": "echo fail"
}
],
[
"@semantic-release/git",
{
"assets": [
"VERSION",
"package.json",
"Cargo.toml",
"Cargo.lock",
"CMakeLists.txt",
"include/simsimd/simsimd.h"
],
"message": "Build: Released ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}
34 changes: 24 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,30 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: npm install --ignore-scripts --save-dev --prefix ./package-ci @semantic-release/exec @semantic-release/git conventional-changelog-eslint semantic-release && npx --prefix ./package-ci semantic-release

# Automatic versioning is a pain.
#
# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 20
# - name: Set up Cargo
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - name: Clean npm cache
# run: npm cache clean --force
# - name: Remove node_modules and package-lock.json
# run: rm -rf .github/workflows/node_modules .github/workflows/package-lock.json
# - name: Install dependencies
# run: npm install --ignore-scripts --legacy-peer-deps --prefix .github/workflows
# - name: Verify installation
# run: ls -l .github/workflows/node_modules
# - name: Verify bin directory
# run: ls -l .github/workflows/node_modules/.bin
# - name: Run semantic-release
# run: npx --prefix .github/workflows semantic-release --no-ci --no-npm --debug

rebase:
name: Rebase Dev. Branch
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build/
dist/
javascript/dist
bun.lockb
.build/

# for Google Benchmark
compare.py
Expand Down
87 changes: 0 additions & 87 deletions .releaserc

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(
simsimd
VERSION 4.3.1
VERSION 5.0.0
LANGUAGES C CXX
DESCRIPTION "Fastest SIMD-Accelerated Vector Similarity Functions for x86 and Arm"
HOMEPAGE_URL "https://github.com/ashvardanian/simsimd"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "simsimd"
description = "Fastest SIMD-Accelerated Vector Similarity Functions for x86 and Arm"
version = "4.3.1"
version = "5.0.0"
edition = "2021"
license = "Apache-2.0"
authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1
5.0.0
10 changes: 6 additions & 4 deletions cpp/bench.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ template <simsimd_datatype_t datatype_ak, std::size_t dimensions_ak> struct vect
using compressed16_t = unsigned short;
static constexpr bool is_integral = datatype_ak == simsimd_datatype_i8_k || datatype_ak == simsimd_datatype_b8_k;

scalar_t a[dimensions_ak]{};
scalar_t b[dimensions_ak]{};
alignas(64) scalar_t a[dimensions_ak]{};
alignas(64) scalar_t b[dimensions_ak]{};

std::size_t dimensions() const noexcept { return dimensions_ak; }
std::size_t size_bytes() const noexcept { return dimensions_ak * sizeof(scalar_t); }
Expand Down Expand Up @@ -134,7 +134,8 @@ void measure(bm::State& state, metric_at metric, metric_at baseline) {
};

// Let's average the distance results over many pairs.
std::vector<pair_at> pairs(1024);
constexpr std::size_t pairs_count = 4;
std::vector<pair_at> pairs(pairs_count);
for (auto& pair : pairs)
pair.randomize();

Expand All @@ -147,7 +148,8 @@ void measure(bm::State& state, metric_at metric, metric_at baseline) {
// The actual benchmarking loop.
std::size_t iterations = 0;
for (auto _ : state)
bm::DoNotOptimize((results_contender[iterations & 1023] = call_contender(pairs[iterations & 1023]))),
bm::DoNotOptimize((results_contender[iterations & (pairs_count - 1)] =
call_contender(pairs[iterations & (pairs_count - 1)]))),
iterations++;

// Measure the mean absolute delta and relative error.
Expand Down
2 changes: 2 additions & 0 deletions include/simsimd/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ SIMSIMD_PUBLIC void simsimd_jaccard_b8_serial(simsimd_b8_t const* a, simsimd_b8_

#if SIMSIMD_TARGET_ARM
#if SIMSIMD_TARGET_NEON
#pragma GCC push_options
#pragma GCC target("+simd")
#pragma clang attribute push(__attribute__((target("+simd"))), apply_to = function)

Expand Down Expand Up @@ -117,6 +118,7 @@ SIMSIMD_PUBLIC void simsimd_jaccard_b8_neon(simsimd_b8_t const* a, simsimd_b8_t
#endif // SIMSIMD_TARGET_NEON

#if SIMSIMD_TARGET_SVE
#pragma GCC push_options
#pragma GCC target("+sve")
#pragma clang attribute push(__attribute__((target("+sve"))), apply_to = function)

Expand Down
4 changes: 2 additions & 2 deletions include/simsimd/dot.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ SIMSIMD_PUBLIC void simsimd_vdot_f16c_neon(simsimd_f16_t const* a, simsimd_f16_t
#pragma GCC pop_options

#pragma GCC push_options
#pragma GCC target("+simd+bf16")
#pragma clang attribute push(__attribute__((target("+simd+bf16"))), apply_to = function)
#pragma GCC target("+simd+bf16+fp16fml+fp+flagm")
#pragma clang attribute push(__attribute__((target("+simd+bf16+fp16fml+fp+flagm"))), apply_to = function)

SIMSIMD_PUBLIC void simsimd_dot_bf16_neon(simsimd_bf16_t const* a, simsimd_bf16_t const* b, simsimd_size_t n,
simsimd_distance_t* result) {
Expand Down
Loading

0 comments on commit faa796e

Please sign in to comment.