Skip to content

fix(quant): remove nn.Embeddings quantizers - #318

Merged
pengcuo merged 1 commit into
NVIDIA:mainfrom
mutichung:mutic/fix-embeddings-quantizer
Oct 27, 2026
Merged

pengcuo merged 1 commit into
NVIDIA:mainfrom
mutichung:mutic/fix-embeddings-quantizer

Conversation

@mutichung

Copy link
Copy Markdown
Contributor

Summary

Remove extra nn.Embeddings quantizers that are not supported in ModelOpt v0.44.0.

Issue

Originally, edge was quantized with ModelOpt v0.47.0, while nano/super were quantized with v0.44.0. ModelOpt has nn.Embeddings support in v0.47.0, which leads to restoration failure when loading the checkpoint with v0.44.0. We decided to revert the ModelOpt version to v0.44.0 to make all Cosmos3 FP8 checkpoints consistent.

Example error message
raise ApplyModeError(f"Unmatched keys in quantizer state_dict: {unmatched_keys}")
modelopt.torch.opt.conversion.ApplyModeError: Unmatched keys in quantizer state_dict: {'embed_tokens.input_quantizer', 'action_proj_in.bias.input_quantizer', 'embed_tokens.weight_quantizer', 'action_proj_out.fc.output_quantizer', 'action_proj_out.bias.weight_quantizer', 'action_proj_in.bias.output_quantizer', 'action_proj_out.fc.input_quantizer', 'action_proj_in.fc.output_quantizer', 'action_proj_in.fc.input_quantizer', 'action_proj_in.bias.weight_quantizer', 'action_proj_out.fc.weight_quantizer', 'action_proj_in.fc.weight_quantizer', 'embed_tokens.output_quantizer', 'action_proj_out.bias.output_quantizer', 'action_proj_out.bias.input_quantizer'}

Fix

Additional quantizer metadata for nn.Embeddings are removed. Those layers remain bfloat16 regardless of ModelOpt version, so removing the layer metadata resolves the issue.

Remove extra quantizers for `nn.Embeddings` not supported in modelopt
v0.44.0.

Signed-off-by: Mu-Ti Chung <mutic@nvidia.com>
@pengcuo
pengcuo merged commit cc28c0c into NVIDIA:main Oct 27, 2026
13 checks passed
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.

3 participants