计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
scalar-quantizers【效率与协作】Operate FSQ, FSP, ResidualFSQ, and GroupedResidualFSQ scalar quantizers in vector-quantize-pytorch.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task needs scalar discretization in vector-quantize-pytorch: finite scalar quantization, finite scalar perturbation, residual scalar quantizers, grouped residual scalar quantizers, index roundtrips, tensor-layout decisions, or scalar-quantizer troubleshooting.
FSQ setup with levels, dim, num_codebooks, return_indices, channel_first, preserve_symmetry, bound_hard_clamp, orthogonal_rotation, projections, and index conversion.FSP setup with levels, dim, channel_first, act_name, quantize_rate, need_inv_act, vector_norm, four-value return tuples, stochastic training perturbation, and eval-time roundtrips.ResidualFSQ and GroupedResidualFSQ for residual stacks, grouped feature splits, num_quantizers, residual reconstruction from indices, return_all_codes, and quantize-dropout caveats.../vector-quantization/ for learned codebook VectorQuantize, RandomProjectionQuantizer, codebook EMA, masks, and top-k/manual EMA updates.../residual-quantizers/ for ResidualVQ and GroupedResidualVQ learned-codebook residual workflows.../lookup-free-and-latent/ for LFQ, ResidualLFQ, GroupedResidualLFQ, LatentQuantize, binary entropy losses, and lookup-free/latent quantization.../sim-and-hierarchical/ for SimVQ, ResidualSimVQ, and HierarchicalVQ.Read these bundled references before implementing or debugging a scalar workflow:
references/api-reference.md for constructor signatures, return tuples, shape contracts, index helpers, projections, and dtype behavior.references/workflows.md for safe FSQ/FSP/residual recipes and code patterns.references/troubleshooting.md for common errors, unsupported settings, roundtrip caveats, and precision/layout fixes.Run the bundled helper when you need a quick CPU sanity check of the installed package and the scalar APIs:
python scripts/smoke_scalar_quantizers.py --help
python scripts/smoke_scalar_quantizers.py
The helper uses small random tensors only. It does not download datasets, train MNIST models, or depend on any source tree.
(quantized, indices). If return_indices=False, the second value is None and index roundtrip helpers are unavailable for that instance.(quantized, indices, norm_loss, other_info).torch.allclose for reconstruction checks that involve FSP, projections, autocast, or low precision. Exact equality is reliable only for the narrow deterministic cases called out in the API reference.channel_first=True for NCHW-style inputs.