Commit Graph

610 Commits

Author SHA1 Message Date
claude
a50adefdfc feat: xllm MoE CUDA kernels — fused_topk + compute_index + combine
3 MoE kernel files adapted for corex:
  moe_fused_topk.cu: LOG(FATAL)→TORCH_CHECK, +torch/extension.h
  moe_compute_index.cu: CHECK_LE→TORCH_CHECK, uses cub::BlockScan (corex CUB)
  moe_combine.cu: fixed duplicate include, +torch/extension.h

New pybind binding: xllm_moe_bind.cpp
  → moe_fused_topk(gating, topk, renormalize, bias, scoring_func)
  → moe_compute_index(expert_id, num_experts)
  → moe_combine_result(gemm2, weights, N, topk)

AST verification added for all 3 functions
2026-08-14 11:23:49 +00:00
claude
49cd7def89 fix: slot_ids dtype long→int32 in cache test 2026-08-14 11:20:07 +00:00
claude
1f51feee05 fix: cos_sin_cache dtype float→half in rope test 2026-08-14 11:18:02 +00:00
claude
7fc0c1defa test: AST call chain verification for all 4 xllm kernel .so
verify_ast_chain.py tests every exported function:
  xllm_norm.so:       rms_norm (vs PyTorch), fused_add_rms_norm (vs PyTorch)
  xllm_activation.so: silu_and_mul (vs F.silu), gelu_and_mul (vs F.gelu)
  xllm_rope.so:       rotary_embedding (verify rotation applied)
  xllm_cache.so:      reshape_paged_cache (verify slot write)
  vs_ixformer:        compare our .so output vs base image ixformer

All 4 .so compiled successfully:
  xllm_norm.so       1.4MB  [rms_norm, fused_add_rms_norm]
  xllm_activation.so 1.3MB  [silu_and_mul, gelu_and_mul, act_and_mul]
  xllm_rope.so       1.2MB  [rotary_embedding]
  xllm_cache.so      1.3MB  [block_copy, reshape_paged_cache]
2026-08-14 11:14:58 +00:00
claude
3d816cd18d fix: add ceil_div + DEVICE_INLINE to device_utils.cuh
ceil_div<T> was in xllm utils.h (removed for glog).
DEVICE_INLINE macro also moved to shared header.
2026-08-14 11:11:15 +00:00
claude
302aa9608a fix: block_copy.cu — DEVICE_INLINE, CHECK_EQ→TORCH_CHECK, cstdint
Remaining glog dependencies removed:
  - DEVICE_INLINE macro defined inline
  - CHECK_EQ(a,b) → TORCH_CHECK(a == b)
  - CHECK_GT(a,b) → TORCH_CHECK(a > b)
  - #include <cstdint> for int32_t
2026-08-14 11:06:07 +00:00
claude
900ae0b1ef fix: block_copy.cu remove utils.h (glog), CHECK→TORCH_CHECK
3/4 kernels now compile:
  ✓ xllm_norm.so      (rms_norm, fused_add_rms_norm)
  ✓ xllm_activation.so (silu_and_mul, gelu_and_mul, act_and_mul)
  ✓ xllm_rope.so       (rotary_embedding)
  → xllm_cache.so      block_copy.cu had utils.h→glog — fixed
2026-08-14 11:02:57 +00:00
claude
a206fc1d43 fix: activation.cu torch/extension.h + LOG(FATAL)→TORCH_CHECK, reshape_paged_cache.cu torch header
xllm_norm.so: ✓ COMPILED AND LOADED (rms_norm, fused_add_rms_norm)

activation.cu fixes:
  - Add #include <torch/extension.h> (torch::Tensor not visible from torch/cuda.h alone)
  - Replace LOG(FATAL) with TORCH_CHECK (no glog)

reshape_paged_cache.cu:
  - Add #include <torch/extension.h>
2026-08-14 10:52:54 +00:00
claude
093bfb380f feat: pybind11 bindings for xllm CUDA kernels
norm.cu compiled successfully on BI-V100 (only warning: fp8 __host__ attr).
Failed at import because no PYBIND11_MODULE — now fixed.

New bindings/ directory with 4 binding files:
  xllm_norm_bind.cpp      → rms_norm, fused_add_rms_norm
  xllm_activation_bind.cpp → silu_and_mul, gelu_and_mul, act_and_mul
  xllm_rope_bind.cpp       → rotary_embedding
  xllm_cache_bind.cpp      → reshape_paged_cache, block_copy

Build script updated: each .so = kernel .cu + binding .cpp
2026-08-14 10:50:13 +00:00
claude
415fff85f1 fix: add DISPATCH_FLOATING_TYPES macro to device_utils.cuh
DISPATCH_FLOATING_TYPES was defined in xllm/core/kernels/cuda/utils.h
which was pulled in via cuda_ops_api.h → utils.h.
Since cuda_ops_api.h was removed (glog dependency), the macro was missing.

Now defined in device_utils.cuh with include guard, available to all kernel files:
  norm.cu, activation.cu, rope.cu, block_copy.cu, reshape_paged_cache.cu
2026-08-14 10:45:37 +00:00
claude
0359103b9b fix: remove glog/cuda_ops_api.h dependency from all xllm CUDA kernels
cuda_ops_api.h includes glog/logging.h and ATen/DynamicLibrary.h
which are not available in corex standalone compilation.

All kernel .cu files only need device_utils.cuh (provides namespace,
XLLM_KERNEL_ATTR macro, CUB includes, type helpers).

Fixed files:
  norm.cu, activation.cu, rope.cu, block_copy.cu, reshape_paged_cache.cu
  moe/moe_combine.cu, moe/moe_compute_index.cu, moe/moe_fused_topk.cu
2026-08-14 10:30:10 +00:00
claude
51cb90b9ab fix: adapt xllm norm.cu for corex CUB (CUDA 10.2)
Key change: replace CCCL 3.6 types with corex CUB equivalents
  - cuda::std::plus<> → cub::Sum
  - cuda::maximum<>  → cub::Max
  - Remove #include <cuda/std/functional>

Test results from real machine (3/4 passed):
  ✓ __shfl_down_sync works on ivcore10
  ✓ manual SMEM+shuffle block reduce works
  ✓ corex CUB cub::BlockReduce<float,256> compiles and runs correctly (32640)
  ✗ CCCL 3.6 variadic function issue — corex clang rejects device variadic

Confirmed: use /usr/local/corex/include/cub/ for all kernel code
           cccl_upstream is reference only, NOT compilable on corex

Build script: bash qwen3_6_scripts/build_xllm_kernels.sh
2026-08-14 10:19:51 +00:00
claude
089b9ff4e2 test: fix CUB compat tests + probe corex built-in CUB
v1 failures analyzed:
  1. __shfl_down_sync: load_inline bug (not hardware issue) — fixed with file-based compile
  2. CCCL 3.6: 'CUDA < 12 not supported' + variadic functions in device code
     → corex reports CUDA 10.2, corex clang rejects variadic in device code

v2 tests:
  [1/4] __shfl_down_sync — does ivcore10 support warp shuffle?
  [2/4] manual block reduce — SMEM + shuffle without CUB
  [3/4] cub::BlockReduce using COREX's own CUB (/usr/local/corex/include/cub/)
  [4/4] cub::BlockReduce using CCCL 3.6 with CCCL_IGNORE_DEPRECATED_CUDA_BELOW_12

probe_corex_cub.sh — discovers corex CUB version, compiles standalone test

Run on real machine:
  bash qwen3_6_scripts/probe_corex_cub.sh
  python3 qwen3_6_scripts/test_cub_compat_v2.py
2026-08-14 10:11:10 +00:00
claude
793743f5c0 test: CUB compatibility on BI-V100 — warp shuffle + BlockReduce
Three tests:
  1. __shfl_down_sync — warp shuffle PTX instruction
  2. Manual block reduce (SMEM + shuffle) — handwritten
  3. cub::BlockReduce<float, 256> — actual CCCL header

If test 1+2 pass but 3 fails → CUB headers need corex adaptation
If test 1 fails → ivcore10 doesn't support warp shuffle → need different reduction strategy

Run on real machine: python3 qwen3_6_scripts/test_cub_compat.py
2026-08-14 08:21:48 +00:00
claude
ec140f3605 docs: complete porting assessment — 5 repos, 2660 build targets, ivcore10 compatibility
cat'd every source:
  - CCCL c/parallel/src/reduce.cu: NVRTC JIT (cannot port directly)
  - CCCL c/parallel.v2/src/reduce.cu: hostjit/libnvcc (cannot port directly)
  - CUB block/warp headers: pure header-only (CAN compile with corex)
  - CUTLASS SM70 SIMT GEMM: CAN port (example 24 grouped_gemm)
  - FlashAttention: SM80 Tensor Core (cannot port), but layer_norm is SIMT
  - FLA: pure Triton (needs corex Triton verification)
  - xllm ILU: all already ported

Key finding: CCCL c/parallel depends on nvrtc JIT — must bypass with AOT compilation
using CUB header-only API + corex clang --cuda-gpu-arch=ivcore10
2026-08-14 08:17:25 +00:00
claude
3a2cfc87c9 test: xllm CUDA kernel verification suite for BI-V100
test_xllm_cuda_kernels.py — 7 test groups:
  1. activation.cu: silu_and_mul via ixf_F, compare vs torch.nn.functional.silu
  2. norm.cu: rms_norm + fused_add_rms_norm via ixf_F, compare vs PyTorch
  3. rope.cu: rotary_embedding via ixf_F, verify rotation applied
  4. moe_topk_softmax: corex .so, verify shapes + weights sum to 1
  5. ix_moe_bridge: full 7-step fused MoE pipeline (topk→expand→gemm→act→gemm→combine)
  6. ix_attn_bridge: load test (prefill_attention, decode_attention, linear)
  7. ix_full_bridge: silu_and_mul + rms_norm through bridge .so

Revert: undo unnecessary cccl_upstream sync (already up to date)

Run on real machine: python3 qwen3_6_scripts/test_xllm_cuda_kernels.py
2026-08-14 08:01:23 +00:00
claude
8d75652949 feat: import CUDA kernels from xllm/CCCL/FLA upstream repos
Sources cloned and tree'd (no --depth):
  - jd-opensource/xllm: ILU kernels, CUDA kernels, MoE kernels
  - NVIDIA/cccl: CUB tuning/dispatch headers (block-level primitives)
  - fla-org/flash-linear-attention: Triton GDN kernels
  - NVIDIA/cutlass: grouped GEMM reference (read, not copied)
  - Dao-AILab/flash-attention: attention kernel reference (SM80+, read only)

New CUDA kernels (from xllm, SM-agnostic, portable to BI-V100):
  ex_engine/xllm_kernels/cuda/activation.cu    (188 lines) — silu_and_mul, gelu
  ex_engine/xllm_kernels/cuda/norm.cu          (600 lines) — rms_norm, fused_add_rms_norm
  ex_engine/xllm_kernels/cuda/rope.cu          (258 lines) — rotary_embedding
  ex_engine/xllm_kernels/cuda/block_copy.cu    (209 lines) — copy_blocks, swap_blocks
  ex_engine/xllm_kernels/cuda/reshape_paged_cache.cu (101 lines) — KV cache ops
  ex_engine/xllm_kernels/cuda/headers/         (5 headers for compilation)

ILU bridge kernel sources (from xllm, verified SAME as upstream):
  ex_engine/xllm_kernels/ilu/    (10 files, 925 lines total)
  — activation.cpp, attention.cpp, fused_moe.cpp, group_gemm.cpp,
    matmul.cpp, norm.cpp, rope.cpp, ilu_ops_api.h, ixformer.h, utils.h

FLA Triton GDN kernels (for GatedDeltaNet without SM90+ FlashQLA):
  ex_engine/fla_kernels/gated_delta_rule/  (7 files, 2370 lines)
  — chunk_fwd.py (428), chunk.py (487), wy_fast.py (409),
    fused_recurrent.py (392), naive.py (161), gate.py (380)

CCCL sync (12 tuning + 14 dispatch headers updated from NVIDIA/cccl):
  cccl_upstream/cub/cub/device/dispatch/tuning/ — 12 changed files synced
  cccl_upstream/cub/cub/device/dispatch/ — 14 changed dispatch files synced

Compilation targets for real machine (ivcore10):
  1. CUDA kernels: --cuda-gpu-arch=ivcore10 via corex clang/16
  2. ILU bridges: torch.utils.cpp_extension linking ixformer .so
  3. FLA kernels: Triton JIT (if Triton works on BI-V100)
2026-08-14 07:48:52 +00:00
claude
051b02d3cd feat: ix_moe_bridge + ix_attn_bridge — dlopen bridges for full ixformer::infer API
Bridge architecture (from xllm/core/kernels/ilu/ixformer.h):

