Experimenting with simd/archsimd#692
Draft
saswatamcode wants to merge 1 commit intothanos-io:mainfrom
Draft
Conversation
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimenting with the experimental native SIMD package in Go 1.26. Won't build without GOEXPERIMENT=simd
Not entirely sure if I'm doing something unintended tho, need to read up more.
$ GOEXPERIMENT=simd GOOS=darwin GOARCH=amd64 go test -timeout 5m -run ^TestNewMaxAcc$ github.com/thanos-io/promql-engine/compute -race -v === RUN TestNewMaxAcc === RUN TestNewMaxAcc/empty_accumulator_has_NoValue === RUN TestNewMaxAcc/single_Add_sets_max === RUN TestNewMaxAcc/multiple_Add_keeps_max === RUN TestNewMaxAcc/AddVector_takes_max_of_slice === RUN TestNewMaxAcc/Add_and_AddVector_combined === RUN TestNewMaxAcc/AddVectorSIMD_takes_max_of_slice === RUN TestNewMaxAcc/Add_and_AddVectorSIMD_combined === RUN TestNewMaxAcc/NaN_is_replaced_by_real_number === RUN TestNewMaxAcc/Reset_clears_state --- PASS: TestNewMaxAcc (0.01s) --- PASS: TestNewMaxAcc/empty_accumulator_has_NoValue (0.00s) --- PASS: TestNewMaxAcc/single_Add_sets_max (0.00s) --- PASS: TestNewMaxAcc/multiple_Add_keeps_max (0.00s) --- PASS: TestNewMaxAcc/AddVector_takes_max_of_slice (0.00s) --- PASS: TestNewMaxAcc/Add_and_AddVector_combined (0.00s) --- PASS: TestNewMaxAcc/AddVectorSIMD_takes_max_of_slice (0.00s) --- PASS: TestNewMaxAcc/Add_and_AddVectorSIMD_combined (0.00s) --- PASS: TestNewMaxAcc/NaN_is_replaced_by_real_number (0.00s) --- PASS: TestNewMaxAcc/Reset_clears_state (0.00s) PASS ok github.com/thanos-io/promql-engine/compute 1.896s$ GOEXPERIMENT=simd GOOS=darwin GOARCH=amd64 go test -bench=MaxAcc -benchmem ./compute/ -count 5 goos: darwin goarch: amd64 pkg: github.com/thanos-io/promql-engine/compute cpu: VirtualApple @ 2.50GHz BenchmarkMaxAcc_AddVector-10 9008782 132.5 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVector-10 9018422 133.0 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVector-10 9008895 137.4 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVector-10 8980705 132.7 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVector-10 9029263 132.8 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVectorSIMD-10 18712428 63.67 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVectorSIMD-10 18807782 64.24 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVectorSIMD-10 18797163 63.55 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVectorSIMD-10 18721698 64.46 ns/op 0 B/op 0 allocs/op BenchmarkMaxAcc_AddVectorSIMD-10 18688288 64.26 ns/op 0 B/op 0 allocs/op PASS ok github.com/thanos-io/promql-engine/compute 13.550s