pub enum Target {
Exact(String),
Regex(String, Regex),
Glob(String),
HfModule(String, Option<Regex>),
Class(String),
}Expand description
2026-09-28: One target or ignore entry.
Variants§
Exact(String)
2026-09-28: An exact module path.
Regex(String, Regex)
2026-09-28: A compressed-tensors re: pattern, anchored at both ends as Python’s
re.match plus the checkpoint’s $ do.
Glob(String)
2026-09-28: A ModelOpt glob (*, ?).
HfModule(String, Option<Regex>)
2026-09-30: An HF fp8 modules_to_not_convert / ignored_layers entry: a module
path matched on whole dotted segments. It names the module itself, a parent of it
(model.visual excludes model.visual.blocks.0.attn.proj), or its trailing segments
(lm_head); mlp.gate names the MoE router ...mlp.gate, never the dense
...mlp.gate_proj. These are the three rules of transformers should_convert_module
(quantizers/quantizers_utils.py: re.match(f"{key}\\."), re.match(key),
name.endswith(key)) restricted to segment boundaries, and include vLLM’s exact
prefix in ignored_layers (is_layer_skipped, quantization/utils/quant_utils.py). An
entry with regex syntax beyond . is that regex, anchored at the start (re.match) and
ending on a segment boundary.
Class(String)
2026-09-28: A module class (Linear). Every module the plan is asked about is a
linear layer, so Linear matches all of them and any other class none.
Implementations§
Source§impl Target
impl Target
Sourcepub fn ignore_entry(dialect: IgnoreDialect, s: &str) -> Result<Self>
pub fn ignore_entry(dialect: IgnoreDialect, s: &str) -> Result<Self>
2026-09-30: An ignore entry of dialect, the one matcher the precision plan and the
weight loaders share. A malformed entry is refused.
Sourcepub fn compressed_tensors(s: &str) -> Result<Self>
pub fn compressed_tensors(s: &str) -> Result<Self>
2026-09-28: A compressed-tensors target or ignore entry: re:<pattern>, a class
name (Linear), or an exact path.
2026-09-30: As compressed-tensors matches them (0.12.2, utils/match.py _match_name):
a re: pattern by re.match (anchored at the start only), anything else by equality.
Sourcepub fn hf_module(s: &str) -> Result<Self>
pub fn hf_module(s: &str) -> Result<Self>
2026-09-30: An HF fp8 modules_to_not_convert / ignored_layers entry
(Target::HfModule). An empty entry, or one whose regex does not compile, is refused.
Sourcepub fn modelopt(s: &str) -> Self
pub fn modelopt(s: &str) -> Self
2026-09-28: A ModelOpt entry: a glob when it has a wildcard, else exact.
2026-09-30: ModelOpt writes exact module names or fnmatch globs; vLLM’s
ModelOptFp8Config.is_layer_excluded (quantization/modelopt.py) adds a substring
fallback, which is not followed here: it has the mlp.gate / mlp.gate_proj hazard.
Sourcepub fn matches_name(&self, module: &str) -> bool
pub fn matches_name(&self, module: &str) -> bool
2026-09-28: Does this entry name module (classes excluded)?