Commit Graph

336 Commits

Author SHA1 Message Date
Guillaume Lagrange 09a15e7e15
Avoid 0 denominator in interpolate frac (#2224) 2024-09-01 16:37:32 -04:00
Paul Wagener 23622d765d
Don't panic when the progress is > 1.0 (#2229)
Ratatui asserts that gauges don't have a progress greater than 1.0
This can happen if a dataset reports a lower len() than it actually provides.

This change prevents a panic when the `Progress::items_processed` is greater than the `Progress::items_total`
2024-09-01 16:33:25 -04:00
王翼翔 66ee3bb3bc
Update huber.rs (#2232) 2024-09-01 16:31:07 -04:00
Nathaniel Simard 0dbb7f7e91
Chore: Update cubecl (#2219) 2024-08-30 15:28:00 -04:00
Guillaume Lagrange a9abd8f746
Add missing output padding to conv transpose ONNX (#2216)
* Add output_padding support for ONNX ConvTranspose

* Add missing codegen

* Fix output padding codegen test
2024-08-29 14:07:00 -04:00
Dilshod Tadjibaev 28c2d4e3cd
Update SUPPORTED-ONNX-OPS.md (#2217) 2024-08-29 14:06:42 -04:00
Adrian Müller e8ea9e27c2
Improve ONNX import tensor shape tracking (#2213)
- Calculate result of broadcasting in dim_inference
- keep Shape info when converting from Argument to TensorType
- Remove a few sources of Dim = 0 Tensors, create Scalars instead
- Clean up dim_inference a bit
2024-08-29 14:06:30 -04:00
Adrian Müller 2f4c5ac0a1
Feat: Allow onnx-import expand op with non-const shapes (#2189)
* Feat: Allow onnx-import expand op with non-const shapes

* Generalize ONNX Expand across IntElem
2024-08-29 13:15:44 -04:00
Sylvain Benner a88c69af4a
Refactor xtask to use tracel-xtask and refactor CI workflow (#2063)
* Migrate to xtask-common crate

* Fix example crate name for simple-regression

* Refactor CI workflows

* Flatten linux workflows

* Install grcov and typos from binaries

Although xtask-common support auto-installation of these tools via cargo
it is a lot faster to install them via the distributed binaries

* [CI] Update Rust caches on failure

* [CI] Add shell bash to jobs steps

* [CI] Try cache all crates

* Fix no-std tests not executing

* [CI] Add CARGO_INCREMENTAL 0

* Exclude tch and cuda from tests and merge crates and examples steps

* Fix some typos found with typos cli

* Add Windows and MacOS jobs

* Only test no-std with default rust target

* Fix syntax in composite action setup-windows

* Enable incremental build

* Upate cargo alias for xtask

* Bump to github action checkout v4

* Revert to tch 0.15 and disable WGPU on windows

* Fix color in output

* Add Test command

* Test long output errorring

* Build and test workspace before additional builds and tests

* Disable wgpu tests on windows

* Remove tests- prefix in CI workflow jobs name

* Add Checks command

* Rename ci workflow jobs

* Execute windows and macos CI tests on rust stable only

* Rename integration test files with a test_ prefix

* Fix format

* Don't auto-correct "arange" with typos

* Fix typos in code

* Merge unit and integration tests steps

* Fix macos tests

* Fix coverage step

* Name publish-crate workflow

* Fix bad cache name for macos

* Reorganize commands and get rid of the ci command

* Fix dispatch to customized commands for Burn

* Update to last version of tracel-xtask

* Remove unnecessary shell bash in ci workflow

* Update cargo.lock

* Fix format

* Bump tracel-xtask

* Simplify dispatch of base commands using updated macro

* Update to last version of tracel-xtask

* Adapt legacy run_checks script with new xtask commands

* Run xtask in debug for faster compilation time

* Ditch build step in ci and enable coverage for stable linux only

* Freeze tracel-xtask to specific commit rev

* Update cargo.lock

* Update Step 6 of CONTRIBUTING guidelines about run-checks script

* Remove unneeded CI and CD paragraphgs in CONRIBUTING.md

* Change cache version

* Fix typos

* Use centralized actions and workflows

* Update to last version of tracel-xtask

* Update CONTRIBUTING file to mention integration tests

* Add custom build for thumbv6m-none-eabi

* Ignore onnx files for typos check

* Fix action and workflow paths in github workflows

* Fix custom builds on MacOS

* Bump tracel-xtask crate to last version

* Update Cargo.lock

* Update publish workflow to use reusable workflow in tracel repo

* Add --ci flag for build and test commands
2024-08-28 15:57:13 -04:00
AlteredOxide 0292967000
Feature/codegen gather indices greater than rank 1 (#2199)
* implemented muli-dim index for GatherNode

The `NodeCodegen` impl for `GatherNode` now performs gather in complete
accordance with the ONNX Gather spec.
- a `gather` function was added to the gather.rs file
- `gather()` is now called within the codegen instead of `tensor.select()`
- a test with two test cases have been added
    - test axes 0 and 1
    - both use 2D index tensors

* add gather_onnx to numeric api

Added int and float implementations of gather to the burn-tensor numeric
api:
- named the methods `gather_onnx` to not be confused with the current
  `gather`
- these implementations follow the `Gather` ONNX spec

Updated the gather*.py variants and their onnx outputs

* modified files didn't end up in last commit

* tests passing for onnx gather

The implementation of gather for the ONNX `Gather` spec is tentatively
complete:
- py test models are updated
- onnx_tests are modified and passing: `gather`, `gather_scalar`, and
  `gather_shape`
- node/gather tests are passing

NOTE: The two additional tests in crates/burn-import/src/burn/node/gather.rs that test
the actual functionality of gather are likely to be deleted, since they
are redundant to the tests in
crates/burn-import/onnx-tests/tests/onnx_tests.rs.

* inlined onnx gather within codegen

* rm gather_onnx from public api; rm unnecessary tests

* add comments to gather py models

* some codegen changes; formatting to appease run-checks

- Some necessary changes and improvements to the codegen inlined code
  after translating from public api (removed in previous commit).
- Changed some formatting that run-checks complained about.

* simplify gather codegen; include 1d and 2d onnx tests

Modified the `Gather` codegen per requested changes:
- combined match statements on index
- remove use of `alloc::vec::Vec`
- use map -> collect instead of procedural
- include a 1d index gather onnx test
- remove superflous tests

* delete unused gather.onnx
2024-08-28 07:51:19 -04:00
mepatrick73 795201dcfc
Select kernel from CPA to CubeCL (#2168)
---------

Co-authored-by: louisfd <louisfd94@gmail.com>
2024-08-27 15:17:58 -04:00
syl20bnr 8e78106680 Bump burn version to 0.15.0 2024-08-27 15:13:40 -04:00
nathaniel 4e99ddecdf Fix burn-import version to onnx-ir 2024-08-27 12:58:08 -04:00
Nathaniel Simard 79cd3d5d21
Fix gather unchecked kernel (#2206) 2024-08-26 12:23:02 -04:00
Nathaniel Simard 978ac6c4ec
Chore: Update to newer cubecl version (#2181) 2024-08-25 15:33:16 -04:00
mepatrick73 0beec0e39e
Scatter kernel from cpa to cubecl (#2169) 2024-08-25 13:47:16 -04:00
mepatrick73 c94e743829
Tensor type indent fix (#2196)
* pad-input-fix: adding support for pads as attributes

* final fix

* undo pad changes
2024-08-23 12:46:31 -04:00
mepatrick73 2c12d58cd8
pad-input-fix: adding support for pads as attributes (#2195)
* pad-input-fix: adding support for pads as attributes

* fix: making asked changes

* clippy fix
2024-08-23 12:46:14 -04:00
Guillaume Lagrange f5a1eca3ce
Fix root-mean-square precision issue (#2193) 2024-08-23 11:56:26 -04:00
Guillaume Lagrange 4999421f6c
Add RoPE `init_with_frequency_scaling` (#2194)
* Add RoPE init_with_frequency_scaling

* Fix clippy
2024-08-23 10:30:23 -04:00
Bjorn Beishline 17de832c6e
Make compatible with thumbv6m-none-eabi + add raspberry pi pico example (#2096)
* Made compatible with thumbv6m-none-eabi

* Added example of no_std on rp2040

* Added documentation on usage in no_std

* Rename rp2040 example and add README.md
2024-08-23 07:39:39 -04:00
mepatrick73 e1fed792f7
Gather CPA to CubeCL (#2165)
* working version

* cleanup

* wip

* working version of gather

* testsetsetser

* Revert "testsetsetser"

This reverts commit f37b329697.

* Reapply "testsetsetser"

This reverts commit f8ada0044e.

* Revert "testsetsetser"

This reverts commit f37b329697.

* Revert "working version of gather"

This reverts commit f5047c27c8.

* Revert "wip"

This reverts commit abaaa2dd55.

* Revert "Merge branch 'main' into index-cpa-to-cubecl"

This reverts commit 05bed8ea74, reversing
changes made to 94954fc32c.

* Revert "cleanup"

This reverts commit 94954fc32c.

* Revert "working version"

This reverts commit a06933f029.

* gather test

* fix

* fix clippy

* cleanup
2024-08-22 13:44:26 -04:00
Dilshod Tadjibaev 75a2850047
Add closeness tensor report (#2184)
* Add closeness tensor report

* Add documentation section

* Fix for no-std

* Fix epsilon formatting

* Update report.rs

* Fix import references

* Fix doc test

* Use colored crate instead of passing codes

* Small refactor to use iter directly

* Move colored dep to std

* Add missing

* Fix missing epsilon
2024-08-22 10:19:27 -05:00
Guillaume Charifi 8053001306
Fix LayerNorm normalization. (#2186)
Fixes #2185.
2024-08-20 07:47:15 -04:00
Dilshod Tadjibaev d4a1d2026d
Fix equal/not-equal infinity numbers for burn-ndarray (#2166) 2024-08-15 12:33:54 -05:00
Guillaume Lagrange d2699022df
Add 0-dim tensor checks for creation ops and validate TensorData shape w/ num values (#2137) 2024-08-15 09:54:22 -04:00
Adrian Müller 16239db252
Fix ONNX Gather codegen for Shape input (#2148)
* Fix ONNX Gather codegen for Shape input

* Remove unneccessary cast, switch to slice for ownership
2024-08-15 07:36:13 -04:00
Periwink 0435721188
Convert `reduce_dim_naive` kernel to use the `#[cube]` derive macro (#2117) 2024-08-14 10:46:37 -04:00
Nathaniel Simard ff8d0308fb
Enable cuda-jit in burn-core + in text classification example (#2160) 2024-08-12 18:22:27 -04:00
Guillaume Lagrange 0eec293e28
Fix indices dim check in gather_update_outputs (#2149) 2024-08-12 09:20:25 -04:00
Adrian Müller 12caca7909
Allow ONNX scalar greater/less with scalar (#2146) 2024-08-12 09:11:08 -04:00
Periwink e75eebfc31
Add comments for matmul kernel (#2138) 2024-08-12 09:09:24 -04:00
Adrian Müller 5a0c1dcead
Implement ONNX Gather for scalar indices (#2141)
* Implement ONNX Gather for scalars

* Fix ONNX gather_scalar codegen test
2024-08-09 11:53:01 -04:00
Guillaume Lagrange 724bfbc73b
Add scientific notation formatting for small metric values (#2136) 2024-08-08 16:25:34 -04:00
Guillaume Lagrange 723c9d1a2e
Fix module derive with generics (#2127)
* Remove unnecessary ModuleDisplayDefault generic bound + duplicate ModuleDisplay

* Remove erroneous bound for autodiff module generic
2024-08-08 16:24:51 -04:00
Nathaniel Simard bb4a605ca6
Chore/integrate updated cubecl (#2142) 2024-08-08 16:19:39 -04:00
Dilshod Tadjibaev 1c681f46ec
Precision option for tensor display (#2139) 2024-08-08 15:01:42 -05:00
mepatrick73 27ca6cee95
feat: adding shape support for gather ONNX operation (#2128) 2024-08-08 13:18:03 -04:00
mepatrick73 d770b1f470
ONNX Tile operation (#2092)
* renaming repeat to repeat_dim

* implementing repeat function

* renaming repeat files to repeat_dim

* renaming part 2

* renaming part 3

* renaming part 4

* renaming part 5

* adding test file

* adding unit test

* adding rust book documentation

* adding function args doc

* fixing tests

* changing repeat api to match pytorch equivalent

* fixing clippy error

* implementing tile onnx file

* temp

* working implementation and test

* working e2e test

* adding new supported onnx operation to the md file
2024-08-07 17:43:59 -04:00
Dilshod Tadjibaev 6b61ad5a61
Fix #2091 bug (in-place after expand) (#2114) 2024-08-07 17:37:20 -04:00
mepatrick73 e39485322d
bug fix: adding bounds checking to pad ONNX inputs (#2120)
* bug fix: adding bounds checking

Constant value is an optional value.
Adding a bounds check to make sure we've gotten enough inputs

* fixing pr

* quick little fix

* fixing constant_value cast

* fix clippy
2024-08-07 16:34:43 -04:00
Genna Wingert a01004dd4a
Add Hard sigmoid activation function (#2112)
* Add Hard Sigmoid activation function

* Add ONNX import conversion for HardSigmoid

* Update supported operators list

* Update book

* Make test comparison approximate to eliminate precision issues

* Add burn-candle test

* Fix name in E2E test generator
2024-08-07 13:01:42 -05:00
Periwink dad85e0709
Add onnx mean (#2119)
* make contacts deterministic across Worlds

* add top k acc

* add onnx mean

* fix

* push fix

* format

---------

Co-authored-by: Charles Bournhonesque <cbournhonesque@snapchat.com>
2024-08-07 13:03:59 -04:00
Dilshod Tadjibaev cd848b1c94
Add is_nan and contains_nan tensor ops (#2088)
* Add is_nan and contains_nan tensor ops

* Enable nan test for burn-candle

* Disabling tests due to #2089
2024-08-06 12:16:12 -05:00
Guillaume Lagrange 27d42cdaad
Fix aggregation results slice (#2110)
* Fix aggregation results slice

* View aggregation results as 1d tensor instead
2024-08-06 12:02:11 -05:00
Periwink ade664d4d8
Add top-k accuracy (#2097)
* make contacts deterministic across Worlds

* add top k acc

* update book

---------

Co-authored-by: Charles Bournhonesque <cbournhonesque@snapchat.com>
2024-08-06 12:01:28 -05:00
Dilshod Tadjibaev 80cc6d4eb5
Fix bug: Filling tensor containing f32::NEG_INFINITY will result in NaN for burn-ndarray (#2095)
* Fix #2094 bug

* Fix typo

* Fix mask broadcasting
2024-08-05 08:32:31 -04:00
mepatrick73 f7639bd35a
Repeat operation (#2090)
* renaming repeat to repeat_dim

* implementing repeat function

* renaming repeat files to repeat_dim

* renaming part 2

* renaming part 3

* renaming part 4

* renaming part 5

* adding test file

* adding unit test

* adding rust book documentation

* adding function args doc

* fixing tests

* changing repeat api to match pytorch equivalent

* fixing clippy error
2024-08-02 20:33:47 -04:00
Nathaniel Simard 62a30e973c
Fix: fusion auto bound checks (#2087) 2024-08-01 09:13:10 -04:00
Ragy Abraham 04d7ff24f2
Add polars DataFrame support for Dataset (#2029)
* initial commit to try implement from_dataframes for a burn dataset

* added the beginnings of tests. removed ref to self in utility method

* added unit test for dataframe module. added utility methods to convert polars rows to burn dataset values

* putting polars and dataframe mod behind a fearure flag

* testing both methods

* added a if let OK so that it doesn't panic. if we can't convert serde map to json string. added comments

* using polars serializer, renaming vars

* removed prints. just unwrapping

* setting feature flags back

* return Value::Null rather than panic if we can't serialize list value. no longer convert to object before converting to string. no longer using serde_json to_string method

* Use native deserializer instead of serde_json

* added support for lazyframes. added support to deserialize a few more data. added a few more tests

* Remove lazy, add more testing and other fixes

* Update the book

* Remove lazy feature

* Put back lazy feature for polars

---------

Co-authored-by: Dilshod Tadjibaev <939125+antimora@users.noreply.github.com>
2024-07-31 17:22:49 -05:00