-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add accelerated compiled graph backends and WGPU support #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
208627e
feat: add exact Hessian methods (RR, FR, RF) for mono and multi
leafyoung 8d8c578
feat: add reusable graphs, forward-mode AD, and checked evaluation
leafyoung 2d624ed
feat: add compiled IR, optimizer utilities, and stable math helpers
leafyoung 374bebe
feat: add flat IR, SIMD batch backends, and auto-dispatch
leafyoung 71e8446
feat: add feature-gated WGPU backend with native compute kernel
leafyoung 8e2944b
test: increase coverage to 90% and fix all PR review issues
leafyoung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Cargo configuration for petite-ad. | ||
| # | ||
| # The mold linker flag below speeds up local builds substantially. | ||
| # If mold is not installed, the flag is silently ignored by the linker. | ||
| # Remove or adjust the rustflags if needed for your machine. | ||
|
|
||
| [target.x86_64-unknown-linux-gnu] | ||
| rustflags = ["-C", "link-arg=-fuse-ld=mold"] | ||
|
|
||
| [registries.crates-io] | ||
| protocol = "sparse" # Faster crate downloads |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master, develop] | ||
| pull_request: | ||
| branches: [main, master] | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| rust: [stable, nightly] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup mold linker | ||
| uses: rui314/setup-mold@v1 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: ${{ matrix.rust }} | ||
| components: rustfmt, clippy | ||
|
|
||
| - name: Setup Rust cache | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: ${{ matrix.rust }} | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt -- --check | ||
|
|
||
| - name: Run clippy | ||
| run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
|
||
| - name: Run tests | ||
| run: cargo test --verbose --all-features | ||
|
|
||
| - name: Run examples | ||
| run: cargo test --examples --all-features | ||
|
|
||
| - name: Run benchmarks (check only) | ||
| run: cargo bench --no-run | ||
|
|
||
| coverage: | ||
| name: Code Coverage | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup mold linker | ||
| uses: rui314/setup-mold@v1 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Setup Rust cache | ||
| uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Install cargo-tarpaulin | ||
| run: cargo install cargo-tarpaulin | ||
|
|
||
| - name: Generate coverage report | ||
| run: cargo tarpaulin --lib --out Xml | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| file: ./cobertura.xml | ||
| fail_ci_if_error: false | ||
|
|
||
| security: | ||
| name: Security audit | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup mold linker | ||
| uses: rui314/setup-mold@v1 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Install cargo-audit | ||
| run: cargo install cargo-audit | ||
|
|
||
| - name: Generate temporary lockfile | ||
| run: cargo generate-lockfile | ||
|
|
||
| - name: Run security audit | ||
| run: cargo audit | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,65 +1,61 @@ | ||
| # Pre-commit hooks for Rust project | ||
| # Pre-commit hooks for petite-ad | ||
| # See https://pre-commit.com for more information | ||
| # Run `pre-commit install` to install these hooks | ||
| # Install: pip install pre-commit | ||
| # Setup: pre-commit install | ||
| # Run manually: prek run --all-files # alias for: pre-commit run --all-files | ||
|
|
||
| repos: | ||
| # General hooks | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-added-large-files | ||
| args: ['--maxkb=1000'] | ||
| - id: check-merge-conflict | ||
| - id: check-case-conflict | ||
| - id: mixed-line-ending | ||
| args: ['--fix=lf'] | ||
|
|
||
| # Rust specific hooks using local cargo commands | ||
| - repo: local | ||
| hooks: | ||
| # Run cargo fmt to automatically format Rust files. | ||
| - id: cargo-fmt | ||
| name: cargo fmt | ||
| entry: cargo fmt | ||
| language: system | ||
| types: [rust] | ||
| pass_filenames: false | ||
|
leafyoung marked this conversation as resolved.
|
||
|
|
||
| - id: cargo-check | ||
| name: cargo check | ||
| entry: cargo check | ||
| language: system | ||
| args: ['--all-targets', '--all-features'] | ||
| pass_filenames: false | ||
|
|
||
| # Clippy linting | ||
| - repo: local | ||
| hooks: | ||
| - id: clippy | ||
| # Run cargo clippy to catch common mistakes. | ||
| - id: cargo-clippy | ||
| name: cargo clippy | ||
| entry: cargo clippy | ||
| entry: cargo clippy --all-targets --all-features -- -D warnings | ||
| language: system | ||
| args: ['--all-targets', '--all-features', '--', '-D', 'warnings'] | ||
| types: [rust] | ||
| pass_filenames: false | ||
|
|
||
| # Run tests | ||
| - repo: local | ||
| hooks: | ||
| # Run cargo test to ensure all tests pass. | ||
| - id: cargo-test | ||
| name: cargo test | ||
| entry: cargo test | ||
| entry: cargo test --all-features | ||
| language: system | ||
| args: ['--all-features'] | ||
| types: [rust] | ||
| pass_filenames: false | ||
|
|
||
| # Check documentation | ||
| - repo: local | ||
| # Generic pre-commit hooks for non-Rust files. | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: cargo-doc | ||
| name: cargo doc | ||
| entry: cargo doc | ||
| language: system | ||
| args: ['--no-deps', '--all-features'] | ||
| pass_filenames: false | ||
| # Check for accidentally committed large files. | ||
| - id: check-added-large-files | ||
| args: ["--maxkb=10000"] | ||
|
|
||
| # Check config file syntax. | ||
| - id: check-yaml | ||
| - id: check-json | ||
| - id: check-toml | ||
|
|
||
| # Fix whitespace-only file hygiene issues. | ||
| - id: trailing-whitespace | ||
| exclude: ^(tests/|fixtures/) | ||
| - id: end-of-file-fixer | ||
|
|
||
| # Detect conflict markers and case-insensitive path collisions. | ||
| - id: check-merge-conflict | ||
| - id: check-case-conflict | ||
|
|
||
| # Normalize line endings. | ||
| - id: mixed-line-ending | ||
| args: ["--fix=lf"] | ||
|
|
||
| # Check that scripts with shebangs are executable. | ||
| - id: check-executables-have-shebangs | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.