mirror of
https://github.com/tracel-ai/burn.git
synced 2026-05-31 19:49:48 +09:00
* 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
Basic Workflow: From Training to Inference
This example corresponds to the book's guide.
Example Usage
Training
cargo run --bin train --release
Inference
cargo run --bin infer --release
Print the model
cargo run --bin print --release