Skip to content

Commit

Permalink
chore(ci): build test and bench with fft128 support
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum authored and IceTDrinker committed Mar 24, 2023
1 parent 92d9c74 commit 448502e
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 15 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ jobs:
--commit-date "${COMMIT_DATE}" \
--bench-date "${{ env.BENCH_DATE }}"
- name: Remove previous raw results
run: |
rm -rf target/criterion
- name: Run benchmarks with AVX512
Expand All @@ -87,6 +85,30 @@ jobs:
--name-suffix avx512 \
--append-results
rm -rf target/criterion
- name: Run benchmarks with FFT128
run: |
make FFT128_SUPPORT=ON bench
- name: Parse FFT128 results
run: |
python3 ./ci/benchmark_parser.py target/criterion ${{ env.RESULTS_FILENAME }} \
--name-suffix fft128 \
--append-results
rm -rf target/criterion
- name: Run benchmarks with FFT128 + AVX512
run: |
make AVX512_SUPPORT=ON FFT128_SUPPORT=ON bench
- name: Parse FFT128 + AVX512 results
run: |
python3 ./ci/benchmark_parser.py target/criterion ${{ env.RESULTS_FILENAME }} \
--name-suffix fft128_avx512 \
--append-results
- name: Upload parsed results artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cargo_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ jobs:
- name: Build release
run: |
make build
make build FFT128_SUPPORT=ON
- name: Build release no-std
run: |
make build_no_std
make build_no_std FFT128_SUPPORT=ON
- name: Build benchmarks
if: matrix.runner_type == 'ubuntu-latest'
run: |
sudo apt install -y libfftw3-dev
make build_bench
FFT128_SUPPORT=ON make build_bench
16 changes: 12 additions & 4 deletions .github/workflows/cargo_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ jobs:
override: true

- name: Test debug
run: make test
run: |
make test
make test FFT128_SUPPORT=ON
- name: Test serialization
run: make test_serde

- name: Test no-std
run: make test_no_std
run: |
make test_no_std
make test_no_std FFT128_SUPPORT=ON
cargo-tests-nightly:
runs-on: ${{ matrix.runner_type }}
Expand All @@ -53,7 +57,11 @@ jobs:
override: true

- name: Test nightly
run: make test_nightly
run: |
make test_nightly
make test_nightly FFT128_SUPPORT=ON
- name: Test no-std nightly
run: make test_no_std_nightly
run: |
make test_no_std_nightly
make test_no_std_nightly FFT128_SUPPORT=ON
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RS_BUILD_TOOLCHAIN:=nightly
CARGO_RS_BUILD_TOOLCHAIN:=+$(RS_BUILD_TOOLCHAIN)
MIN_RUST_VERSION:=1.65
AVX512_SUPPORT?=OFF
FFT128_SUPPORT?=OFF
# This is done to avoid forgetting it, we still precise the RUSTFLAGS in the commands to be able to
# copy paste the command in the terminal and change them if required without forgetting the flags
export RUSTFLAGS?=-C target-cpu=native
Expand All @@ -15,6 +16,12 @@ else
AVX512_FEATURE=
endif

ifeq ($(FFT128_SUPPORT),ON)
FFT128_FEATURE=fft128
else
FFT128_FEATURE=
endif

.PHONY: rs_check_toolchain # Echo the rust toolchain used for checks
rs_check_toolchain:
@echo $(RS_CHECK_TOOLCHAIN)
Expand Down Expand Up @@ -55,21 +62,25 @@ clippy: install_rs_check_toolchain

.PHONY: build
build: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) build --release
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) build --release \
--features=$(FFT128_FEATURE)

.PHONY: build_no_std
build_no_std: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) build --release \
--no-default-features
--no-default-features \
--features=$(FFT128_FEATURE)

.PHONY: build_bench
build_bench: install_rs_check_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
--no-run
--no-run \
--features=$(FFT128_FEATURE)

.PHONY: test
test: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --release
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --release \
--features=$(FFT128_FEATURE)

.PHONY: test_serde
test_serde: install_rs_build_toolchain
Expand All @@ -79,18 +90,19 @@ test_serde: install_rs_build_toolchain
.PHONY: test_nightly
test_nightly: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --release \
--features=nightly
--features=nightly,$(FFT128_FEATURE)

.PHONY: test_no_std
test_no_std: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --release \
--no-default-features
--no-default-features \
--features=$(FFT128_FEATURE)

.PHONY: test_no_std_nightly
test_no_std_nightly: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --release \
--no-default-features \
--features=nightly
--features=nightly,$(FFT128_FEATURE)

.PHONY: test_all
test_all: test test_serde test_nightly test_no_std test_no_std_nightly
Expand All @@ -103,7 +115,8 @@ doc: install_rs_check_toolchain
.PHONY: bench # Run benchmarks
bench: install_rs_check_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench --bench fft \
--features=$(AVX512_FEATURE)
--features=$(AVX512_FEATURE) \
--features=$(FFT128_FEATURE)

.PHONY: pcc # pcc stands for pre commit checks
pcc: check_fmt doc clippy
Expand Down
2 changes: 1 addition & 1 deletion src/fft128/f128_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl f128 {
];
}

#[cfg(any(target_arch = "x86", target_arch = "x86_64", doc))]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[cfg_attr(docsrs, doc(cfg(any(target_arch = "x86", target_arch = "x86_64"))))]
pub mod x86 {
use pulp::x86::{f64x4, V3};
Expand Down

0 comments on commit 448502e

Please sign in to comment.