* doc(notebook) : add more basic operations and some examples
Add execution outputs to basic-tensor-op.ipynb
- Add outputs for trigonometric, reduction and comparison operations
- Add operation summary and PyTorch API comparison
Refactor plots.ipynb for autodiff and gradient descent
- Rewrite notebook to demonstrate autodiff and gradient flow
- Add GD from scratch and linear regression examples
- Update dependencies and remove unused plotting code
* resolve review feedback
* fix(notebook): - delete conclusion as review feedback
- use tensor instead of iter
- rename file
* fix: make vulkan feature opt-in for guide example
The guide example had `burn/vulkan` in its default features, which
caused `cargo build` to fail on macOS without the Vulkan SDK installed.
Workspace feature unification forced all workspace members to build
with the spirv feature, triggering a panic in cubecl-wgpu's build script.
Move vulkan to a non-default opt-in feature, matching the pattern used
by other examples (mnist, text-classification, server).
* skip burn-cuda tests on macOS
CUDA is not available on macOS. Gate the entire test module with
cfg(not(target_os = "macos")) to avoid test failures.
* fix burn-wgpu dtype test on macOS
Without the `metal` feature flag, wgpu still uses Metal at runtime on
macOS. The fallback test branch assumed a non-Metal GPU and asserted
F64 support, which Metal doesn't provide. Add a macOS-specific branch
that matches actual Metal runtime capabilities.
* enable vulkan by default on non-macOS for guide example
Use platform-conditional dependency to keep vulkan enabled by default
on Linux/Windows where it works without extra setup, while excluding
it on macOS where the Vulkan SDK is required.
* add comment for vulkan feature in guide example
* wip burn-rl
* clean up types traits, remove paradigm trait, improve learner
* code quality
* book
* doc
* error in doc
* revert TrainStep rename and remove paradigm components
* trainstep refactor with assoc types
* fix docs
* fix warning
* comment
* remove evaluator step
* add more rl stuff and change Adaptor trait
* metrics for rl and revert adaptor change
* docs + cleanup event processor for rl
* policy vs agent refactor
* rework renderer
* policy no longer generic over env
* early version of checkpointing
* versioning
* off policy training loop
* naming consistency and loading from record
* naming
* add other backends
* strategies and configs
* env initializer and cum reward metric
* transition backend thing compiles
* mostly docs and naming
* reorganize files
* batchable trait and re-arrange some bounds
* start env runner refactor
* rework autobatcher and env_runnner episodes
* change autobatcher dynamic and tweak dqn params
* fix typos and warnings
* params tweeking
* file naming
* fix docs
* metrics api and dependency bump
* address PR comments and fix lint
* kill process when user kills training
* handle kill signal renderer
* format
* remove dqn-agent from ci tests bc of dependency issue
* Add check for wasm-bindgen installation
Check for wasm-bindgen installation and install if missing.
* Simplify build script by removing wasm-bindgen check
Removed installation check for wasm-bindgen.
* Fix all kernels to work with optimized tensors
* Remove test code from guide
* Clean up guide features
* Update cubecl
* Fix split analysis
* Update cubecl
* Manually reformat
* Fix name
* Use unreachable instead of panic for destructure
* Use wildcard for candle
* Move `decompose_linear` to utils
* Flip test condition for candle
* Move ONNX inference MNIST example to burn-onnx
Moving to https://github.com/tracel-ai/burn-onnx/tree/main/examples/onnx-inference
* Move Raspberry Pi Pico example project to burn-onnx
Moving to https://github.com/tracel-ai/burn-onnx/tree/main/examples/raspberry-pi-pico
* Move image-classification-web example to burn-onnx
Moving to https://github.com/tracel-ai/burn-onnx/tree/main/examples/image-classification-web
* Refactor import-model-weights example to use burn-store
Replace burn-import with burn-store for loading PyTorch and Safetensors
model weights. Convert from NamedMpk (.mpk) format to Burnpack (.bpk)
format for native Burn model storage.
- Use PytorchStore and SafetensorsStore for weight loading
- Use BurnpackStore for saving/loading converted models
- Rename namedmpk binary to burnpack
- Add PyTorchToBurnAdapter for Safetensors files exported from PyTorch
- Update inference to accept Model directly instead of ModelRecord
* Remove ONNX to Burn development guide from contributor-book
The guide has been moved to the burn-onnx repository:
https://github.com/tracel-ai/burn-onnx/blob/main/DEVELOPMENT-GUIDE.md
* Update Cargo.lock
* Move pytorch-tests and safetensors-tests from burn-import to burn-store
Migrate test directories from crates/burn-import/ to crates/burn-store/
and update all tests to use the new burn-store API.
Changes:
- Update Cargo.toml dependencies from burn-import to burn-store
- Replace PyTorchFileRecorder/SafetensorsFileRecorder with PytorchStore/SafetensorsStore
- Convert record-based loading to direct model loading via ModuleSnapshot::load_from()
- Convert LoadArgs options to fluent builder pattern (.with_key_remapping(), etc.)
- Fix model configurations to match actual PyTorch weight file dimensions
- Add init() methods for models that previously only had new_with(record)
All 37 pytorch tests and 1 safetensors test pass.
* Fix test file paths after moving test directories to burn-store
Update paths in burn-store/src tests to reference the new locations
of pytorch-tests and safetensors-tests directories.
* Add migration guide for burn-import to burn-store
Document migration path from deprecated PyTorchFileRecorder and
SafetensorsFileRecorder to the new PytorchStore and SafetensorsStore APIs.
Cover API mapping, code examples, and common migration issues.
Include details on printing LoadResult for debugging and helpful suggestions.
* Remove burn-import crate (moved to burn-onnx repo)
The burn-import crate has been moved to a separate repository:
https://github.com/tracel-ai/burn-onnx/tree/main/crates/burn-import
For loading PyTorch and SafeTensors model weights, use burn-store instead
with PytorchStore and SafetensorsStore.
* Replace pytorch/safetensors docs with unified model-weights page
Consolidate PyTorch and SafeTensors model import documentation into a
single comprehensive page covering burn-store usage. The new page covers:
- All supported formats (Burnpack, SafeTensors, PyTorch)
- Loading and saving workflows
- Advanced features (filtering, remapping, partial loading, zero-copy)
- API reference and troubleshooting
* Simplify burn-store README and point to Burn Book
* Consolidate model weights docs into saving-and-loading page
Merge the model-weights documentation into the main saving-and-loading
page, providing a single comprehensive guide for all model persistence
operations using burn-store.
- Remove separate import/model-weights.md page
- Update saving-and-loading.md with full burn-store documentation
- Remove unused SVG images from import folder
- Update navigation in SUMMARY.md and import/README.md
* Move ONNX import to standalone section, point to burn-onnx repo
- Create new onnx-import.md as standalone top-level section
- Update links to point to burn-onnx repo (github.com/tracel-ai/burn-onnx)
- Remove import/ folder (no longer needed)
- Streamline documentation with quick start focus
* Restore full ONNX import documentation content
Restored detailed content including:
- Understanding ONNX section
- Burn's ONNX Support advantages
- ONNX compatibility and opset version guidance
- Step-by-step guide with code examples
- Advanced configuration options
- Troubleshooting section
- Examples and resources with links to burn-onnx repo
* Update ONNX examples links to burn-onnx repo
* Update ONNX-related example links in examples.md to burn-onnx repo
* Fix Burnpack extension: .burnpack -> .bpk
* Remove ONNX Tests README reference from docs
* Improve table formatting in ONNX import and saving docs
Reformats markdown tables in onnx-import.md and saving-and-loading.md for better readability and consistency. No content changes, only improved alignment and line breaks.
* Remove onnx-ir and onnx-ir-derive crates
Moved to https://github.com/tracel-ai/burn-onnx
* Remove burn-onnx crate
Moved to https://github.com/tracel-ai/burn-onnx
* Remove ONNX references from workspace config and README
- Remove burn-onnx entries from Cargo.toml workspace members/exclude
- Remove RUSTSEC-2024-0437 (protobuf) from audit.toml
- Update README ONNX section to point to burn-onnx repo
- Update README model loading section to point to new docs
- Remove ONNX example from README (moved to burn-onnx)
* Clean up remaining ONNX references
- Remove ONNX publish jobs from publish.yml
- Update semver-checks exclude list
- Update burn-book overview.md links
- Update burn-book no-std.md links to burn-onnx repo
- Remove ONNX proto license from NOTICES.md
- Update .gitignore comment
* Remove unused protobuf and rust-format dependencies
* Remove onnx-tests example from contributor-book
* Update Cargo.lock
* Format long line in test for readability
Split a long line in the should_fail_if_struct_field_is_missing test to improve code readability. No functional changes were made.
* Restore Record-based saving/loading sections per PR feedback
* Explain burn-store motivation in saving-and-loading docs
* Remove em dash from burn-store intro
* Format long line in test for readability
* Move ONNX import into burn-onnx crate
* Update publish
* Update burn-import -> burn-onnx
* Fix clippy warnings that are no longer allowed
* Allow unused
* Update contributor book references to burn-onnx
Update all burn-import path references in the ONNX development guide
to point to the new burn-onnx crate location.
* Remove ONNX integration steps from burn op guide
Deleted the section detailing how to add a new operation to burn-onnx, including ONNX IR and code generation mapping steps. This streamlines the guide and removes outdated or redundant ONNX-specific instructions.
* Update onnx-ir references from burn-import to burn-onnx
Update documentation and code comments to reference the new burn-onnx
crate instead of burn-import.
* Update ONNX test producer name to burn-onnx-test
Update producer_name metadata in Python test scripts from
"burn-import-test" to "burn-onnx-test" for consistency.
* Undo ONNX file changes
* docs: add DataframeDataset example using Polars (#2428)
* chore: add required-features for dataframe-dataset example
* refactor dataframe example to reuse shared types and download utility
* chore: formated code
* Tracing; WIP
* WIP towards all_reduce tuning.
* Add tracing support for collective operations and refactor all_reduce implementation
* wip
* Refactor all_reduce by removing monoid_broadcast and migrating shared tensor map utilities to a centralized module. Add tracing instrumentation for collective operations. Include minor performance tweaks and fixes across broadcast, reduce, and related modules.
* Refactor collective operations by introducing `PeerDeviceMap` and `get_peer_devices`. Simplify device handling in broadcast and all_reduce functions. Migrate shared logic to `tensor_map.rs` for improved reuse and clarity.
* Refactor all_reduce_sum_centralized return type to use `CollectiveTensorMap`. Remove unused `HashMap` dependency for cleaner imports.
* Update `tracing` dependency configurations and align features across crates
- Add `attributes` feature to `tracing` for enhanced functionality in multiple crates.
- Standardize inclusion of `tracing/std` in applicable feature sets.
- Fix minor typo in `reduce_timing` example documentation.
* Update `tracing-core` and `tracing-subscriber` configurations to enforce default features across crates
- Add and standardize `default` features for `tracing-core` and `tracing-subscriber`.
- Extend `tokio` with `tracing` feature in `burn-communication`.
- Align dependency feature sets for consistent tracing behavior.
* Add `tracing` and `tracing-core` dependencies with standardized feature configurations
- Include `tracing` and `tracing-core` in `Cargo.toml` with appropriate features across crates.
- Add `tracing/default` and `tracing-core/default` to feature sets in `burn`.
- Remove redundant `default` feature usage for `tracing-core` in `burn-train` and `burn-import`.
This is still broken for the no-std target:
```terminaloutput
$ cargo build --color always --no-default-features --target thumbv6m-none-eabi -p burn
```
* this doesnt work
* Remove portable-atomic dependencies and make tracing optional
Eliminates all uses of portable-atomic and portable-atomic-util from the workspace, including conditional dependencies for non-atomic pointer targets. Updates tracing and tracing-core dependencies to be optional in all affected crates, and adjusts feature flags to use dep:tracing and conditional tracing features. Also updates attribute macros in burn-autodiff to only use tracing instrumentation when the std feature is enabled.
* Add AllReduceOp and AllReduceResult imports to server.rs
Imported AllReduceOp and AllReduceResult in local/server.rs to support additional collective operations. This prepares the server module for handling all-reduce functionality.
* Reformat imports in server.rs for readability
Adjusted the formatting of the import statements in server.rs to improve readability and maintain consistency with Rust style guidelines. No functional changes were made.
* Refactor collective operations to generalize `WebSocket` to `Protocol` and improve shared logic reuse.
* Fix typo in error message: "missmatch" → "mismatch" in collective operations
* Refactor: Replace `send_err_to_all` with `fail` for improved error handling consistency in collective operations.
* Refactor `Op` to simplify `peer_devices` acquisition logic and reuse shared operations
* Refactor: Inline await expressions in `all_reduce` and `broadcast` operations; simplify `peer_devices` logic by removing redundant implementation.
* Refactor: Simplify `reduce`, `all_reduce`, and `broadcast` operations by replacing `into_iter` with `iter`, removing unused imports, and streamlining collection mechanisms
* Refactor: Move `effective_root` and `peers` methods from `BroadcastOp` to `BroadcastOpCall` to simplify struct design and enhance cohesion
* Refactor: Simplify `broadcast` operation by reordering logic, inlining expressions, and enhancing readability
* Refactor: Use `expect` for clearer error handling in `reduce` operation, inline variable for global strategy
* Refactor: Rename `reduce_timing` to `dop_timer`, modularize components into `workers`, `parsers`, and `event_utils`, and simplify event instrumentation logic.
* Refactor: Remove unused imports, streamline tracing setup, and simplify `WorkerHandle` interface by removing unused methods and variables
* Refactor: Relocate `WorkRequest` enum to `workers.rs` and remove unused import in `run` function
* Refactor: Remove redundant default values in `Args` struct definition
* Refactor: Simplify tensor reduction and broadcasting logic, streamline `peer_devices` handling, and remove unused imports
* readme/otel
* Simplify imports and std propagation.
* fmt
* rebase/fix
* Handle empty tensors in cat and slice_assign ops
Updated tensor API to treat empty tensors as no-ops in slice_assign and to filter out tensors with size 0 along the concatenation dimension in cat. Added tests to verify correct behavior when handling empty tensors and empty slice assignments. This prevents backend errors and ensures consistent results for edge cases.
* Clarify handling of empty slices and tensors in ops traits
Added documentation notes to BoolTensorOps, IntTensorOps, and FloatTensorOps traits specifying that empty slice assignments and empty tensors are handled at the high-level tensor API and will not be passed to backend implementations. This clarifies backend responsibilities and prevents unnecessary checks for empty cases.
* Refactor tensor concatenation to simplify filtering
Streamlined the filtering of non-empty tensors by directly mapping to primitives, reducing unnecessary intermediate steps and improving code clarity in the tensor concatenation logic.
* Migrate model export to burnpack format
Removed support for multiple record types (PrettyJson, NamedMpk, Bincode, etc.) and updated all model export logic to use burnpack format exclusively. Refactored BurnGraph and NodeCodegen to remove precision settings and record type abstractions. Updated build scripts, CLI, and tests to reflect burnpack-only workflow. Deleted legacy test_record_type.rs and related code paths.
* Refactor LSTM tensor ops to use NdArray backend
Replaces manual byte-level tensor manipulation in LSTM import with NdArray backend tensor operations for slicing, transposing, and bias addition. Simplifies code and improves maintainability by leveraging backend tensor APIs for all transformations during ONNX import. Adds SerializationBackend type alias and updates helper functions in node_traits.rs.
* Switch ONNX example to runtime-loaded .burnpack weights
Removed the embedded-model feature and updated dependencies to use burn-store with the burnpack feature. Updated README and build script to reflect that model weights are now stored in .burnpack format and loaded at runtime, simplifying the import process and improving support for larger models.
* Update ONNX import docs for burnpack format
Revised documentation to clarify the use of `.burnpack` files for model weights, updated dependency instructions, and improved step-by-step guidance for importing ONNX models into Burn. Contributor guide now references `.burnpack` files and updates serialization details for new ONNX operators.
* Remove dead code allowance from extract_node_data
The #[allow(dead_code)] attribute was removed from the extract_node_data function, indicating that the function is now used or the allowance is no longer necessary.
* Move extern crate alloc to top of file
Relocated the 'extern crate alloc;' statement to the beginning of node_traits.rs for improved clarity and convention. Removed redundant extern crate statement at the end of the file.
* Add embedded model weights support for ONNX import
Introduces the `embed_states` option to ModelGen, allowing model weights to be embedded in the binary using `include_bytes!`. Updates documentation and code generation to support loading models from embedded weights, which is useful for WebAssembly and single-binary deployments. Also updates dependencies and build script for image-classification-web example to use embedded weights.
* Remove unused 'bytes' dependency from burn-store
The 'bytes' crate was removed from burn-store's dependencies in Cargo.toml and Cargo.lock, indicating it is no longer required.
* Refactor LinearNode to handle weight layout without transposition
Updated LinearNode codegen to use LinearLayout::Col for ONNX Gemm nodes, eliminating the need for weight transposition during import. Removed the create_lazy_snapshot_with_transform and transpose_2d utilities, simplifying snapshot logic and reducing code complexity.
* Add has_bias support to LayerNorm nodes
Introduces a has_bias field to LayerNormConfig and updates LayerNormalizationNode codegen to handle models with or without bias (beta) parameter. The ONNX importer now detects the presence of bias and configures Burn's LayerNorm accordingly, ensuring correct parameter initialization and snapshot handling.
* Support runtime split size calculation using num_outputs
Adds logic to handle split size calculation at runtime when static shape is unavailable, using num_outputs in both codegen and processor. Updates SplitConfig and related tests to support this scenario, ensuring split nodes can be generated and processed without static shape information.
* Handle transA in Gemm to Linear conversion
Added a check to ensure Gemm nodes with transA=1 are not converted to Linear, as only transA=0 is supported. Also updated documentation and removed transA attribute during conversion.
* Refactor model checks to use burn-store for test data
Replaces burn-import and PyTorchFileRecorder usage with burn-store and PytorchStore in all model-checks crates. Updates Cargo.toml dependencies and main.rs files to use new test data loading approach, adds TestData::new initializers, and updates file extensions for RF-DETR model weights. Also restricts onnx dependency version in rf-detr/get_model.py.
* Fix raspberry pi pico example not compiling
* Update dependencies for raspberry pi pico
* Update deps in raspberry-pi-pico
* Remove raspberry-pi-pico from workspace
* Fix lints for run_model
* Remove name from metric entry and introduce metric ids
* reemovee tags from metric entry struct
* update book
* standardize how the metric entries are passed to loggers
* complete doc