Back to AI is open source
HPC-Ops Open Source Interpretation: How Tencent's Hunyuan Production-Grade LLM Inference Operator Library Squeezes Out the Performance of Inference Cards Like H20

HPC-Ops Open Source Interpretation: How Tencent's Hunyuan Production-Grade LLM Inference Operator Library Squeezes Out the Performance of Inference Cards Like H20

AI is open source Admin 124 views

1. Abstract

HPC-Ops is an open-source, production-grade LLM inference operator library from Tencent's Hunyuan AI Infra team, with the goal of bringing mainstream inference cards (especially NVIDIA Hopper/SM90, such as H20) closer to peak hardware utilization. The project focuses on polishing the SOTA kernel from zero-use CUDA + CuTe/CUTLASS, and provides a relatively clean API for easy integration into inference frameworks such as vLLM and SGLang, and is suitable for multi-precision inference scenarios such as BF16/FP8.

2. Core features

1. Ultimate performance for production: For the in-depth optimization of inference critical paths, the official maximum observation acceleration ratio of Attention / GroupGEMM / FusedMoE (up to 2.22x) is given.

2. Key operator coverage: including Attention (Prefill/Decode, including paged attention), Grouped GEMM, Fused MoE and other inference high-frequency operators.

3. Multi-precision and quantization support: Natively supports BF16 and FP8, and covers different quantization scaling methods (such as block-wise/per-tensor).

4. Easy integration and readability: Emphasize "clean abstraction + customizability", and at the same time make the kernel implementation into a modern CUDA learning sample to lower the threshold for secondary development.

3. Installation

