Commit Graph

325 Commits

Author SHA1 Message Date
mepatrick73 c77a04666d working test 2024-08-23 19:03:19 -04:00
mepatrick73 27c7a33dee wip 2024-08-23 16:50:54 -04:00
mepatrick73 bde8e60dc3 scatter basic impl. 2024-08-23 16:46:32 -04:00
mepatrick73 4dbf608194 adding initializers values to indices and updates 2024-08-23 15:32:14 -04:00
mepatrick73 eafe093588 adding scatter onnx model 2024-08-23 14:48: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
Nathaniel Simard f673721d27
Refactor binary op (#2085) 2024-07-31 16:18:21 -04:00
Dilshod Tadjibaev 297173124f
Add 1d and 2d modules for interpolate with scaling (also fix ONNX Resize op) (#2081)
* Add interpolate module

* Update module.md

* Add interpolate 1d and 2d modules

* Consolidated InterpolateMode for 1d and 2d

* Remove CoordinateTransformationMode

* Add 1d tests for interpolate

* Refactor and fixes of ONNX Resize OP

* Fix clippy

* Fix docs

* Fix no_std
2024-07-31 12:08:26 -05:00
Louis Fortier-Dubois e68b9ab0cc
Refactor/jit cube/mask (#2075)
Co-authored-by: louisfd <louisfd@gmail.com>
2024-07-30 09:27:39 -04:00
Nathaniel Simard 096ec13c48
Chore/update/cubecl (#2067) 2024-07-28 12:15:02 -04:00
Guillaume Lagrange 64a2f12827
Extend [min, max] range to ensure zero-point (#2055) 2024-07-24 09:55:11 -04:00
johnhuichen 4a3fc9d4a0
Implement ONNX Pad Operator (#2007)
* Implement ONNX pad

* ONNX pad arguments fix

pad now requires 2 or more arguments
if the third argument is not given, it will default to 0

* fixing bug in input len fix

* change panic comment

Change panic comment from needing two inputs. This comes from the fact that the ONNX spec requires two necessary inputs but could have more two more optional argument.

---------

Co-authored-by: JC <you@example.com>
Co-authored-by: mepatrick73 <pameu17@ulaval.ca>
2024-07-23 13:50:20 -04:00
Guillaume Lagrange 53c77ae646
Convert compatible prelu weights to rank 1 (#2054) 2024-07-23 10:58:20 -04:00
Guillaume Lagrange 4c7353230e
Fix checks_channels_div_groups condition and ONNX conv import with groups (#2051)
* Fix checks_channels_div_groups condition

* Fix conv channels config w/ groups
2024-07-22 12:53:48 -05:00
Mathias Insley 0bbc1ed30f
Bug/Remove Squeeze Panic for Multiple Dimensions (#2035)
* Remove panic for squeeze when more than one axis is specified

* Remove extra Model()

* Change script to squeeze all singleton dimensions

* Revert change since burn requires axes to be specified

* Fix input tensor

* Try updating ONNX files again

* Add script for testing multiple axes along with new ONNX file

* Update squeeze.py comments

* Add squeeze_multiple model to tests

* Fix dim_inference
2024-07-22 12:13:07 -05:00
Nathaniel Simard 19cd67a9e2
Migration/cubecl (#2041) 2024-07-22 11:08:40 -04:00
Guillaume Lagrange 0d5025edbb
Refactor tensor quantization for q_* ops (#2025)
* Move QuantizationScheme to burn-tensor

* Refactor QuantizedTensorPrimitive to include the quantization strategy

* Fix QFloat tensor data display

* Refactor quantization methods to use scheme and qparams (on backend device)

* Fix clippy

* Fix fmt

* Add qtensor primitive tests
2024-07-19 10:39:50 -04:00