Skip to content

Align locality-domain MoE quantization detection with Linear planning #18377

Open

Description

@coderabbitai

Summary

Align quantization detection in LocalityDomainExecutionPlanner.plan_moe with LocalityDomainExecutionPlanner.plan_linear.

Rationale

plan_moe currently reads quant_config.quant_mode and calls has_any_quant() without excluding KV-cache-only quantization. plan_linear reads the intended layer quantization source and excludes KV-cache-only quantization. The two planners can therefore classify equivalent configurations differently. In particular, a KV-cache-quantized BF16 MoE can be rejected as unsupported instead of using the BF16 locality-domain MoE path.

Affected area

  • tensorrt_llm/_torch/locality_domain/policy.py
  • LocalityDomainExecutionPlanner.plan_moe

Required changes

  • Confirm and use the intended MoE layer quantization attribute.
  • Use the same quantization source for NVFP4 detection and general quantization detection.
  • Exclude KV-cache-only quantization when determining whether weight quantization is present.
  • Classify KV-cache-quantized BF16 MoE configurations as BF16 when all other BF16 requirements are met.

Acceptance criteria

  • plan_moe and plan_linear apply consistent effective-weight quantization semantics.
  • A KV-cache-only-quantized BF16 MoE does not reach the unsupported-quantization branch solely because of KV-cache quantization.
  • Unit coverage verifies the expected classification and disabled reasons.

Backlinks

Requested by: @farazkh80

Activity

  1. added
    Model optimization
    on Aug 28, 2026
  2. Kabeer-NT commented on Aug 28, 2026

    @Kabeer-NT

    Hi @farazkh80, I have a patch for this: plan_moe now reads layer_quant_mode and uses has_any_quant(exclude_kv_cache=True), mirroring plan_linear, plus unit coverage (the new tests fail pre-fix and pass post-fix; full planner suite passes).

    Since policy.py only exists on the #18369 branch, would you prefer a PR against rubin_feat/cutedsl_foundation_bf16, or should I wait for the merge and target main? Happy either way.

  3. farazkh80 commented on Sep 17, 2026

    @farazkh80
    Collaborator

    Reassigning to @peaceh-nv, who owns the locality-domain call-site wiring in #19272 (LocalityDomainExecutionPlanner is part of that surface). @Kabeer-NT thanks for the patch — please open it as a PR and tag Peace as reviewer; it may be simplest to land it alongside or right after #19272.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Model optimization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions