What problem does it solve?
Porting an AutoDeploy custom model to tensor/expert parallelism requires inserting precise sharding hints (op substitutions, tp_mode kwargs, all_reduce insertions) into the modeling file without altering its numerical semantics or module structure, which is error-prone when done ad hoc.
Core Features & Use Cases
- Mechanical hint insertion: Substitutes nn.Linear, view, and split calls with torch.ops.auto_deploy equivalents and adds tp_mode, layer_type, output_sizes, and tp_scaled_dim kwargs under a strict allowlist/forbidden-change contract.
- Layer-specific patterns: Provides sharding recipes for MHA, MLA, SwiGLU MLP, MoE, Mamba/SSM, and GatedDeltaNet layers, including single all_reduce merge-point rules.
- Mandatory validation: Enforces an end-to-end multi-GPU run plus a four-configuration sharding equivalence test (tp-only, ep-only, tep, attn-dp) with parsed rel_rmse below tolerance, and a git-diff self-audit classifying every hunk.
- Use Case: When onboarding a new LLM such as a Qwen or DeepSeek variant into TensorRT-LLM AutoDeploy, use this Skill to port its modeling_*.py file to the sharding IR path and verify correctness across parallelism configurations.
Quick Start
Add sharding IR hints to tensorrt_llm/torch/auto_deploy/models/custom/modeling<name>.py and validate it with the sharding equivalence test matrix.