From 0f7f95ffef582297773b7afe8091206454db8727 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Mon, 13 May 2024 12:37:43 -0700 Subject: [PATCH 1/6] ci msrv policy --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a1bc31..4f3b48c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,7 @@ jobs: cargo +nightly rustdoc --all-features -- --D warnings --cfg doc_cfg - name: msrv run: | - cargo +nightly generate-lockfile -Zmsrv-policy + cargo +nightly generate-lockfile -Zmsrv-policy --config "resolver.something-like-precedence='something-like-rust-version'" cat Cargo.lock cargo +1.70.0 check -p autograph -p neural-network-mnist-example --all-features --all-targets -v cargo +1.70.0 check -p neural-network-benches --all-targets -v From fb80b4e242bec4133024696e3c18a18897deb7f2 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Tue, 14 May 2024 13:09:49 -0700 Subject: [PATCH 2/6] ci fixes --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f3b48c..250604f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: install toolchains run: | rustup set profile minimal - rustup toolchain install stable nightly + rustup toolchain install stable nightly --no-self-update - name: build run: cargo build --workspace --features serde,iris,mnist,neural-network --all-targets -v - name: test @@ -82,8 +82,8 @@ jobs: - name: install toolchains run: | rustup set profile minimal - rustup toolchain install nightly - rustup toolchain install nightly-2023-05-27 --component rust-src rustc-dev llvm-tools-preview + rustup toolchain install nightly --no-self-update + rustup toolchain install nightly-2023-05-27 --component rust-src rustc-dev llvm-tools-preview --no-self-update - name: install spirv-tools run: | sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev @@ -102,10 +102,10 @@ jobs: - name: install toolchains run: | rustup set profile minimal - rustup toolchain install stable --component rustfmt clippy rust-docs - rustup toolchain install nightly --component rust-docs - rustup toolchain install nightly-2023-05-27 --component rustfmt clippy rust-src rustc-dev llvm-tools-preview - rustup toolchain install 1.70.0 + rustup toolchain install stable --component rustfmt clippy rust-docs --no-self-update + rustup toolchain install nightly --component rust-docs --no-self-update + rustup toolchain install nightly-2023-05-27 --component rustfmt clippy rust-src rustc-dev llvm-tools-preview --no-self-update + rustup toolchain install 1.70.0 --no-self-update - name: fmt run: cargo fmt --check - name: install cargo-hack @@ -119,9 +119,9 @@ jobs: - name: rustdoc run: | cargo rustdoc -p autograph_derive -- -D warnings - cargo hack --feature-powerset --include-features device,serde,neural-network rustdoc -- --D warnings - cargo rustdoc --all-features -- --D warnings - cargo +nightly rustdoc --all-features -- --D warnings --cfg doc_cfg + cargo hack --feature-powerset --include-features device,serde,neural-network rustdoc -- --D warnings -A unexpected_cfgs + cargo rustdoc --all-features -- --D warnings -A unexpected_cfgs + cargo +nightly rustdoc --all-features -- --D warnings --cfg doc_cfg -A unexpected_cfgs - name: msrv run: | cargo +nightly generate-lockfile -Zmsrv-policy --config "resolver.something-like-precedence='something-like-rust-version'" From e48729b67a46faeec6d06e59fd0d63949677cc08 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Tue, 14 May 2024 13:16:25 -0700 Subject: [PATCH 3/6] mnist fixed test and download link --- src/dataset/mnist.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dataset/mnist.rs b/src/dataset/mnist.rs index 39c6a98..711644d 100644 --- a/src/dataset/mnist.rs +++ b/src/dataset/mnist.rs @@ -232,12 +232,11 @@ fn download( let guard = AbortGuard::new(&done, &bar); let url = match kind { MnistKind::Mnist => { - format!("http://yann.lecun.org/exdb/mnist/{}.gz", name) + format!("https://storage.googleapis.com/cvdf-datasets/mnist/{name}.gz") + } + MnistKind::Fashion => { + format!("http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/{name}.gz",) } - MnistKind::Fashion => format!( - "http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/{}.gz", - name - ), }; let gz_path = mnist_path.join(name).with_extension("gz"); let file = std::fs::File::create(gz_path)?; @@ -326,7 +325,7 @@ mod tests { fn fashion() { let dir = tempfile::tempdir().unwrap(); Mnist::builder() - .kind(MnistKind::Mnist) + .kind(MnistKind::Fashion) .download(true) .path(dir.path()) .verbose(false) From 82f0facf066ed1d8851ea70742ef0c4b5e295df5 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Tue, 14 May 2024 13:59:25 -0700 Subject: [PATCH 4/6] cache-size target_family x86 --- Cargo.toml | 2 +- src/tensor/parallel.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 538fa02..28050fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ unchecked-index = "0.2.2" curl = { version = "0.4.46", optional = true } indicatif = { version = "0.17.8", optional = true } -[target.'cfg(not(target_family = "wasm"))'.dependencies] +[target.'cfg(target_family = "x86")'.dependencies] cache-size = "0.6.0" [dev-dependencies] diff --git a/src/tensor/parallel.rs b/src/tensor/parallel.rs index a368427..778c733 100644 --- a/src/tensor/parallel.rs +++ b/src/tensor/parallel.rs @@ -4,19 +4,19 @@ use ndarray::{ArrayViewMut, Dimension, RawArrayViewMut}; #[cfg(feature = "neural-network")] use ndarray::{Axis, Ix4, Ix5, RemoveAxis}; use std::marker::PhantomData; -#[cfg(not(target_family = "wasm"))] +#[cfg(target_family = "x86")] use std::sync::OnceLock; pub(crate) fn parallel_size() -> usize { const L1_CACHE_SIZE_DEFAULT: usize = 1 << 15; let l1_cache_size: usize = { - #[cfg(not(target_family = "wasm"))] + #[cfg(target_family = "x86")] { static L1_CACHE_SIZE: OnceLock = std::sync::OnceLock::new(); *L1_CACHE_SIZE .get_or_init(|| cache_size::l1_cache_size().unwrap_or(L1_CACHE_SIZE_DEFAULT)) } - #[cfg(target_family = "wasm")] + #[cfg(not(target_family = "x86"))] { L1_CACHE_SIZE_DEFAULT } From cf0f274757bd28eb42f2ec4b4b77f7942724deef Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Tue, 14 May 2024 14:22:30 -0700 Subject: [PATCH 5/6] ci disable x86 tests on macos --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 250604f..41d51fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,10 +42,12 @@ jobs: - name: test run: cargo test --workspace --no-default-features --features serde,mnist,neural-network -v - name: test avx + if: ${{ matrix.os != 'macos-latest' }} env: RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+avx run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct - name: test fma + if: ${{ matrix.os == 'macos-latest' }} env: RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+fma run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct From d1c73faab376c6793b56496ee6e1a717c99a0b41 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Tue, 14 May 2024 17:38:36 -0700 Subject: [PATCH 6/6] ci fix workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41d51fe..a9094fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+avx run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct - name: test fma - if: ${{ matrix.os == 'macos-latest' }} + if: ${{ matrix.os != 'macos-latest' }} env: RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+fma run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct