Commit Graph

5 Commits

Author SHA1 Message Date
project6-dev
d86b39d1ae refactor(corex): rewrite 3 dlopen modules to use real ixformer::infer dispatch chain
corex_moe.py:
  - Tier 0: ix_bridge.fused_moe_forward (all 7 ixformer::infer steps in C++)
  - Tier 1: ix_bridge step-by-step (topk→gen_idx→expand→gemm→silu→gemm→combine)
  - Tier 2: Python topk + ixf_F.silu_and_mul + torch.matmul expert loop

corex_gdn.py:
  - Gate clamping [-5, 0] (decay only) from real machine logs
  - State clamping ±100 prevents inf propagation

corex_fa2.py:
  - Tier 0: ix_bridge C++ paged_attention/flash_attn
  - Tier 1: ixformer.contrib.vllm_flash_attn Python
  - Tier 2: ixf_F.vllm_single_query_cached_kv_attention (V1)

All modules now use: ix_full_bridge.cpp → ixformer::infer → libixattn.so
Matches comp 168 actual dispatch chain from docker log.
2026-08-10 06:16:39 +00:00
EX Engine
1ae398eeee fix(interface): corex_moe accepts w13 merged format + no silent fallback
corex_moe.py: moe_forward now accepts both formats:
  Format A: w1(E,I,H) + w2(E,H,I) + w3(E,I,H) — xllm style, separate gate/up
  Format B: w13(E,2*I,H) + w2(E,H,I) + w3=None — vllm style, merged gate_up
  Auto-detects by checking if w3 is None, splits w13 internally.

qwen3_5.py:
  - Fix corex_moe call: use keyword args (w3=None, topk=self.top_k)
    prevents topk integer going to w3 tensor position
  - Remove silent fallback on corex_moe failure — raise RuntimeError
    with full shape info for diagnosis. Zero score with no error log
    is worse than a crash.
2026-08-10 04:36:16 +00:00
project6-dev
44d36e6ccc build: add MoE topk kernel precompile to patch_ops.sh + Dockerfile pipeline
patch_ops.sh: step 7 precompiles moe_topk_softmax_v3.cu during Docker build
corex_moe.py: expanded .so/.cu search paths for both pre-compiled and JIT scenarios

Docker build flow:
  1. COPY ex_engine/ → /workspace/ex_engine/
  2. patch_ops.sh deploys corex_moe.py + corex_gdn.py to vllm models dir
  3. patch_ops.sh runs precompile_moe_topk.py → .so cached
  4. At runtime, corex_moe.py loads cached .so (no JIT delay)

Competition submission ready.
2026-08-10 04:26:33 +00:00
project6-dev
f32ef97013 feat(MoE): verified CUDA topk_softmax kernel — zero fallback
moe_topk_softmax_v3.cu: BI-V100 verified (2026-08-10)
  - 64 experts, topk=8, warp shuffle, zero shared memory
  - renormalize: sum=1.0 ✓, no NaN ✓, no duplicate ids ✓
  - 881 token batch ✓
  - Compiler: corex clang/16, --cuda-gpu-arch=ivcore10
  - Stream: c10::cuda::getCurrentCUDAStream()

corex_moe.py: loads CUDA kernel, NO Python fallback
  - Searches pre-compiled .so → JIT compile from source → error
  - MoE pipeline: CUDA topk → cublas expert GEMM → ixformer silu_and_mul

precompile_moe_topk.py: Docker build-time compilation + verification

Key finding from real machine probing:
  ixformer::infer::topk_softmax is DECLARED in ixformer.h but
  NOT IMPLEMENTED in any .so in the base image (nm -D scan: zero hits).
  Must compile our own kernel.
2026-08-10 04:21:43 +00:00
project6-dev
1be9449883 feat(EX): corex_gdn + corex_moe — dlopen dispatch chain from comp 168 log analysis
From 2d5232c5 docker log analysis:
  07-23 (168's docker): corex_gdn.py + corex_moe.py → full fused kernels
  08-07 (our docker): missing both → NaN GDN + PyTorch MoE fallback

corex_gdn.py: GDN fused kernel dispatch
  - FlashQLA .so loading (gdn_forward.cu pre-compiled)
  - PyTorch chunked delta rule with fp32 accum + clamp (no NaN)
  - Decode single-step recurrent with state clamping

corex_moe.py: MoE fused pipeline
  - topk_softmax: replaces MISSING ixf_F.vllm_moe_topk_softmax
  - Per-expert GEMM via torch.matmul (cublas under the hood)
  - ixformer.silu_and_mul for activation when available

DLOPEN_DISPATCH_CHAIN.md: complete .so loading chain map
deploy_corex_modules.sh: wire into VLLM/model_executor/models/
2026-08-10 03:37:15 +00:00