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
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
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
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)
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'
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.
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.
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).
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.
chunked_prefill requires max_num_batched_tokens >= max_model_len/max_num_seqs
= 80000/2 = 40000. But we need small batched_tokens for profiling OOM.
Without chunked_prefill, max_num_batched_tokens=2048 is fine for profiling
and real inference processes full sequences in one pass.
flash_attn skip worked but Q-tiling fallback still OOMs at 4096 tokens.
K tensor: [28_heads, 4096, 256] float32 = 112MB per layer slice.
At 256 tokens: [28, 256, 256] = 7MB — safe for profiling.
This only affects profiling dummy batch size. Real inference chunked
prefill still processes up to max_model_len tokens.
flash_attn_varlen_func allocates O(n²) temp memory for 4096 dummy tokens
during profile_run, causing OOM at gpu_memory_utilization=0.80.
BI100_IN_STARTUP_PROFILE=1 env var is already set by
patch_worker_startup_profile_guard.py during the synthetic forward pass.
Real inference requests still use flash_attn_varlen (much faster).
verify_submission.sh confirmed: CCCL preload compiles and loads on BI-V100.
Was removed in 8d2f30f0 due to crash concern, but the .so is built by
patch_ops.sh during docker build so it will always exist at runtime.
These 14 lines were added after a3c45d3b (last confirmed working build).
The cccl_preload build and corex extension compile steps may cause
docker build failure on the competition platform even with || fallback.
Reverting to the exact patch_ops.sh from a3c45d3b.
.cu and .sh source files remain in the repo for future use.
commit 4c365b8c added 1106 CCCL device-level headers (294K lines) to
qwen3_6_scripts/cccl_preload/include/. These are NOT used by the allocator
preload (which only needs cub/util_allocator.cuh + 288 transitive deps)
and cannot compile on corex CUDA 10.2 anyway.
The extra headers doubled docker context from 15MB to 31MB, likely
causing platform build timeout or size limit failure.
Restoring to the original 288-header set that is proven to compile and run.
Profiling OOM: flash_attn_varlen_func allocates large temp buffers during
profile_run with 8192 dummy tokens. patch_worker_profile_override.py already
has skip logic when num_gpu_blocks_override is set.
4000 blocks × 16 tokens/block = 64K token KV capacity.
With max-model-len=80000 and prefix caching, this is sufficient.
Sub 168 reference: ran 262K context on 0.95 util without override because
base image profiling doesn't use flash_attn_varlen (uses native xformers).