model: Kimi-K3 (kimi_linear + kimi_k3) decode/prefill + K3 MXFP4 kernels + tests - #317
Merged
Conversation
…eepEP-LL exchange, resident MoE, --enable-deepep) Core-only slice of the K3 support branch (PR_MERGE_POLICY: scaffolding layer): - core/ C++: Weights_Storage + distributed_weight_daemon (compact per-node host store), HtoD_Engine, GPU_Weight_Buffer, KV_Storage host-paged views, batchgen binding. - batchgen/moe/: deepep_ll.py (DeepEP low-latency EP exchange), marlin_grouped_moe, streamed_sp8_mxfp4, k3_prefill_dequant_once, fused_moe_mxfp4_resident, routing/cuda_routing. - worker/ (decode/prefill/kv_manager/boundary), server/ (server_args --enable-deepep, worker_manager, worker_readiness, batch_scheduler), kv_cache/, continuous_batching, batchgen_worker. - triage: planner/base_planner, sequence, server_worker_main_loop, config, decode_dp_group, kernel_compat, op_builder/core_engine, ckpt_converter, install_deps, docs/troubleshooting.
… + tests Model-only slice of K3 support (PR_MERGE_POLICY: models/** + registration seam + batchgen_kernels/** + tests/**), stacked on the k3-core PR. - kimi_linear + kimi_k3 model, planner, PSM prewarm, whole-model decode CUDA graph, Triton kernels (situ, row-gather, rmsnorm int64, kda-conv, attn-residual int32-wrap fix), vocab-parallel embed/lm_head, tp weight sharding, distributed-weight store config. - K3 MXFP4 Marlin / WGMMA grouped-GEMM kernels + sigmoid-topk routing, KDA fused decode. - tests: unit + staged-gpu + kernel parity; kimi_linear tests live under tests/ (not the runtime package). Checkpoint paths in test docstrings/defaults are placeholders. - decode MoE exchange selected by the core --enable-deepep flag (default off = NCCL).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Kimi-K3 model support —
models/moonshotai/kimi_linear+kimi_k3, the K3 MXFP4 kernels, and tests:tests/Stacked on the core PR #316.
Motivation
Model, kernels, and tests for Kimi-K3, split from core per PR_MERGE_POLICY §2.5 (model =
models/**+ registration seam +batchgen_kernels/**+tests/**). Builds on the #316 scaffolding.Type of Change
model— add/extend model support (models/**+ registration seam + model kernels only)kernel— add/optimize a compute kernel (batchgen_kernels/**+ in-tree kernel dirs)core— change scheduling/serving/runtime scaffolding (the only type that may)fix— narrow bug fix (+ a regression test)infra— build / CI / packaging / scripts / Dockerdocs— documentation onlyFile changes
batchgen/models/moonshotai/kimi_k3/MODULE.mdbatchgen/models/moonshotai/kimi_k3/model.pybatchgen/models/moonshotai/kimi_k3/tokenizer.pybatchgen/models/moonshotai/kimi_linear/Parallel_Strategy_Manager.pybatchgen/models/moonshotai/kimi_linear/attn_residual_triton.pybatchgen/models/moonshotai/kimi_linear/block_residual.pybatchgen/models/moonshotai/kimi_linear/cuda_graph_segments.pybatchgen/models/moonshotai/kimi_linear/distributed_weight_store.pybatchgen/models/moonshotai/kimi_linear/k3/mxfp4_expert.pybatchgen/models/moonshotai/kimi_linear/k3/mxfp4_layout.pybatchgen/models/moonshotai/kimi_linear/k3/tensor_map.pybatchgen/models/moonshotai/kimi_linear/kda_conv_triton.pybatchgen/models/moonshotai/kimi_linear/kimi_initializer.pybatchgen/models/moonshotai/kimi_linear/kimi_parameter_server.pybatchgen/models/moonshotai/kimi_linear/model.pybatchgen/models/moonshotai/kimi_linear/moe_cuda_graph_segments.pybatchgen/models/moonshotai/kimi_linear/moe_tp_reshard.pybatchgen/models/moonshotai/kimi_linear/planner.pybatchgen/models/moonshotai/kimi_linear/rmsnorm_triton.pybatchgen/models/moonshotai/kimi_linear/row_gather_triton.pybatchgen/models/moonshotai/kimi_linear/serving_modules.pybatchgen/models/moonshotai/kimi_linear/situ_triton.pybatchgen/models/moonshotai/kimi_linear/tp_weight_sharding.pybatchgen/models/moonshotai/kimi_linear/vocab_parallel.pybatchgen/models/moonshotai/kimi_linear/whole_model_cuda_graph_segments.pybatchgen/models/moonshotai/kimi_linear/wrappers.pybatchgen_kernels/__init__.pybatchgen_kernels/_jit_registry.pybatchgen_kernels/_version.pybatchgen_kernels/attention/dsa/fast_topk_cuda.pybatchgen_kernels/attention/kda_fused_decode.pybatchgen_kernels/setup.pybatchgen_kernels/src/attention/kda_fused_decode.cubatchgen_kernels/src/attention/qkv_wgmma.cubatchgen_kernels/src/moe/dispatch_scatter_3d.cubatchgen_kernels/src/moe/expert_mxfp4_wgmma.cubatchgen_kernels/src/moe/fused_int4_wgmma_grouped.cubatchgen_kernels/src/moe/grouped_int4_wgmma.cubatchgen_kernels/src/moe/grouped_int4_wgmma_ext.cubatchgen_kernels/src/moe/grouped_mxfp4_wgmma.cubatchgen_kernels/src/moe/marlin_grouped_gemm.cubatchgen_kernels/src/moe/routing/gate_sigmoid_topk.cubatchgen_kernels/src/moe/routing/routing_extension.ccbatchgen_kernels/src/moe/routing/routing_ops.hbatchgen_kernels/src/moe/single_expert_int4_wgmma.cutests/gpu/kimi_linear_tp_weight_parity.pytests/gpu/mxfp4_resident_ep_world2_parity.pytests/gpu/run_kimi_k3_kda_gpu.shtests/gpu/streamed_sp8_mxfp4_world8_parity.pytests/gpu/test_gate_sigmoid_topk_k16.pytests/gpu/test_kimi_k3_attn_residual_triton.pytests/gpu/test_kimi_k3_dequant_once_prefill.pytests/gpu/test_kimi_k3_kda_batched_segment_parity.pytests/gpu/test_kimi_k3_kda_conv_triton.pytests/gpu/test_kimi_k3_kda_fla_parity.pytests/gpu/test_kimi_k3_kda_fused_decode_parity.pytests/gpu/test_kimi_k3_kda_head_parallel_parity.pytests/gpu/test_kimi_linear_latent_moe_serving.pytests/gpu/test_kimi_linear_mxfp4_latent_moe_serving.pytests/gpu/verify_k3_mxfp4_expert.pytests/integration/paged_kv/test_host_kv_copy_stream_ordering.pytests/kimi_k3_harness.pytests/kimi_k3_oracle_assets/__init__.pytests/kimi_linear/test_block_residual_segment_capture.pytests/kimi_linear/test_conv1d_layout_cpu.pytests/kimi_linear/test_conv1d_std.pytests/kimi_linear/test_decode_graph_adapter.pytests/kimi_linear/test_fused_moe_std.pytests/kimi_linear/test_kda_manager_graphready.pytests/kimi_linear/test_kda_segment_capture.pytests/moe/gpu_parity_mxfp4_marlin.pytests/moe/test_mxfp4_marlin_repack.pytests/test_batch_scheduler_pool_failure.pytests/test_batchgen_model_config.pytests/test_core_signal_handler_source.pytests/test_decode_host_kv_stream_order.pytests/test_dsa_valid_token_kernels.pytests/test_glm5_planner.pytests/test_gpu_page_table_stability.pytests/test_grouped_fp8_blockwise_moe.pytests/test_jit_extension_name_uniqueness.pytests/test_kimi_k3_block_residual_prealloc.pytests/test_kimi_k3_deepep_ll_graph.pytests/test_kimi_k3_distributed_weight_config.pytests/test_kimi_k3_empty_decode_batch_view.pytests/test_kimi_k3_empty_rank_whole_graph.pytests/test_kimi_k3_gpu_kv_compaction.pytests/test_kimi_k3_kda_scratch_reservation.pytests/test_kimi_k3_kda_segmented.pytests/test_kimi_k3_kda_slot_planner.pytests/test_kimi_k3_model.pytests/test_kimi_k3_prefill_offload_tracking.pytests/test_kimi_k3_prefill_profile_scope.pytests/test_kimi_k3_resident_prefill_control.pytests/test_kimi_k3_resident_prefill_handoff.pytests/test_kimi_k3_row_gather_triton.pytests/test_kimi_k3_server_startup_init.pytests/test_kimi_k3_situ_triton.pytests/test_kimi_k3_tensor_map.pytests/test_kimi_k3_tokenizer.pytests/test_kimi_k3_vocab_parallel.pytests/test_kimi_linear_block_residual_serving.pytests/test_kimi_linear_ffn_chunk.pytests/test_kimi_linear_flashmla_metadata_contract.pytests/test_kimi_linear_kda_projection_fusion.pytests/test_kimi_linear_m2a_alog_head_shard.pytests/test_kimi_linear_m2b_boundary_validator.pytests/test_kimi_linear_m2b_decode_dp_group.pytests/test_kimi_linear_m2b_moe_scatter_gather.pytests/test_kimi_linear_moe_cuda_graph_contract.pytests/test_kimi_linear_rmsnorm_chunk.pytests/test_kimi_linear_shared_expert_tp.pytests/test_pool_output_parsing.pytests/test_resident_ep_latent_tp_layout.pytests/test_server_args.pytests/test_server_worker_readiness.pytests/test_worker_fatal_propagation.pytests/test_worker_host_kv_append_completion.pytests/unit/test_query_book_pool_grow_rebind.pytests/worker/test_boundary.pytests/worker/test_decode.pytests/worker/test_kv_manager.pytests/worker/test_prefill.pyChecklist