Journal
Sections
Reading settings
Reading
Natural voice recorded for this course, the same in every browser.
Voice
No voice for this language in this browser.
More voices
Voice for English
Code and English terms
Off: the page’s voice reads everything, with no pause between two voices.
No voice for this language in this browser.
More voices
More voices: Microsoft Edge has natural online voices, and Windows (Settings › Time & language › Speech), macOS and Android install others.
Progress
Section titled “Progress”- Candle read at the tag
0.11.0, commit31f35b1; the course code depends oncandle-coreandcandle-nn0.11.0 - Course code: examples,
expected/outputs, sevencompile_faildoctests,check.sh - Same outputs on Windows and on Linux (a
rust:1.94.0container) - CI on GitHub: the workflow is written, not pushed yet
- Lesson 1: why Candle
- Lesson 2: tensors
- Lesson 3: CPU compute and performance
- Lesson 4: automatic differentiation
- Lessons 5 to 12
- French and Spanish translations of lessons 1 to 4
2026-09-15 — Candle, pinned
Section titled “2026-09-15 — Candle, pinned”- The latest version on crates.io is 0.11.0, published on June 26, 2026. Its sources are the tag
0.11.0, commit31f35b147389700ed2a178ee66a91c3cc25cc80d, cloned apart from this repository.mainwas atddf1b87on the same day. - The workspace lists ten members, among them the WebAssembly examples, and keeps six more crates apart (the GPU kernels,
candle-onnx, the book);candle-transformershas 125 entries undermodels/andcandle-examples111 examples. - The course pins
=0.11.0inCargo.tomland commitsCargo.lock, rather than followingmainas the Candle book’scargo add --gitdoes. - The code uses the CPU only: no Cargo feature is switched on, no model is downloaded in this batch.
2026-09-15 — The course code
Section titled “2026-09-15 — The course code”code/candleis a workspace with one crate,candle-course: 13 examples, andsrc/lib.rswith the helpersshow(rounds every value, so that the three systems print the same digits),outcomeandcaught(prints a panic’s message), and the sevencompile_faildoctests.check.shrunscargo fmt --check,clippy --release --all-targets -D warnings,cargo test --release, then each example, and compares its output and exit code withexpected/.l01_machineandl03_benchdepend on the machine: they run without comparison.- Stable
rustdocchecks that acompile_failsnippet fails, not with which error. One doctest first claimedE0369forResult<Tensor> - f64; compiling the snippet gaveE0277. The workflow adds a nightlycargo test --docon Linux, which checks the codes. - The first release build compiled 128 crates in 73 seconds with
-j 4. 72 of the 119 crates behindcandle-corecome fromtokenizers. data/builds.csvis a copy of the IX course’s file, from commitd9ef7fb, so that lesson 4 trains on the same 52 builds.ix-autogradcomes from Git at IX commit490c395, the commit of the IX course, as a dev-dependency.- On Linux,
check.shran in Docker Desktop 29.2.1 (rust:1.94.0,--cpus 4): every compared output was identical to Windows.
2026-09-15 — The CI
Section titled “2026-09-15 — The CI”.github/workflows/candle-examples.ymlis written:check.shonubuntu-latest,windows-latestandmacos-latest, a cache of the Cargo registry, the Git checkouts andtarget/, keyed onCargo.lock, and the nightly doctest step on Linux.- It isn’t pushed: the token this session pushes with can’t create files under
.github/workflows/without theworkflowscope. Until it runs, macOS (ARM, NEON) is to verify, in particular thef32sums of lesson 4, which could round differently.
2026-09-15 — The measurements
Section titled “2026-09-15 — The measurements”- Intel Core Ultra 9 285K (24 cores, no hyper-threading), 64 GB, Windows 11 Pro, Rust 1.94.0. The machine ran other work at the same time; the lesson says so and treats differences under about 20% as noise.
- The first version of the forward-pass benchmark ran plain tensors, then
Vars, once each, and showed the graph 35% faster. Running two alternating rounds showed a warm-up effect; the lesson shows the alternating version and says why. target-cpu=nativebuilt in 65 seconds in a separate target directory and changed nothing beyond the noise.gemmalready picks AVX2 and FMA kernels at run time.- In a container limited to 4 CPUs, Candle still counts 24 physical cores and starts 24 threads: the small network took 168 ms against 44 ms with
RAYON_NUM_THREADS=1.
2026-09-15 — GA, IX and TARS
Section titled “2026-09-15 — GA, IX and TARS”Commits read: GA 32f143c, IX a7e5fbc (with ix-autograd unchanged since 490c395), TARS 87464ce.
- None of the three depends on Candle. GA (C#) and TARS (F#) run their models with ONNX Runtime and
Microsoft.ML.Tokenizers. - IX wrote its own automatic differentiation,
ix-autograd, overndarray, and keeps a place for a Candle backend. Lesson 4 shows that its gradient and Candle’s agree to1e-9on the IX course’s regression. - Where Candle could serve: GA’s embeddings (lesson 7 compares), and an
ix-autogradbackend if IX needs more operations or a GPU. These are notes for later lessons, not proposals made to the projects.
2026-09-15 — Findings
Section titled “2026-09-15 — Findings”Sixteen things this batch found, each shown by compiled code in the course unless marked. Nothing is filed as an issue or a pull request.
- A C compiler for
candle-core0.11.0. It depends ontokenizerswith theonigfeature, which builds Oniguruma from C sources, for one file, the GGUF tokenizer (lesson 1).mainswitched tofancy-regexin pure Rust; the next release should drop the requirement (to verify). from_vecandfrom_slicedon’t check the element count when the shape has no hole: five values with a(2, 3)shape are accepted and panic later (lesson 2). Issue #3812, fixed onmainby #3813 on August 13, 2026, after 0.11.0.- Float functions on integer tensors panic with
todo!("no unary function for u32")instead of returning an error (lesson 2). Still the case onmainatddf1b87; no issue found about it. - The CPU random generator can’t be seeded:
Device::Cpu.set_seed(42)returns an error, sorandandrandnaren’t reproducible on the CPU (lesson 2). - The README’s cheat sheet doesn’t compile:
tensor.to_dtype(&DType::F16)?passes a reference whereto_dtypetakes aDType(lesson 1, a doctest). copy()clones the whole storage, not the view’s elements: a 1000-element row of a 4 MB tensor still holds 4 MB aftercopy();force_contiguousholds 4 KB (lesson 3).- A confusing message for one index too many:
m.i((0, 0, 0))on a matrix says “dimension index 0 out of range for shape []” (lesson 2). squeezeon a dimension whose size isn’t 1 succeeds silently and returns the tensor unchanged, like PyTorch (lesson 2).- Gradients also go to plain tensors that are direct inputs of recorded operations: the regression of lesson 4 computes gradients for its data (lesson 4). Correct but extra work.
backwardon a non-scalar is seeded with ones without a warning, where PyTorch refuses (lesson 4).- The default thread count ignores container CPU limits: 24 threads under
--cpus 4, four times slower on a small network than one thread (lesson 3). target-cpu=nativebrought no measurable gain for matrix products, element-wise operations or a small network on this machine; Candle’s own.cargo/config.tomlsets it for its examples (lesson 3).f16matrix products aren’t faster thanf32on a CPU:gemm-f16converts tof32blocks (lesson 3).- IX’s documentation describes Candle as using “cuTENSOR” (
code-analysis-tools.md, line 129); Candle’s CUDA features use cuBLAS, cuBLASLt, cuRAND, NVRTC and optionally cuDNN (lesson 1). Read in the sources, not run. hf-hub: Candle 0.11.0’s workspace asks forhf-hub0.5.0 while crates.io’s latest is 1.0.0. For lesson 6 (to verify what changed).- The Candle book installs from Git:
cargo add --git https://github.com/huggingface/candle.git candle-corefollowsmain, so a book example can depend on code that isn’t released (lesson 1).
To verify
Section titled “To verify”- The workflow’s first run on the three systems, and the
f32outputs on macOS ARM. - The C compiler requirement after the next Candle release.
default_num_threadson Apple Silicon, which counts performance cores only.CANDLE_GRAD_DO_NOT_DETACHand second derivatives.- Why contiguous element-wise operations take half the time on Linux as on Windows, on the same processor (allocation, by hypothesis).