$ the-wire · showcase
Jinja engine aligns with Jinja2; hub-kernel fallbacks now warn once
By RepoJournal · Filed · About Hugging Face
The huggingface.js Jinja engine now supports Jinja2-style namespaces, `**` unpacking, and `**` exponentiation, while transformers warns once when a hub-kernel function silently falls back to its reference PyTorch path.
The huggingface.js Jinja engine now supports Jinja2-style namespaces, call/macro arguments, and `**` unpacking, along with `**` exponentiation [1]. It also tightens template formatting around operator precedence. This is a medium-risk change: existing templates that relied on old namespace or macro behavior may now evaluate differently, so reviewing templates that use calls or namespaces is advised. Additionally, a hub fix corrects parameter counts for packed MLX models, which previously under-reported logical parameters because packed weights are stored in U32 containers [2]. For example, `avlp12/Motif-3-Alis-MLX-8bit` reported 88.6B instead of the correct 314.8B, and the fix prevents valid `total_parameters` metadata from being rejected.
In transformers, hub-kernel functions now warn once when they fall back to their reference PyTorch path [3]. The warning names the pip distribution to install (for causal_conv1d too) and states how much slower the reference path is, replacing silent fallback with an explicit, single warning that stays out of traced graphs. Supporting this, TRL pins the invariant suite's FA2 hub kernel to the v2 branch after the nightly job went red on 2026-08-27 due to an upstream transformers 5.16.1 issue [4]. The stable-ABI builds of the kernel repo's v3 branch fail in the FA2 varlen backward whenever `num_heads != num_heads_kv`, which hits Qwen2.5-0.5B (GQA, 14 q / 2 kv heads) every run across torch 2.10 to 2.13.
Kernels now fail fast with a clear exception when a kernel version is incompatible, rather than warning and risking a hard-to-understand failure after a full download [5]. The nix-builder adds ROCm 7.14 support; upstream moved to a new build system and repository (TheRock), so the `rocm-packages` package set was forked into `rocm-packages` and `rocm-packages-old` to handle the non-1:1 repackaging [6]. TRL also removed the unused `FLASH_ATTENTION_VARIANTS` constant from the DPO trainer [7] and dropped vLLM 0.19.0 support [8].
Action items
- → Review Jinja templates that use namespaces or macros after the huggingface.js update huggingface/huggingface.js [plan]
- → Install the named pip distribution when a hub-kernel fallback warning appears, to recover kernel speed huggingface/transformers [plan]
- → Monitor TRL nightly jobs for the pinned FA2 hub kernel fix huggingface/trl [monitor]
- → Ensure your TRL environment no longer relies on vLLM 0.19.0 huggingface/trl [plan]
References
- [1] [jinja] Fix namespaces and add support for ** syntax ↗ huggingface/huggingface.js
- [2] [hub] Fix parameter counts for packed MLX models ↗ huggingface/huggingface.js
- [3] Warn once when a hub-kernel function falls back to its reference PyTorch path (#48185) ↗ huggingface/transformers
- [4] Pin the invariant suite's FA2 hub kernel to the v2 branch ↗ huggingface/trl
- [5] kernels: make kernels version check a validator ↗ huggingface/kernels
- [6] nix-builder: add support for ROCm 7.14 ↗ huggingface/kernels
- [7] Remove the unused FLASH_ATTENTION_VARIANTS constant from the DPO trainer (#7013) ↗ huggingface/trl
- [8] Drop vLLM 0.19.0 support (#7002) ↗ huggingface/trl