Download docs/interface-audit/interfaces.json from humanfia-lab/inference-kernels: direct link, hf CLI and curl.
- Browser
- Download file 22.3 kB
-
https://huggingface.co/datasets/humanfia-lab/inference-kernels/resolve/main/docs/interface-audit/interfaces.json
- Command line
-
hf download hf://datasets/humanfia-lab/inference-kernels/docs/interface-audit/interfaces.json
-
curl -L -o interfaces.json https://huggingface.co/datasets/humanfia-lab/inference-kernels/resolve/main/docs/interface-audit/interfaces.json
22.3 kB
| { | |
| "date": "2026-10-19", | |
| "sglang_capture_commit": "684fea8af3b11a5b51ec9966c02959a32ad3421c", | |
| "sglang_audit_commit": "0025f9394421451aa09ec192a4a6e7928e14736b", | |
| "all_drop_in": false, | |
| "full_engine_substitution_tested": false, | |
| "counts": { | |
| "reshaped_tensor_operands": 3, | |
| "specialized_leaf_operands": 7, | |
| "structural_adapter_required": 11 | |
| }, | |
| "definitions": [ | |
| { | |
| "definition": "prefix_cached_block_causal_h32_d128", | |
| "inputs": [ | |
| "Q", | |
| "K_prefix", | |
| "V_prefix", | |
| "K_current", | |
| "V_current" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "forward_with_replicated_kv_prefix(q, k_prefix, v_prefix, k_suffix, v_suffix)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/layers/attention/layer.py#L2134", | |
| "adaptation": "After this PR all five tensor operands occur in native positional order. All 28 captured target-image calls have full visibility. The fixed scale, all-valid keys and artificial image IDs are removed. The serving method additionally obtains attention context and supports sequence parallelism; captures use one GPU.", | |
| "next_step": "Integrate at this specialized single-GPU boundary and test the serving context; distributed prefix attention remains outside these captures." | |
| }, | |
| { | |
| "definition": "prefix_cached_block_causal_h32_d128_prefix0", | |
| "inputs": [ | |
| "Q", | |
| "K_current", | |
| "V_current", | |
| "image_ids" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "QwenImage21Attention.attend_sample: several local_attn calls followed by cat_outputs", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/dits/qwen_image21.py#L719", | |
| "adaptation": "The dataset combines the entire prefix into one block-causal operation. The engine calls attention once per text/image segment with different Q/K ranges and text causal masks. image_ids encodes the segment list. Empty prefix tensors, the all-true key mask and fixed scale are removed, but the composed call boundary remains.", | |
| "next_step": "Recapture individual segment calls or introduce explicit segment metadata and a composed-operator integration API; do not label the existing definition a direct leaf replacement." | |
| }, | |
| { | |
| "definition": "noncausal_dense_attention_h32_d128", | |
| "inputs": [ | |
| "Q", | |
| "K", | |
| "V" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "SDPAImpl.forward(query, key, value, attn_metadata)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/layers/attention/backends/sdpa.py#L89", | |
| "adaptation": "The three tensor operands and their [B,N,H,D] layouts match the noncausal no-mask leaf. Head-dependent scale, dropout=0 and causal=False are fixed configuration; the engine passes its own context metadata. This PR removes the redundant runtime scale.", | |
| "next_step": "Integrate the candidate through the existing attention backend/context dispatch; no full-engine replacement has been tested." | |
| }, | |
| { | |
| "definition": "noncausal_dense_attention_h32_d64", | |
| "inputs": [ | |
| "Q", | |
| "K", | |
| "V" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "SDPAImpl.forward(query, key, value, attn_metadata)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/layers/attention/backends/sdpa.py#L89", | |
| "adaptation": "The three tensor operands and their [B,N,H,D] layouts match the noncausal no-mask leaf. Head-dependent scale, dropout=0 and causal=False are fixed configuration; the engine passes its own context metadata. This PR removes the redundant runtime scale.", | |
| "next_step": "Integrate the candidate through the existing attention backend/context dispatch; no full-engine replacement has been tested." | |
| }, | |
| { | |
| "definition": "gdn_decode_qk4_v8_d128_k_last", | |
| "inputs": [ | |
| "q", | |
| "k", | |
| "v", | |
| "state", | |
| "A_log", | |
| "a", | |
| "dt_bias", | |
| "b", | |
| "scale" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "FlashInferGDNKernel.decode", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/linear/kernels/gdn_flashinfer.py#L387", | |
| "adaptation": "The contest decode reads per-batch K-last state and returns a separate new_state, with Q/K normalization disabled. SM100 SGLang instead passes the complete mutable state pool plus slot indices, enables Q/K L2 normalization and writes the pool. The contest model TP/head configuration also differs.", | |
| "next_step": "Capture the real current SGLang boundary, retaining normalization, pool/state-index side effects where present, prefill output buffers/checkpoints and the actual model configuration. Adding identity slot indices to contest tensors would not prove native parity." | |
| }, | |
| { | |
| "definition": "gdn_prefill_qk4_v8_d128_k_last", | |
| "inputs": [ | |
| "q", | |
| "k", | |
| "v", | |
| "state", | |
| "A_log", | |
| "a", | |
| "dt_bias", | |
| "b", | |
| "cu_seqlens", | |
| "scale" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "FlashInferGDNKernel.extend", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/linear/kernels/gdn_flashinfer.py#L481", | |
| "adaptation": "K-last layout matches. Importantly, the actual SGLang FlashInfer prefill leaf already receives a gathered per-batch state, not the whole pool. However SGLang prepares normalized Q/K and linear decay alpha, passes preallocated output/state buffers and optional checkpoint metadata, and scatters states back. The contest definition instead accepts raw A_log/a/dt_bias/b and unnormalized Q/K, with a different model/head configuration.", | |
| "next_step": "Capture the real current SGLang boundary, retaining normalization, pool/state-index side effects where present, prefill output buffers/checkpoints and the actual model configuration. Adding identity slot indices to contest tensors would not prove native parity." | |
| }, | |
| { | |
| "definition": "dense_gemm_bf16_nt_n12288_k4096", | |
| "inputs": [ | |
| "A", | |
| "W" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "reshaped_tensor_operands", | |
| "native_call": "torch.nn.functional.linear(input, weight, bias=None)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/dits/qwen_image21.py", | |
| "adaptation": "Capture flattens batch/sequence dimensions into M; restore the original leading dimensions at the model boundary. Two-dimensional GEMM operands and BF16 output match the bias-free linear leaf.", | |
| "next_step": "Retain original leading shapes in per-call captures for direct high-level F.linear replacement." | |
| }, | |
| { | |
| "definition": "dense_gemm_bf16_nt_n4096_k12288", | |
| "inputs": [ | |
| "A", | |
| "W" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "reshaped_tensor_operands", | |
| "native_call": "torch.nn.functional.linear(input, weight, bias=None)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/dits/qwen_image21.py", | |
| "adaptation": "Capture flattens batch/sequence dimensions into M; restore the original leading dimensions at the model boundary. Two-dimensional GEMM operands and BF16 output match the bias-free linear leaf.", | |
| "next_step": "Retain original leading shapes in per-call captures for direct high-level F.linear replacement." | |
| }, | |
| { | |
| "definition": "dense_gemm_bf16_nt_n4096_k4096", | |
| "inputs": [ | |
| "A", | |
| "W" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "reshaped_tensor_operands", | |
| "native_call": "torch.nn.functional.linear(input, weight, bias=None)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/dits/qwen_image21.py", | |
| "adaptation": "Capture flattens batch/sequence dimensions into M; restore the original leading dimensions at the model boundary. Two-dimensional GEMM operands and BF16 output match the bias-free linear leaf.", | |
| "next_step": "Retain original leading shapes in per-call captures for direct high-level F.linear replacement." | |
| }, | |
| { | |
| "definition": "grouped_gemm_fp8_fp4_e384_n4608_k5120_g32", | |
| "inputs": [ | |
| "Aq", | |
| "Wq_packed", | |
| "scale_A", | |
| "scale_W", | |
| "expert_id" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "deep_gemm_wrapper.grouped_gemm_nt_f8f8bf16_contig(lhs, rhs, out, m_indices, recipe_a, recipe_b)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/deep_gemm_wrapper/entrypoint.py#L132", | |
| "adaptation": "Capture gathers four EP ranks (96 experts each) into a global 384-expert task, removes -1 padded rows, sorts valid rows by expert and serializes UE8M0 scale bytes. The native kernel consumes per-rank padded buffers, packed physical scale layouts, m_indices and a destination buffer. The packaged SGLang baseline reconstructs all four calls.", | |
| "next_step": "Recapture per-rank padded operands, physical scales, output buffers and row maps. Complete logical MoE projection is preserved; the removed half-gate task is not restored.", | |
| "capture_recipe_note": "The capture can expand group-128 activation scales into four identical logical group-32 scale bytes. Original physical scale layout and original group-size metadata are not native task arguments; the packaged baseline reconstructs a group-32 path." | |
| }, | |
| { | |
| "definition": "grouped_gemm_fp8_fp4_e384_n5120_k2304_g32", | |
| "inputs": [ | |
| "Aq", | |
| "Wq_packed", | |
| "scale_A", | |
| "scale_W", | |
| "expert_id" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "deep_gemm_wrapper.grouped_gemm_nt_f8f8bf16_contig(lhs, rhs, out, m_indices, recipe_a, recipe_b)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/deep_gemm_wrapper/entrypoint.py#L132", | |
| "adaptation": "Capture gathers four EP ranks (96 experts each) into a global 384-expert task, removes -1 padded rows, sorts valid rows by expert and serializes UE8M0 scale bytes. The native kernel consumes per-rank padded buffers, packed physical scale layouts, m_indices and a destination buffer. The packaged SGLang baseline reconstructs all four calls.", | |
| "next_step": "Recapture per-rank padded operands, physical scales, output buffers and row maps. Complete logical MoE projection is preserved; the removed half-gate task is not restored.", | |
| "capture_recipe_note": "The capture can expand group-128 activation scales into four identical logical group-32 scale bytes. Original physical scale layout and original group-size metadata are not native task arguments; the packaged baseline reconstructs a group-32 path." | |
| }, | |
| { | |
| "definition": "mixed_mla_decode_deepseek41_h64_d512_k8128_k4512", | |
| "inputs": [ | |
| "Q", | |
| "KV8", | |
| "KV4", | |
| "indices8", | |
| "indices4", | |
| "attn_sink", | |
| "sm_scale" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "sgl_kernel.flash_mla.flash_mla_with_kvcache", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/deepseek_v4_backend.py", | |
| "adaptation": "The four-rank real-head gather differs from native per-rank zero padding. Only reachable physical KV pages are retained; topk lengths and scheduler metadata are reconstructed. Upstream FlashMLA and the serving fork use different FP8 page byte layouts, requiring the packaged conversion. The engine also has mutable scheduling/workspace state.", | |
| "next_step": "Recapture per-rank Q/sink, original cache pools, explicit valid lengths and scheduler metadata. The newer optional MegaAttention path needs missing pre-RoPE/normalization inputs and positions." | |
| }, | |
| { | |
| "definition": "moe_router_gemm_topk_deepseek41_d5120_e384_topk6", | |
| "inputs": [ | |
| "X", | |
| "W", | |
| "bias_text", | |
| "bias_image", | |
| "is_image_token", | |
| "routed_scale" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "MoEGate.forward followed by vision_topk / moe_fused_gate", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/multimodal/dsv41/vl_routing.py", | |
| "adaptation": "One task combines projection and routing. A boolean image selector replaces original token IDs; output IDs are sorted int64 rather than native unordered int32, and deferred routed scaling is applied. The new solution uses the native projection and fused gate, accepts the boolean directly and combines output ordering in one Triton launch.", | |
| "next_step": "Either integrate this composed operation with its explicit output adapter, or split projection/routing captures and retain native token IDs and output dtypes/ordering." | |
| }, | |
| { | |
| "definition": "neighborhood_attention_3d_h16_d64_kt3_ky7_kx7", | |
| "inputs": [ | |
| "Q", | |
| "K", | |
| "V" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "natten.functional.na3d(query, key, value, kernel_size=self.kernel_size, scale=1.0)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/decoders/ltx_2_5_diffusion_decoder.py#L421", | |
| "adaptation": "Tensor layout [B,T,Y,X,H,D] already matches na3d. Q includes the model scale. Kernel size and scale=1 are fixed configuration. The SGLang wrapper now selects NATTEN when installed and otherwise uses the original FlexAttention fallback.", | |
| "next_step": "Bind the fixed keyword configuration and test within the VAE block; no full model substitution is claimed." | |
| }, | |
| { | |
| "definition": "neighborhood_attention_3d_h32_d64_kt3_ky7_kx7", | |
| "inputs": [ | |
| "Q", | |
| "K", | |
| "V" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "natten.functional.na3d(query, key, value, kernel_size=self.kernel_size, scale=1.0)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/decoders/ltx_2_5_diffusion_decoder.py#L421", | |
| "adaptation": "Tensor layout [B,T,Y,X,H,D] already matches na3d. Q includes the model scale. Kernel size and scale=1 are fixed configuration. The SGLang wrapper now selects NATTEN when installed and otherwise uses the original FlexAttention fallback.", | |
| "next_step": "Bind the fixed keyword configuration and test within the VAE block; no full model substitution is claimed." | |
| }, | |
| { | |
| "definition": "neighborhood_attention_3d_h4_d64_kt11_ky11_kx11", | |
| "inputs": [ | |
| "Q", | |
| "K", | |
| "V" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "natten.functional.na3d(query, key, value, kernel_size=self.kernel_size, scale=1.0)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/decoders/ltx_2_5_diffusion_decoder.py#L421", | |
| "adaptation": "Tensor layout [B,T,Y,X,H,D] already matches na3d. Q includes the model scale. Kernel size and scale=1 are fixed configuration. The SGLang wrapper now selects NATTEN when installed and otherwise uses the original FlexAttention fallback.", | |
| "next_step": "Bind the fixed keyword configuration and test within the VAE block; no full model substitution is claimed." | |
| }, | |
| { | |
| "definition": "neighborhood_attention_3d_h8_d64_kt3_ky5_kx5", | |
| "inputs": [ | |
| "Q", | |
| "K", | |
| "V" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "specialized_leaf_operands", | |
| "native_call": "natten.functional.na3d(query, key, value, kernel_size=self.kernel_size, scale=1.0)", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/multimodal_gen/runtime/models/decoders/ltx_2_5_diffusion_decoder.py#L421", | |
| "adaptation": "Tensor layout [B,T,Y,X,H,D] already matches na3d. Q includes the model scale. Kernel size and scale=1 are fixed configuration. The SGLang wrapper now selects NATTEN when installed and otherwise uses the original FlexAttention fallback.", | |
| "next_step": "Bind the fixed keyword configuration and test within the VAE block; no full model substitution is claimed." | |
| }, | |
| { | |
| "definition": "qsa_index_topk_decode_qwen38_h4_d128_topk512_c4", | |
| "inputs": [ | |
| "Q_idx", | |
| "Kc_pages", | |
| "page_table", | |
| "num_complete_blocks" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "QSAIndexer.select_decode_tokens -> qsa_mqa_decode + fast_topk", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/qsa/qsa_indexer.py#L491", | |
| "adaptation": "Capture removes four zero-padded query heads (8 to 4), compacts live cache pages and changes unordered native IDs to ascending logical IDs with -1 suffix. The new default reuses maintained scoring and exact stable compaction; its score-free short path preserves the task's output contract.", | |
| "next_step": "Capture the native padded query/cache/page-table boundary and explicitly support the engine's output ordering, or keep the documented adapters. Do not weaken exact selected-set or lower-ID-tie semantics." | |
| }, | |
| { | |
| "definition": "qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4", | |
| "inputs": [ | |
| "Q", | |
| "K_pages", | |
| "V_pages", | |
| "page_table", | |
| "block_ids", | |
| "context_lens" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "QwenSparseAttnBackend.forward_decode -> TRT-LLM paged attention", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/qwen_sparse_attn_backend.py", | |
| "adaptation": "Inputs are compacted page snapshots after the current-token KV write. The engine receives the original pool, request-to-token metadata and current KV, and fuses sparse block expansion/cache packing. The standalone adapter reconstructs that metadata and physical packing.", | |
| "next_step": "Retain the original pools, request maps, current-token KV writes and the exact fused-call metadata in new captures. The native TRT-LLM solution is provided as a faster measured alternative to FA4, with adapters still explicit." | |
| }, | |
| { | |
| "definition": "sparse_mla_prefill_h64_d512_k128", | |
| "inputs": [ | |
| "Q", | |
| "KV", | |
| "indices", | |
| "topk_length", | |
| "attn_sink", | |
| "sm_scale" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "sgl_kernel.flash_mla.flash_mla_sparse_fwd", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/deepseek_v4_backend.py", | |
| "adaptation": "Capture gathers 16 real query heads from each of four TP ranks into 64 real heads. The engine passes each rank's 16 heads in a zero-padded 64-head buffer and keeps its first 16 outputs. The SGLang adapter repeats four native calls and concatenates their outputs.", | |
| "next_step": "Recapture per-rank padded Q/sink and output slices. Current optional MegaAttention further fuses normalization/RoPE and needs pre-transform inputs not present in this definition." | |
| }, | |
| { | |
| "definition": "sparse_mla_prefill_h64_d512_k640", | |
| "inputs": [ | |
| "Q", | |
| "KV", | |
| "indices", | |
| "topk_length", | |
| "attn_sink", | |
| "sm_scale" | |
| ], | |
| "integration_verified": false, | |
| "boundary": "structural_adapter_required", | |
| "native_call": "sgl_kernel.flash_mla.flash_mla_sparse_fwd", | |
| "source": "https://github.com/sgl-project/sglang/blob/0025f9394421451aa09ec192a4a6e7928e14736b/python/sglang/srt/layers/attention/deepseek_v4_backend.py", | |
| "adaptation": "Capture gathers 16 real query heads from each of four TP ranks into 64 real heads. The engine passes each rank's 16 heads in a zero-padded 64-head buffer and keeps its first 16 outputs. The SGLang adapter repeats four native calls and concatenates their outputs.", | |
| "next_step": "Recapture per-rank padded Q/sink and output slices. Current optional MegaAttention further fuses normalization/RoPE and needs pre-transform inputs not present in this definition." | |
| } | |
| ], | |
| "snapshot_limit": "CaptureWriter materializes contiguous CPU tensors; original storage offsets, aliasing and arbitrary engine strides are not represented by the safetensors inputs. Tensor-dimension correspondence does not prove storage-ABI parity." | |
| } | |