MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / renormalize

Method renormalize

tensorrt_llm/layers/moe.py:900–906  ·  view source on GitHub ↗
(self, logits)

Source from the content-addressed store, hash-verified

898 return topk_indices, topk_values
899
900 def renormalize(self, logits):
901 # Get top-k experts and renormalize their scores
902 token_scores, token_selected_experts = topk(cast(logits, trt.float32),
903 k=self.moe_config.top_k,
904 dim=-1)
905 token_final_scales = softmax(token_scores, dim=-1)
906 return token_selected_experts, token_final_scales
907
908 def group_limited_greedy(self, logits):
909 n_group = self.moe_config.device_limited_n_group

Callers 1

forwardMethod · 0.95

Calls 3

castFunction · 0.85
softmaxFunction · 0.85
topkFunction · 0.50

Tested by

no test coverage detected