Skip to content

Commit

Permalink
Merge pull request #69 from charles-r-earp/ci-fixes
Browse files Browse the repository at this point in the history
Ci fixes
  • Loading branch information
charles-r-earp authored May 15, 2024
2 parents 58faf3f + d1c73fa commit e620edd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ 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
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
Expand Down Expand Up @@ -82,8 +84,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
Expand All @@ -102,10 +104,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
Expand All @@ -119,12 +121,12 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 5 additions & 6 deletions src/dataset/mnist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/tensor/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize> = 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
}
Expand Down

0 comments on commit e620edd

Please # to comment.