1. Environmental requirements: NVIDIA SM90 architecture GPU; Python 3.8+; Compiler with support for C++17; CUDA Toolkit 12.8+

  1. Source code installation (build wheel):
  • git clone https://github.com/Tencent/hpc-ops.git
  • cd hpc-ops
  • make wheel
  • python3 -m pip install dist/*.whl
  • 3. Dependency suggestions: Prepare development/test dependencies according to the requirements-dev.txt of the repository to facilitate running use cases and aligning versions.

4. Typical use cases

1. MoE model inference acceleration: Use FusedMoE / GroupGEMM to reduce GEMM and fusion overhead after expert routing, and improve QPS/QPM.

2. Long context and high concurrency services: Attention (including paged attention) is more sensitive to the throughput and latency of prefill/decode, making it suitable for squeezing GPUs under high load.

3. Secondary integration of inference framework: Replace/extend key operators in vLLM, SGLang, etc. to achieve the engineering path of "local kernel replacement and overall benefit".

4. Kernel R&D and Teaching: The engineering implementation of CuTe/CUTLASS is used as a readable sample for team training and new operator iteration.

5. Ecology and competing products

  1. Ecological location: HPC-Ops is more like a "high-performance operator base" and is suitable for use in combination with inference frameworks (vLLM, SGLang) rather than a direct replacement for a complete inference engine.
  2. Competitors/benchmarking: Attention direction common comparison FlashAttention/FlashInfer/TensorRT-LLM; MoE and GEMM directions are commonly compared with TensorRT-LLM, DeepGEMM, etc. The difference between HPC-Ops is the more aggressive microarchitecture optimization and engineering abstraction of specific hardware and production workloads.

6. Limitations and precautions

1. Hardware threshold: SM90 (Hopper) GPU is currently clearly required; The availability and benefits of other architectures need to be verified by themselves.

2. Version coupling: It is sensitive to CUDA versions, compilers, and dependencies, and it is recommended to lock the environment strictly according to the repository instructions.

3. The "maximum observation acceleration ratio" is not equal to stable returns: different batches, sequence lengths, concurrency and operator fusion methods will lead to differences in returns, and you need to benchmark your own workload.

4. Integration cost: When replacing operators with existing inference stacks, we should pay attention to numerical consistency, accuracy strategy (BF16/FP8) and fallback path to avoid online uncontrollable risks.

7. Project address

https://github.com/Tencent/hpc-ops

8. Frequently asked questions

Q: What is HPC-Ops and what is it suitable for?

A: It is a high-performance LLM inference operator library suitable for replacing key operators in frameworks such as vLLM/SGLang to improve throughput and GPU utilization.

Q: What GPU and CUDA versions does HPC-Ops support?

A: NVIDIA SM90 (Hopper) architecture GPUs are officially required, and CUDA Toolkit requires 12.8 or above.

Q: What inference links does the core operator of HPC-Ops cover?

A: Cover inference critical path operators such as Attention (prefill/decode, including paged attention), Grouped GEMM, and Fused MoE.

Q: How to choose the FP8 quantization/scaling method for HPC-Ops?

A: First, run through the interface and test case provided by the repository, then select a scaling strategy such as block-wise or per-tensor based on accuracy targets and performance indicators, and do end-to-end regression.

Q: How do I evaluate the benefits of HPC-Ops on my own model/business?

A: Use the real request distribution (sequence length, batch, concurrency, MoE configuration) as an A/B benchmark, and measure prefill, decode, and end-to-end throughput/latency respectively.

HPC-Ops Open Source Interpretation: Tencent Hunyuan AI Infra's High-Performance LLM Inference Operator Library How to Drain Inference Computing Power on H20/SM90: A Comprehensive Analysis of HPC-Ops HPC-Ops vs FlashAttention: Attention kernel acceleration points and applicable scenarios HPC-Ops vs FlashInfer: How does Attention performance compare in production inference? HPC-Ops vs TensorRT-LLM: FusedMoE vs. Inference Stack Integration Differences HPC-Ops vs DeepGEMM: FP8 performance vs. engineering costs for GroupGEMM HPC-Ops Getting Started Guide: Source Code Compilation, Make Wheel, and Installation Process Detailed explanation of HPC-Ops environment requirements: SM90, CUDA 12.8 and C++17 BF16/FP8 support for HPC-Ops: How to choose a quantitative scaling strategy HPC-Ops Attention (Prefill/Decode) Optimization Ideas: Why It's Faster Boost QPM with HPC-Ops: From Operator Bottleneck to System Throughput The Value of HPC-Ops in MoE Inference: How FusedMoE Reduces Overhead Typical Usage of HPC-Ops GroupGEMM: PyTorch Call Examples and Notes HPC-Ops Testing and Benchmarking: How to Use the Tests Directory for Regression HPC-Ops Integrated vLLM: General path to replace operator layers HPC-Ops Integration SGLang: Operator Adaptation and Performance Verification Why HPC-Ops emphasizes the "maximum observation acceleration ratio": How to interpret the data correctly Production introduces HPC-Ops checklists: stability, accuracy, and rollback CuTe/CUTLASS Style Code for HPC-Ops: A Modern CUDA Learning Path HPC-Ops Attention accelerates actual combat: KV cache and paged attention are related HPC-Ops FP8 inference implementation: throughput improvement and numerical error control Quantization GroupGEMM for HPC-Ops: Scaling by block vs scaling by tensor Quantifying FusedMoE for HPC-Ops: Expert Weighting Engineering Details for FP8 The division of labor between HPC-Ops and mainstream inference libraries: framework scheduling vs. underlying operators HPC-Ops from Roofline: How to Judge Computing Power Bottlenecks and Bandwidth Bottlenecks When FlashAttention isn't fast enough: why use custom libraries like HPC-Ops What models are HPC-Ops suitable for: Inference workload analysis such as hybrid vs. DeepSeek HPC-Ops Performance Replication Guide: Input Morphology, Sequence Length, and Compilation Parameters HPC-Ops Installation Hit: CUDA Version and Compiler Compatibility HPC-Ops deployment in container environments: Build image and driver matching recommendations How HPC-Ops does A/B Benchmarking: latency, throughput, and video memory The Position of HPC-Ops in Multi-Machine Multi-Card Inference: The Boundary between Operators and Communications HPC-Ops Roadmap Explained: Sparse Attention vs. Extended Quant Support Optimizing Long-Context Inference with HPC-Ops: The Meaning of Sparse Attention HPC-Ops vs. FP16/BF16: When to Switch to FP8 API Design for HPC-Ops: How to Integrate and Customize HPC-Ops Contribution Guide: How to Submit High-Impact PRs and Performance Improvements HPC-Ops adapts to the new architecture's focus: from SM90 to updating GPUs How to Evaluate the Production Benefits of HPC-Ops: QPS/QPM vs. Costing HPC-Ops operator coverage list: Attention, GEMM, MoE at a glance Inference Acceleration with HPC-Ops: Minimum Viable Integration (MVP) Steps HPC-Ops vs. Triton cores: controllability vs. peak performance How to build CMake/Makefile for HPC-Ops: Engineering structure analysis HPC-Ops Security and Stability: The risk point of replacing the underlying operator online HPC-Ops Accuracy Acceptance Method: Align outputs, tolerances, and regression sets HPC-Ops in action for large-scale inference services: monitoring and grayscale HPC-Ops FAQ Summary: Hardware Thresholds, Version Requirements, and Performance Fluctuations Is HPC-Ops Right for You: Selection Recommendations from Business Bottlenecks

Recommended Tools

More