Skip to content

Add the perhead path and debug some#460

Merged
gushiqiao merged 12 commits intoModelTC:mainfrom
Michael20070814:Repair_Quant
Mar 30, 2026
Merged

Add the perhead path and debug some#460
gushiqiao merged 12 commits intoModelTC:mainfrom
Michael20070814:Repair_Quant

Conversation

@Michael20070814
Copy link
Copy Markdown
Contributor

No description provided.


assert kvquant_cfg.granularity in ['per_token', 'per_tensor', 'per_group']
# Copy the config to avoid mutating the original quantization config in static KV calibration.
kvquant_cfg = copy.deepcopy(kvquant_cfg)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个地方为啥要deep copy一份?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just avoid mutating the original quantization config.

# LightLLM are handled here.
def collect_calib_json(self):
return collect_lightllm_kv_calib_json(self)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这几个函数和量化无关,可以移出去,可以放到utils

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it

@gushiqiao gushiqiao merged commit 50e9a4b into ModelTC:main Mar 30, 2026
1 of 2 checks passed
@Michael20070814 Michael20070814 deleted the Repair_Quant branch March 30, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants