Skip to content

Conversation

@freeliuzc
Copy link
Collaborator

Motivation

  1. 支持MTP下的静态C8量化
  2. 优化显存分配

Modifications

  1. 在 Speculative Decoding(MTP)中为静态 CacheKV 实现 C8 量化。
  2. 优化推理过程中的内存使用。
  3. 重构相关数据结构和 Kernel 路径,确保与现有推理流程兼容。

Usage or Command

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link

paddle-bot bot commented Nov 20, 2025

Thanks for your contribution!

else:
self.scheduler_config.max_num_batched_tokens = self.model_config.max_model_len

self.scheduler_config.max_chunk_len = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_chunk_len建议命名再准确达意点儿,现在听起来模糊不清

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的,我理解这里的最合适的是 max_num_batched_tokens,但是被占用了,你觉得哪个更合适

self.pooler_config: Optional["PoolerConfig"] = field(init=False)
self.override_pooler_config: Optional[Union[dict, "PoolerConfig"]] = None
self.revision = None
self.prefix_layer_name = "layers"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix_layer_name同样也是,已经有一个prefix_name了,那么prefix_layer_name包不包括最前面的ernie/model字段呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不含包,因为有个 prefix_name,所以 prefix_layer_name 用来区分

@freeliuzc freeliuzc merged commit 2d1dade into PaddlePaddle:develop Nov 21, 2025
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants