Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2b0da3c
feat(hygon): add native Clover diffusion and sparse MoE operators
Ringssss Oct 29, 2026
c26e298
feat(triton): make clover and moe_fused_dense ops multi-device
humannumber196 Nov 17, 2026
6fb0716
Merge official master (f52af91a) into feat/hygon-clover-operators
humannumber196 Nov 19, 2026
934475d
feat(clover): add shared-layer native providers for all seven clover ops
humannumber196 Nov 20, 2026
24ed8ad
fix(clover): use `Device::Type::kHygon` in the Hygon provider headers
humannumber196 Nov 23, 2026
6dbcd24
fix(triton): serialize the JIT entry points across threads
humannumber196 Nov 23, 2026
eeaf14f
feat(hygon): run MoeFusedDense on native gfx936 kernels
humannumber196 Nov 24, 2026
1d44dca
test(hygon): check and benchmark the native and Triton fused MoE paths
humannumber196 Nov 24, 2026
9fd40b9
Merge official master (c5ae2f47) into feat/hygon-clover-operators
humannumber196 Nov 24, 2026
3b70558
perf(clover): warp-cooperative recurrent_gdn and two-stage coreset
humannumber196 Nov 24, 2026
b2bd066
perf(clover): tensor-core local memory and an exact fallback
humannumber196 Nov 24, 2026
19f867b
perf(clover): single-launch coreset (1.40x -> 0.39x, kernel 0.31x)
humannumber196 Nov 24, 2026
3e6c804
perf(clover): batched loads in block_conv1d, vectorized merge_moe
humannumber196 Nov 24, 2026
3b69a2e
fix(clover): merge_moe beyond 65535 rows failed to launch
humannumber196 Nov 25, 2026
fe0043a
refactor(cuda): share cast, causal conv1d, gating and MoE alignment
humannumber196 Nov 24, 2026
9c303bf
fix(clover): allocate the workspace when the caller provides none
humannumber196 Nov 24, 2026
509cd2e
test(hygon): run the Clover provider tests on Hygon and cover the fus…
humannumber196 Nov 24, 2026
a2a51e0
feat(recurrent)!: add a packed FP32-state overload to RecurrentGatedD…
humannumber196 Nov 24, 2026
578a442
build!: select operators with an ops.json instead of declarations
humannumber196 Nov 24, 2026
c3d4ec1
docs(clover): state the operator contracts in the base headers
humannumber196 Nov 24, 2026
746e613
docs(hygon): add a Hygon SDK build recipe
humannumber196 Nov 25, 2026
aec54a9
fix(clover): make the warp-cooperative kernels gfx936-safe
humannumber196 Nov 25, 2026
6e9cc2f
feat(hygon): tensor-core local memory on gfx936
humannumber196 Nov 25, 2026
40d6ec2
fix(clover): include the NVIDIA caster in the tensor-core local memor…
humannumber196 Nov 25, 2026
deb0ae8
build: cover the operators the current InfiniLM source references
humannumber196 Nov 26, 2026
4f8c5f0
style: format Clover operators and tests
humannumber196 Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ if(WITH_NINETOOTHED)
endif()

if(WITH_TRITON)
if(NOT WITH_NVIDIA)
if(NOT WITH_NVIDIA AND NOT WITH_HYGON)
message(
FATAL_ERROR
"`WITH_TRITON` requires `WITH_NVIDIA=ON` because NVIDIA is the only implemented Triton JIT backend."
"`WITH_TRITON` requires `WITH_NVIDIA=ON` or `WITH_HYGON=ON`."
)
endif()
if(NOT GENERATE_PYTHON_BINDINGS)
Expand Down
8 changes: 8 additions & 0 deletions THIRD_PARTY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,11 @@ from actual package metadata. That conservative package inventory can include
materials for components outside these two DSOs; it is intentionally not filtered
by fixed hashes or used to restrict build capability. A complete wheel or SDK
redistribution must retain its own applicable notices, including secondary ones.

Clover preview kernels
src/triton/ops/clover_block_conv1d/jit.py and
src/triton/ops/clover_local_memory/jit.py are adapted from SGLang PR #46927,
WilliamZR/sglang commit 058939af24d5cdc44bb4b8852d0ddfab555ed71e,
python/sglang/kernels/ops/{mamba/clover_conv_triton.py,attention/clover_gdn_triton.py}.
They retain Apache-2.0 licensing. Changes provide InfiniOps JIT entry points,
Hygon launch geometry, and bounds checks for the state pool.
76 changes: 76 additions & 0 deletions docs/build-hygon-inference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Hygon inference SDK build

This recipe builds the InfiniRT/InfiniOps/InfiniCCL stack for Hygon DCUs. It
was validated on DTK 26.04 with `gfx936` (BW) devices; other Hygon
architectures need their own validation and their own `HYGON_ARCH`. It is a
build recipe, not a toolkit qualification report. Use the source revisions
pinned by the consuming InfiniCore checkout.

## Prerequisites

```sh
source /opt/dtk/env.sh
export CUDA_HOME=/opt/dtk/cuda/cuda
export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
```

Consumers that bind Torch must match its C++ ABI (`_GLIBCXX_USE_CXX11_ABI`).
DTK's Triton compiles the HIP target of the device (for example `gfx936`,
wave size 64) on first use; CUDA compute-capability arithmetic does not apply.

## InfiniRT

```sh
cmake -S submodules/InfiniRT -B build/rt \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$INFINI_ROOT" \
-DWITH_CPU=ON -DWITH_HYGON=ON
cmake --build build/rt -j 12
cmake --install build/rt
```

## InfiniOps

`INFINI_OPS_OPS` selects what the build generates. The profile
`scripts/configs/infiniops_ops_hygon_infinilm.json` lists every operator the
InfiniLM model registry references: with the providers of this platform, or
as `public_api_only` where Hygon has none. The latter keep the complete
InfiniLM source compiling while those model families report unsupported at
runtime; they install no substitute kernels. Update the profile when InfiniLM
references another operator or Hygon gains a provider.

```sh
cmake -S submodules/InfiniOps -B build/ops \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$INFINI_ROOT" \
-DINFINI_RT_ROOT="$INFINI_ROOT" -DWITH_CPU=ON -DWITH_HYGON=ON \
-DWITH_TRITON=ON -DHYGON_ARCH=gfx936 \
-DGENERATE_PYTHON_BINDINGS=ON -DGENERATE_OPERATOR_CALL_INSTANTIATIONS=ON \
-DAUTO_DETECT_DEVICES=OFF -DAUTO_DETECT_BACKENDS=OFF \
-DINFINI_OPS_OPS="$PWD/scripts/configs/infiniops_ops_hygon_infinilm.json"
cmake --build build/ops -j 12
cmake --install build/ops
```

The Python `infini` package must remain importable: its JIT compiler and
kernel sources stay in use after installation. A CMake install puts the
package contents at the prefix; a wheel installs the namespace normally.

## InfiniCCL

```sh
cmake -S submodules/InfiniCCL -B build/ccl \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$INFINI_ROOT" \
-DWITH_HYGON=ON -DWITH_NCCL=ON \
-DAUTO_DETECT_DEVICES=OFF -DBUILD_EXAMPLES=OFF
cmake --build build/ccl -j 12
cmake --install build/ccl
```

## Coverage

With this profile the operators of the dense transformer serving chain, the
standard MoE routing and the fused MoE — native `gfx936` kernels where the
architecture provides them, Triton JIT kernels otherwise — and the Clover
block-diffusion operators have Hygon providers. The model families whose
operators are `public_api_only` in the profile compile but report
unsupported; see the profile for the list. Model-level integration and
serving are documented in the InfiniLM repository.
8 changes: 8 additions & 0 deletions docs/operator-api-alignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ unless callers need it.
When applying these rules, record the selected upstream interface and any
intentional C++ adaptations in the pull request. Follow `CONTRIBUTING.md` for
compatibility, testing, and validation requirements.

## Clover diffusion state operators

The `Clover*` operators use the released Clover model equations, with packed
request/state-pool arguments for inference; the causal GDN recurrence is the
packed form of `RecurrentGatedDeltaRule`. Each contract is documented in the
operator's base header, and the source provenance of the preview kernels in
`THIRD_PARTY.txt`.
194 changes: 194 additions & 0 deletions scripts/configs/infiniops_ops_hygon_infinilm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"add": {
"implementations": "all"
},
"argmax": {
"implementations": "all"
},
"cast": {
"implementations": "all"
},
"cat": {
"implementations": "all"
},
"causal_conv1d": {
"implementations": "all"
},
"chunk_gated_delta_rule": {
"public_api_only": true
},
"clover_block_conv1d": {
"implementations": "all"
},
"clover_coreset": {
"implementations": "all"
},
"clover_live_mask": {
"implementations": "all"
},
"clover_local_memory": {
"implementations": "all"
},
"clover_mask_routes": {
"implementations": "all"
},
"clover_merge_moe": {
"implementations": "all"
},
"convolution": {
"implementations": "all"
},
"copy": {
"implementations": "all"
},
"deepseek_moe": {
"public_api_only": true
},
"embedding": {
"implementations": "all"
},
"fill": {
"implementations": "all"
},
"flash_attn_varlen_func": {
"public_api_only": true
},
"flash_attn_with_kvcache": {
"public_api_only": true
},
"fused_add_rms_norm": {
"implementations": "all"
},
"fused_gated_delta_net_gating": {
"implementations": "all"
},
"fused_qk_norm": {
"public_api_only": true
},
"fused_qk_rms_norm": {
"public_api_only": true
},
"gelu": {
"implementations": "all"
},
"gemm": {
"implementations": "all"
},
"i8_gemm": {
"public_api_only": true
},
"internal_softmax": {
"public_api_only": true
},
"layer_norm": {
"public_api_only": true
},
"mamba_selective_scan": {
"public_api_only": true
},
"matmul_weight_nz": {
"public_api_only": true
},
"moe_align_block_size": {
"implementations": "all"
},
"moe_fused_dense": {
"implementations": "all"
},
"moe_fused_gate": {
"public_api_only": true
},
"mrope": {
"implementations": "all"
},
"mul": {
"implementations": "all"
},
"pad": {
"public_api_only": true
},
"per_channel_quant_i8": {
"public_api_only": true
},
"per_tensor_dequant_i8": {
"public_api_only": true
},
"per_tensor_quant_i8": {
"public_api_only": true
},
"quick_gelu": {
"public_api_only": true
},
"recurrent_gated_delta_rule": {
"implementations": "all"
},
"relu": {
"implementations": "all"
},
"reshape_and_cache_flash": {
"implementations": "all"
},
"rms_norm": {
"implementations": "all"
},
"rotary_embedding": {
"implementations": "all"
},
"row_l2_normalize": {
"implementations": "all"
},
"separate_table_rope": {
"implementations": "all"
},
"sigmoid": {
"implementations": "all"
},
"silu": {
"implementations": "all"
},
"silu_and_mul": {
"implementations": "all"
},
"softmax": {
"implementations": "all"
},
"sum": {
"public_api_only": true
},
"take": {
"public_api_only": true
},
"top_k_top_p_sampling_from_logits": {
"implementations": "all"
},
"topk_sigmoid": {
"public_api_only": true
},
"topk_softmax": {
"implementations": "all"
},
"trans_matmul_weight_nz": {
"public_api_only": true
},
"tril": {
"implementations": "all"
},
"triu": {
"implementations": "all"
},
"upsample_bicubic2d": {
"public_api_only": true
},
"upsample_bilinear2d": {
"public_api_only": true
},
"w4_marlin_gemm": {
"public_api_only": true
},
"w4_marlin_parameters": {
"public_api_only": true
},
"w4_marlin_repack": {
"public_api_only": true
}
}
Loading