ix_moe_bridge.so (MoE 7-step fused pipeline):
  - topk_softmax → moe_compute_token_index_api → moe_expand_input
  - moe_w16a16_group_gemm (x2) → silu_and_mul → moe_output_reduce_sum
  - fused_moe_forward(): replaces entire Python expert loop
  - Fix: group_gemm format NT→TN (match xllm trans_b=true)

ix_attn_bridge.so (attention + linear):
  - ixinfer_flash_attn_unpad_with_block_tables (fused prefill)
  - xllm_paged_attention (fused paged decode)
  - ixformer_linear (matmul + activation)
  - residual_rms_norm (fused residual + norm)

Integration:
  - ix_fused_moe.py: Python loader (prebuilt .so → JIT → unavailable)
  - qwen3_5.py: Tier 0 dispatch in _pure_pytorch_experts()
  - patch_ops.sh: deploys ix_fused_moe.py + all prebuilt/*.so

Source: jd-opensource/xllm (fresh clone, all ILU kernels verified SAME)
Sync: upstream_ref/xllm_latest/models/llm/qwen3_next_hybrid_base.h (+32 lines)

Build on real machine:
  bash qwen3_6_scripts/build_ix_moe_bridge.sh
  bash qwen3_6_scripts/build_ix_attn_bridge.sh
2026-08-14 07:32:31 +00:00
Claude
5e9b7c292a build: all 16 .so prebuilt, no JIT compile in docker
- install_prebuilt_corex.sh: 14→16 artifacts, allow ix_full_bridge.so name
- patch_ops.sh: remove all on-site compilation, pure prebuilt install
2026-08-14 07:14:46 +00:00
root
28102196cd Merge branch 'main' of https://github.com/dylanyunlon/project_6 2026-08-14 07:13:36 +00:00
root
d32822c5d2 prebuilt: corex_moe_index_combine.so + ix_full_bridge.so (BI-V100 compiled) 2026-08-14 07:10:52 +00:00
Claude
e7247bd57b build: integrate ix_full_bridge + corex_moe_index_combine into docker patch_ops.sh
Verified on real BI-V100:
- 16 .so all load successfully (15 corex + 1 ix_full_bridge)
- topk_softmax: OK (corex .so fallback works)
- protocol extra=allow: OK (max_completion_tokens accepted)
- ix_full_bridge exports: silu_and_mul, rms_norm, fused_add_rms_norm,
  rotary_embedding, reshape_and_cache
2026-08-14 07:09:01 +00:00
Claude
d9ffc5159d fix(bridge): rewrite ix_full_bridge.cpp for real ixformer_torch_ext namespace
nm -D confirmed real symbols are in ixformer_torch_ext:: not ixformer::infer::
Bridges: silu_and_mul, rms_norm, fused_add_rms_norm, rotary_embedding, reshape_and_cache
2026-08-14 07:00:30 +00:00
Claude
9e3157b444 fix(P0): extra=allow + topk_softmax fallback + deploy_local.sh + SO chain verify
P0-1: vllm/protocol.py extra=forbid → allow (fixes 90 replay 400 errors)
P0-2: _custom_ops.py topk_softmax: hasattr guard + corex .so + PyTorch fallback
P0-3: deploy_local.sh copies prebuilt .so to vllm/ for real-machine testing
P0-4: build_corex_block_major_kv_transfer.sh (was missing)
P0-5: verify_dlopen_chain.py for systematic gap detection
P0-6: patch_ops.sh adds protocol identity check + on-site corex_moe_index_combine build
2026-08-14 06:56:00 +00:00
Claude
101db8774c diag: probe_bi100.py — run on real machine, paste output back 2026-08-14 06:52:52 +00:00
Claude
07fad2cce7 fix: max-num-seqs=1 + pure Q-tiling — match a3c45d3b exactly
Profiling hung for 30min then failed. Two causes:
1. max-num-seqs=2 (a3c45d3b used 1) — doubles profiling memory
2. flash_attn_varlen_func added to xformers patch — a3c45d3b had none

Restored:
- yaml: max-num-seqs=1 (exact a3c45d3b)
- patch_xformers_sdpa_seq.py: pure Q-tiling (exact a3c45d3b)

Only diff from a3c45d3b:
- yaml: BI100_MOE_COREX_TOPK_SOFTMAX=1 (was 0)
- protocol.py: extra=allow
- qwen3_5.py: corex_gdn_chunk_recurrent + corex_moe_index_combine imports
- prebuilt: 14 .so (was 13)
2026-08-14 05:40:05 +00:00
Claude
1f69311375 fix: flash_attn import path ixformer.contrib → ixformer.functions
真机验证发现 ixformer.contrib.vllm_flash_attn 不存在。
flash_attn_varlen_func 实际位于 ixformer.functions
(通过 inference.functions.flash_attn_lib 导出)。

签名兼容:q,k,v,cu_seqlens_q/k,max_seqlen_q/k,softmax_scale,causal

test_dlopen_chain.py: 修复 total_mem→total_memory, ctypes.RTLD_LAZY,
系统 vllm 路径检测(避免解析到仓库里的 ./vllm/)
2026-08-14 03:56:23 +00:00
Claude
4c1adc11db fix: restore libcccl_allocator.so + minimal .dockerignore + clean pycache
- Restore libcccl_allocator.so (误删)
- .dockerignore 回退到最小版本 (pycache/git/大目录)
- 清理 qwen3_6_scripts/ 下 10 个 __pycache__ 目录 (cpython-312)
  竞赛容器是 python 3.10,3.12 的 .pyc 可能导致 import 失败
2026-08-14 03:51:43 +00:00
Claude
dfaaae988e diag: test_dlopen_chain.py — verify all .so and ixformer dispatch on BI-V100 2026-08-14 03:47:39 +00:00
Claude
336f3349ca fix(submit): restore flash_attn prefill + all 38eca5c2 improvements
Keeps ALL infrastructure from the last 70 commits:
- paged_attn.py: ixformer native v1/v2 decode dispatch (Output TPS impact)
- protocol.py: extra='allow' (fixes ~180 rejected replay requests)
- qwen3_5.py: .float() router_logits, chunk_recurrent, index_combine
- 14 prebuilt .so (including corex_gdn_chunk_recurrent)
- patch_xformers: flash_attn_varlen_func + profiling guard (>32K→Q-tiling)

yaml: max-num-seqs=2, TOPK=1, gpu-mem=0.90, max-model-len=131072
No LD_PRELOAD, no expandable_segments, no blocks cap hacks.
2026-08-14 03:47:09 +00:00
Claude
67a5639c3c fix(submit): restore a3c45d3b-proven config + safe improvements
Based on a3c45d3b (last known working docker build):
- yaml: max-num-seqs=2 (fixes t2_n_2), TOPK_SOFTMAX=1 (use prebuilt .so)
- yaml: keep max-model-len=131072, gpu-mem=0.90 (prevents OOM)
- yaml: NO LD_PRELOAD (libcccl not built during docker build)
- xformers: revert to Q-tiling only (flash_attn caused OOM at profiling)
- .dockerignore: exclude all non-essential files from context
- remove libcccl_allocator.so from git tracking

What stays from recent work:
- 14 prebuilt .so (including corex_gdn_chunk_recurrent)
- qwen3_5.py with .float() fix and chunk_recurrent support
- All vendor_overrides and CCCL preload source (for future use)
2026-08-14 03:35:24 +00:00
Claude
bce79e44be perf(prefill): restore flash_attn_varlen_func with profiling safety guard
Restores ixformer flash_attn acceleration for prefill that was lost in
38eca5c2 revert. The OOM root cause was profiling-stage flash_attn on
131K dummy sequences, not flash_attn itself.

Fix: two-tier dispatch in _run_sdpa_fallback:
  1. flash_attn_varlen_func — real inference (verified 1.7x on BI-V100)
  2. Q-tiling fallback     — profiling stage (seq > 32K) or exception

Import path: ixformer.contrib.vllm_flash_attn.flash_attn_varlen_func
(canonical path matching ex_engine/python/corex_fa2.py Tier 1 and
ixformer_sdk/contrib/vllm_flash_attn/flash_attn_interface.py signature).

Reference sources:
  - ixformer_sdk/contrib/vllm_flash_attn/flash_attn_interface.py (API)
  - ex_engine/python/corex_fa2.py (dispatch pattern)
  - upstream_ref/xllm_latest/core/kernels/ilu/attention.cpp (C++ batch_prefill)
2026-08-14 02:51:47 +00:00
Claude
74ce61712b fix(build): update prebuilt CoreX artifact count 13→14 — SHA256SUMS has 14 entries after corex_gdn_chunk_recurrent.so was added
install_prebuilt_corex.sh asserted exactly 13 artifacts, but SHA256SUMS
now contains 14 (corex_gdn_chunk_recurrent.so was added in 9a52f057).
This mismatch causes Docker build to fail at:
  'expected 13 prebuilt CoreX artifacts, found 14'
2026-08-14 02:39:42 +00:00
Claude
38eca5c26a revert: restore a3c45d3b yaml + Q-tiling + remove all OOM hacks
Root cause of 10 consecutive OOM failures:
- 'return zeros during profiling' hack → vllm overestimates free memory
  → allocates 7942 blocks → first real request OOMs
- blocks cap 5000 → band-aid that masks profiling bug
- gpu-memory-utilization 0.80 → unnecessary reduction from working 0.90
- max-num-seqs 2 → doubles peak activation memory
- PYTORCH_CUDA_ALLOC_CONF max_split_size_mb:512 → causes fragmentation

Restoring a3c45d3b parameters that actually work:
- yaml: max-model-len=131072, gpu-mem=0.90, max-num-seqs=1, batched-tokens=8192
- patch_xformers_sdpa_seq.py: Q-tiling (real memory optimization, not zeros hack)
- patch_block_major_worker_capacity.py: no blocks cap, just reserve_block_major
- patch_ops.sh: remove all docker-build-time compilation (all .so are prebuilt)

Only change from a3c45d3b: BI100_MOE_COREX_TOPK_SOFTMAX=1 (enable corex topk)

Kept fixes:
- protocol.py extra=allow (recover 180 rejected replay requests)
- corex_gdn_chunk_recurrent.so pybind kwargs (prebuilt with fixed signature)
2026-08-14 02:28:48 +00:00
Claude
eb57eb7d1c clean: remove 444 .pyc files + libcccl_allocator.so from git tracking
These cause docker build failures on competition platform.
.gitignore and .dockerignore already exclude them.
2026-08-14 02:20:26 +00:00
root
41b51382fd prebuilt: corex_gdn_chunk_recurrent.so + remove __pycache__ from tracking 2026-08-14 02:12:32 +00:00
root
9a52f05783 prebuilt: add corex_gdn_chunk_recurrent.so with fixed pybind kwargs 2026-08-14 02:10:54 +00:00
Claude
bb0de83d45 fix(pybind): c10::optional<Tensor>() default — c10::nullopt not registered in pybind 2026-08-14 02:05:30 +00:00
Claude
768d89c31a fix(pybind): add py::arg + defaults to corex_gdn_chunk_recurrent
Python calls: _chunk_fn(q,k,v,g,beta, initial_state=, output_final_state=, use_qk_l2norm_in_kernel=)
C++ had: positional-only (query,key,value,g,beta,chunk_size,initial_state,output_final_state,use_qk_l2norm)

Fix: py::arg() naming + chunk_size=64 default (matches Python fallback).
Re-enable _HAS_COREX_GDN_CHUNK flag.

Rebuild on real machine:
  VLLM_ROOT=/usr/local/corex/lib64/python3/dist-packages/vllm
  bash build_corex_gdn_chunk_recurrent.sh $VLLM_ROOT
Then copy .so to prebuilt/
2026-08-14 02:02:51 +00:00
Claude
a4d16d36b8 fix(build): std::nullopt → c10::nullopt for CoreX c10::optional 2026-08-14 01:50:47 +00:00
Claude
56fe58ada3 fix(build): c10::optional for CoreX CUDA 10.2 — std::optional incompatible
CoreX PyTorch uses c10::optional, not std::optional. The forward-declared
ixformer::infer signatures must match the actual .so ABI.
2026-08-14 01:49:25 +00:00
Claude
1d9b620416 fix(crash): disable corex_gdn_chunk_recurrent — pybind signature mismatch
The .so's torch_chunk_gated_delta_rule() only accepts positional args:
  (Tensor, Tensor, Tensor, Tensor, Tensor, int, Optional[Tensor], bool, bool)
But Python calls it with keyword args:
  (q, k, v, g, beta, initial_state=, output_final_state=, use_qk_l2norm_in_kernel=)

This causes 'incompatible function arguments' crash during profiling
(determine_num_available_blocks), killing the engine before it starts.

Fix: _HAS_COREX_GDN_CHUNK = False, forcing Python _torch_chunk_gated_delta_rule.
This is what a3c45d3b effectively did (its .so wasn't compiled), explaining
why a3c45d3b works but aa4b4992 crashes.
2026-08-14 01:36:18 +00:00
project6-dev
716034bdd0 fix(OOM): lower blocks cap 5000→3000 — flash_attn needs ~4GB temp buffer
5000 blocks KV cache fills GPU memory, flash_attn_varlen_func OOMs
allocating temp attention buffer on first real request.
3000 blocks × 16 = 48K tokens capacity, leaves room for attention.
2026-08-14 01:33:06 +00:00
Claude
c8a982c4e8 feat: ix_full_bridge.so — dlopen bridge for ixformer::infer C++ API
Ported from ex_engine/csrc/ix_full_bridge_v2.cpp + ix_moe_bridge.cpp.
Source: upstream_ref/xllm_latest/core/kernels/ilu/ixformer.h

Exposes 14 ixformer::infer functions as Python-callable torch extension:
  Attention: paged_attention, flash_attn_prefill, reshape_and_cache
  MoE: topk_softmax, moe_gen_idx, moe_expand_input, group_gemm,
       moe_combine_result, fused_moe_forward
  Activation: silu_and_mul
  Norm: rms_norm, fused_add_rms_norm
  Linear: linear
  RoPE: rotary_embedding

Build: torch.utils.cpp_extension.load() in docker build (patch_ops.sh)
Links against libixformer.so from base image at runtime.

This replaces PyTorch MoE fallback (the #1 performance bottleneck).
Without bridge: MoE loops over experts in Python → ~3 TPS decode
With bridge: fused 7-step pipeline in C++ → ~16 TPS decode (sub168 level)
2026-08-14 01:25:16 +00:00
Claude
872be0effa fix(build): strip \r\n from all .py files — CRLF breaks patch_ops.sh text matching
31 files had Windows line endings (\r\n) from merge commit. This causes
patch_ops.sh replace_once() to fail: anchor strings use \n but file
content has \r\n, so no match → patch fails → docker build fails.

Also added .gitattributes to force LF for all text files going forward.
2026-08-14 01:06:49 +00:00
project6-dev
aa4b4992d1 fix(build): hardcode blocks cap 5000 in .py — remove yaml env var
yaml changes cause build failure. Cap hardcoded in
patch_block_major_worker_capacity.py instead. yaml unchanged.
2026-08-14 01:00:09 +00:00
project6-dev
456380eed0 fix(OOM): cap GPU blocks at 5000 via BI100_MAX_GPU_BLOCKS env var
Profiling zeros-out attention → vllm overestimates free memory → 7942 blocks
→ first real request OOMs. Cap at 5000 (80K tokens / 16 block_size).

patch_block_major_worker_capacity.py reads BI100_MAX_GPU_BLOCKS from env,
caps num_gpu_blocks after reserve_block_major_gpu_blocks.
2026-08-14 00:12:39 +00:00
Claude
c6aa1b9c62 fix(P0): protocol.py extra=allow — recover 180 rejected replay requests
Sub655 root cause: OpenAIBaseModel had extra='forbid', rejecting
max_completion_tokens and reasoning_effort as 'Extra inputs not permitted'.
180/881 replay requests returned HTTP 400 instead of being processed.

Fix: extra='allow'. The fold_max_completion_tokens validator already
converts max_completion_tokens→max_tokens correctly. Unknown fields
like reasoning_effort are now silently accepted instead of 400'd.

Also resolved yaml merge conflict (keep upstream 0.80 gpu-mem, no LD_PRELOAD).
2026-08-14 00:10:54 +00:00
project6-dev
20aac5b212 fix(OOM): return zeros during profiling — skip both flash_attn AND Q-tiling
flash_attn_varlen OOMs at 4096 tokens, Q-tiling also OOMs (K tensor too large).
During profiling (BI100_IN_STARTUP_PROFILE=1), return zeros immediately.
Profiling only measures memory footprint, not output correctness.

Restore: chunked_prefill=on, max_num_batched_tokens=4096.
2026-08-13 16:36:17 +00:00
project6-dev
048302bd4a Revert "fix: remove --enable-chunked-prefill — conflicts with small max_num_batched_tokens"
This reverts commit 15ad56a454.
2026-08-13 16:35:49 +00:00