Skip to content

[Feature]: LoRA support for W8A8 SmoothQuant (SmoothQuantAttention / SmoothQuantLinear) #12703

Closed as not planned

Description

@langzhao-netizen

🚀 The feature, motivation and pitch

Problem

In tensorrt_llm/quantization/layers.py, SmoothQuantAttention.forward() asserts
lora_layer_params is None with the message:

AssertionError: lora is not supported on SmoothQuantAttention now

This means engines built from W8A8 SmoothQuant checkpoints (--smoothquant 0.5) cannot use
--lora_plugin auto at build time or load LoRA adapters at runtime.

Motivation

Ampere GPUs (A10, A100) do not have FP8 tensor cores, so W8A8 SmoothQuant is the only
activation-quantized option for these GPUs. At the same time, per-request LoRA is critical
for multi-tenant serving (task-specific fine-tunes). Today users on Ampere must choose between:

  • W8A8 SQ (good quality, no LoRA) — unusable for multi-tenant serving
  • W4A16 AWQ (LoRA works, but lower quality due to 4-bit weights)

This leaves no path to high-quality quantization + LoRA on Ampere hardware.

Note: Issue #2604 reported the same problem in Dec 2024 and was closed as "completed" in Jun 2025,
but the assertion is still present in v1.1.0 (tested with nvcr.io/nvidia/tritonserver:25.02-trtllm-python-py3).

Pitch

Add LoRA support for SmoothQuant layers (SmoothQuantAttention, SmoothQuantLinear) the same
way it is done for FP8:

  1. Remove the assertion guard.
  2. Keep LoRA computation in FP16/BF16 — run the LoRA low-rank path after the INT8 GEMM and add
    the result to the dequantized output.
  3. For the attention path, apply LoRA to Q/K/V projections and dense output the same way
    Attention.forward() does.

This approach preserves the INT8 GEMM throughput for the base model while adding the LoRA delta
in higher precision, matching the pattern already used by FP8 + LoRA.

Reproduction

# Convert checkpoint with SmoothQuant
python3 examples/llama/convert_checkpoint.py \
  --model_dir ./Meta-Llama-3.1-8B-Instruct \
  --output_dir ./ckpt_w8a8sq \
  --dtype float16 --smoothquant 0.5

# Build engine with LoRA — fails
trtllm-build \
  --checkpoint_dir ./ckpt_w8a8sq \
  --output_dir ./engine_w8a8sq \
  --gpt_attention_plugin auto \
  --gemm_plugin auto \
  --max_num_tokens 32768 \
  --max_batch_size 64 \
  --lora_plugin auto \
  --lora_dir ./lora_adapter

### Alternatives

_No response_

### Additional context

- Related open issue: #12202 (FP4 + LoRA, same pattern — we contributed a patch for that one)
- We are happy to contribute a patch for the SmoothQuant + LoRA path if the team can provide
  guidance on which code paths need coverage (single-GPU, TP, gemm_allreduce_plugin, etc.).

### Before submitting a new issue...

- [x] Make sure you already searched for relevant issues, and checked the [documentation](https://nvidia.github.io/TensorRT-LLM/) and [examples](https://github.com/NVIDIA/TensorRT-LLM/tree/main/examples) for answers to frequently asked questions.

Activity

  1. added
    feature requestNew feature or request. This includes new model, dtype, functionality support
    on Apr 2, 2026
  2. added
    Lora/P-tuningParameter-Efficient Fine-Tuning (PEFT) like LoRA/P-tuning in TRTLLM: adapter use & perf.
    on Apr 2, 2026
  3. zeel2104 commented on Apr 5, 2026

    @zeel2104

    Is it open for contributon?

  4. karljang commented on Apr 7, 2026

    @karljang
    Collaborator

    @zeel2104 , Contributions are always welcome! 👍

  5. HOYALIM commented on Jul 14, 2026

    @HOYALIM

    Hi @karljang @laikhtewari — I’d like to take this on if it is still desired and unowned.

    I confirmed that current main still rejects LoRA in the SmoothQuant linear/row-linear and attention paths, and I found no open PR referencing #12703.

    Before implementing, could you confirm that the following bounded scope is the intended direction?

    1. Keep the INT8 SmoothQuant base GEMM unchanged.
    2. Compute the LoRA path in FP16/BF16 and add its delta after the base projection is dequantized.
    3. Cover SmoothQuant column/row linear plus the Q/K/V and dense attention projection paths.
    4. Add focused graph/unit coverage for LoRA routing and negative controls, then rely on upstream single-Ampere GPU CI for engine build, numerical parity, and runtime smoke validation.

    I would keep PyTorch-backend APIs, unrelated quantization formats, TP/multi-GPU expansion, and performance tuning outside this first PR unless maintainers ask for them. If this scope is current, I’m happy to prepare the patch.

  6. karljang commented on Jul 30, 2026

    @karljang
    Collaborator

    Thanks for checking and apologies for the delayed response.
    The legacy TensorRT backend targeted by this issue, including its SmoothQuant layers and trtllm-build was removed by #15918, with its CI coverage removed by #16610. Therefore, please hold off on the proposed implementation; we should close this issue as no longer applicable.
    I’m closing this issue as it’s not planned. Thank you nonetheless.

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

Metadata

Metadata

Assignees

Labels

Lora/P-tuningParameter-Efficient Fine-Tuning (PEFT) like LoRA/P-tuning in TRTLLM: adapter use & perf.feature requestNew feature or request. This includes new model, dtype, functionality support

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions